History log of /haiku/headers/private/interface/PictureProtocol.h
Revision Date Author Comments
# 4399ec51 10-Jun-2020 X512 <danger_mail@list.ru>

BPicture: add fill rule support

Change-Id: I068e1c2e8659f7b90c6d7c7331a8bb25ae343fe9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2922
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 90ab1a44 27-May-2020 X512 <danger_mail@list.ru>

BPicture: add gradient support

Fixes #9680.

Change-Id: I0013326559cc40ff26cf7b44794c0b32aea832ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2829
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>


# 954a0a0c 02-Jan-2019 Stephan Aßmus <superstippi@gmx.de>

Fix some cases of updating draw state while recording a BPicture

* Also implemented recording DrawString(string, length,
BPoint[] locations), which was previously not recorded at all.
* Also implemented playing back recently added drawing commands
in PicturePlayer.cpp. I don't quite understand what this is
actually used for, but it seemed it was forgotten. I just followed
the pattern already established in the code.
* The other important bit in this change is to update the pen
location when it is needed while recording a BPicture. Often
the BView will use PenLocation() in order to transmit drawing
commands to the app_server which use absolute coordinates only.
This isn't actually so nice, since it means the client has to
wait for the server to transmit the current pen location. If there
were dedicated link-commands for pen-relative drawing commands,
the client could just keep sending without waiting for the server.
In any case, the app_server needs to update the pen location in
the current DrawState and even the DrawingEngine even while
recording a picture, because some next command may need up-2-date
state information, such as the font state and the pen location.
* I have not yet tried to find /all/ instances where the DrawState
needs to be updated while recording. This change should repair
/all/ font state changes, all versions of drawing a string, and
all versions of StrokeLine().

Change-Id: Ia0f23e7b1cd058f70f76a5849acb2d02e0f0da09
Reviewed-on: https://review.haiku-os.org/c/817
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>


# 25dbf74b 10-Nov-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

BView: add methods for affine translation/scaling/rotation

* BView::TranslateBy(), BView::ScaleBy() and BView::RotateBy()
allow to conveniently modify the current affine transformation.
This makes it unnecessary to first read the current transform,
modify it, and then set it again.
Uses the new Pre...() methods of BAffineTransform.

* Also, remove setting the transform "through" to the BView even
while recording a BPicture, as this now results in transforms
being applied more than once.


# 4bd6f322 09-Nov-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

app_server/Interface Kit: add new clipping API

* Add new clipping API for rectangles (ClipToRect, ClipToInverseRect)
and shapes (ClipToShape, ClipToInverseShape)

* Works with affine transforms and automatically switches from fast
region-based clipping to alpha-mask based clipping as necessary.

* Always self-intersecting, i.e. no state push required to further
narrow down the clipping region. All of the 4 new methods can be
mixed in any order.


# 551438b9 25-Jul-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

app_server: add new BView layers API

* Add new methods
BView::BeginLayer(uint8 opacity)
BView::EndLayer()

* All drawing between begin and end of a layer is redirected onto an
intermediate bitmap. When ending the layer, this bitmap is
composited onto the view with the opacity given when the layer was
started.

* Layers can be nested arbitrarily and will be blended onto each
other in order. There can also be any arbitrary interleaving of
layer begin/end and drawing operations.

* Internally, drawing commands are redirected into a BPicture between
BeginLayer and EndLayer (but client code need not know or care
about this). Client code can also start/end other BPictures while
inside a layer.

* Uses the PictureBoundingBoxPlayer to determine the size of the
layer bitmap before allocating and drawing into it, so it does not
allocate more memory than necessary and -- more importantly -- it
will not alpha-composite more pixels than necessary.

* Drawing mode is always set to B_OP_ALPHA, blend mode to
(B_PIXEL_ALPHA, B_ALPHA_COMPOSITE) while inside layers. This is
necessary for (a) correct compositing output and (b) for
redirection of drawing into the intermediate bitmap, which uses the
renderer_region offset (in B_OP_COPY, the Painter does not use the
AGG renderer methods, it directly accesses the pixel data. This
would access out-of-bounds without the offset, so B_OP_COPY cannot
be allowed.)
To ensure these modes aren't changed, BView::SetDrawingMode()
and BView::SetBlendingMode() are ignored while inside a layer.

* The main motivation behind this new API is WebKit, which internally
expects such a layers functionality to be present. A performant and
reusable implementation of this functionality can only be done
server-side in app_server.


# a6db6bd4 04-Feb-2014 Stephan Aßmus <superstippi@gmx.de>

Added WIP support for affine transformations to BViews.

Everything untested, but compiles, so it must work. The idea is to introduce
BAffineTransform additionally to the existing Origin and Scale properties of
BViews. One may use it in parallel or as an alternative. Painter in app_server
is not yet aware of the additional transformation. It is however already used
to transform drawing coordinates. It probably needs to work differently,
perhaps only in Painter and AGGTextRenderer.


# 46b4e489 16-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added some debug output to PicturePlayer. Since checking the table size for every op is very slow, now we do that only at the beginning, and use a custom op table if needed. The best case (which is the one used when drawing a picture with BView::DrawPicture()) is very fast since it only requires one check.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21972 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7dce0c35 28-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed unused stuff

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17257 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ed6b7e4 21-Nov-2003 DarkWyrm <darkwyrm@gmail.com>

Tweaked a def to remove a conflict with Accelerant.h


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5438 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 402922f4 18-Mar-2003 DarkWyrm <darkwyrm@gmail.com>

Added BPicture to IK for Marc Flerackers


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2943 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a6db6bd40fe3492fd3104dba560f0e3ff61d388d 04-Feb-2014 Stephan Aßmus <superstippi@gmx.de>

Added WIP support for affine transformations to BViews.

Everything untested, but compiles, so it must work. The idea is to introduce
BAffineTransform additionally to the existing Origin and Scale properties of
BViews. One may use it in parallel or as an alternative. Painter in app_server
is not yet aware of the additional transformation. It is however already used
to transform drawing coordinates. It probably needs to work differently,
perhaps only in Painter and AGGTextRenderer.


# 46b4e489982de2e3ddfab11c68c714f6c1be4598 16-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added some debug output to PicturePlayer. Since checking the table size for every op is very slow, now we do that only at the beginning, and use a custom op table if needed. The best case (which is the one used when drawing a picture with BView::DrawPicture()) is very fast since it only requires one check.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21972 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7dce0c352e577dc076dec420d202bf76cf1963d8 28-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed unused stuff

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17257 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ed6b7e48b15777603fb430384aa8daddae28cbe 21-Nov-2003 DarkWyrm <darkwyrm@gmail.com>

Tweaked a def to remove a conflict with Accelerant.h


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5438 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 402922f4006f04d3e1467d9d4c685b0f4025c9f4 18-Mar-2003 DarkWyrm <darkwyrm@gmail.com>

Added BPicture to IK for Marc Flerackers


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2943 a95241bf-73f2-0310-859d-f6bbb57e9c96