History log of /haiku/headers/private/interface/PictureDataWriter.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.


# ce27f961 05-Sep-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implement ClipToPicture inside a BPicture. Not working yet.
BView::ClipToPicture doesn't work anymore, when nested inside a BPicture,
This happened when its implementation was moved server-side.


# 2c3505de 16-Mar-2015 John Scipione <jscipione@gmail.com>

PictureDataWriter: Style fixes only

No functional change intended


# 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.


# 8752f52d 28-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added an (empty) destructor. Use a const BRegion (since we can now), honour
the 80 column limit. Some comment clarification.


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


# f6e4cbb9 15-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


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


# b1af0a7a 10-Sep-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Setting the font shear in a BPicture didn't work, because the value was
treated as uint32 in some places, when it's a float.


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


# 253d42a6 14-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented SetClipping op, but it's not working yet (looks like it's
never written into the data stream)


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


# feb557a6 14-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented WriteSetFontFamily() and WriteSetFontStyle(). Only the
server side functions are missing.


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


# 37033892 14-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented SetPattern op. Reduced the buffer size to 4096 again.


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


# 690c7474 13-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented BPicture's SetPenLocation() op, also nested
AppendToPicture() (but still doesn't work :( ). Moved some functions
around in PictureDataWriter.h.


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


# ed5de868 13-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented the following BPicture ops: fill region, stroke/fill arc,
stroke/fill polygon, stroke/fill bezier. some work towards drawing of
nested pictures.


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


# 140334f8 12-May-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added error checking using exceptions


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


# 4bfa8f22 03-May-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

completes previous commit. Sorry for breaking the build


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


# a3d758e3 13-Mar-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added support for font settings in PictureDataWriter. Not used yet


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


# 0c48fc7c 28-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Enable state synching for ServerPictures. Fixes bug 520


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


# 7022e790 13-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

added license

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


# 420fe80e 12-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved picture data writing to its own class, thus simplifying code in
various places. Implemented SetLineMode op for BPicture, fixed shape
drawing (I accidentally broke it in the previous commit).


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


# ce27f9612e78bbb58c62bdc54c02bfc0e5172681 05-Sep-2015 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implement ClipToPicture inside a BPicture. Not working yet.
BView::ClipToPicture doesn't work anymore, when nested inside a BPicture,
This happened when its implementation was moved server-side.


# 2c3505de79a59e03adcecef37b9a305d2f80ae49 16-Mar-2015 John Scipione <jscipione@gmail.com>

PictureDataWriter: Style fixes only

No functional change intended


# 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.


# 8752f52d717fdfd88e6dbed22e76eeb2299418db 28-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added an (empty) destructor. Use a const BRegion (since we can now), honour
the 80 column limit. Some comment clarification.


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


# f6e4cbb95290a74b33d012600438b84742b0e572 15-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


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


# b1af0a7a247358c80de46e5400f572d2f00fca3a 10-Sep-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Setting the font shear in a BPicture didn't work, because the value was
treated as uint32 in some places, when it's a float.


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


# 253d42a602bc2ed053cf9a5f400bb95070f91da5 14-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented SetClipping op, but it's not working yet (looks like it's
never written into the data stream)


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


# feb557a6d116eef4567aa523d68fc1e7feef378c 14-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented WriteSetFontFamily() and WriteSetFontStyle(). Only the
server side functions are missing.


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


# 37033892c523295d91f189d37ed65474dfac7046 14-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented SetPattern op. Reduced the buffer size to 4096 again.


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


# 690c7474a4d9597b5deceeaa4b582f2b2a6baaaf 13-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented BPicture's SetPenLocation() op, also nested
AppendToPicture() (but still doesn't work :( ). Moved some functions
around in PictureDataWriter.h.


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


# ed5de868df775fceddb5abedec7eab9bd5147d51 13-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented the following BPicture ops: fill region, stroke/fill arc,
stroke/fill polygon, stroke/fill bezier. some work towards drawing of
nested pictures.


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


# 140334f858c7c02f3187b668dd2b79dbc2580efa 12-May-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added error checking using exceptions


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


# 4bfa8f22dfda8b6eeae58696cf5a1dfe779ff00c 03-May-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

completes previous commit. Sorry for breaking the build


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


# a3d758e3690cd335fb1afcd5b4d4c1c67def045a 13-Mar-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added support for font settings in PictureDataWriter. Not used yet


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


# 0c48fc7c746f8c243daaf673d08671f43bf0e3e1 28-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Enable state synching for ServerPictures. Fixes bug 520


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


# 7022e7903acfbe57d3665c177f015a44afcdac76 13-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

added license

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


# 420fe80e5c3dc9765da5343c511071d63bcb81cb 12-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved picture data writing to its own class, thus simplifying code in
various places. Implemented SetLineMode op for BPicture, fixed shape
drawing (I accidentally broke it in the previous commit).


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