History log of /frameworks/base/libs/hwui/Snapshot.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b29b16e5423fe7deab8ebf3da512c6d2192f19b5 04-Jan-2017 Derek Sollenberger <djsollen@google.com> Remove clipRegion from the public API.

This API is difficult to support for printing and has other negative
effects as it does not respect the current matrix/clip.

Test: compile
Bug: 14650725
Change-Id: I71f9bd687d446c7ce8910d755421aad8e09458db
6c67f1d04591f44bccb476d715a005ad5bbdf840 14-Dec-2016 Mike Reed <reed@google.com> SkClipOp is now an enum class

Change-Id: If423dd013a264162ae0b7674a0eeef34bc2cdaae
6e49c9f007c879f05b035c40c0ba543c00f9d0d0 02-Dec-2016 Mike Reed <reed@google.com> switch over clip calls to use SkClipOp instead of SkRegion::Op

Change-Id: I67d23c487b5249bc31d96e3b2393f693c0b2bcff
5e00c7ce063116c11315639f0035aca8ad73e8cc 07-Jul-2016 Chris Craik <ccraik@google.com> Delete old rendering pipeline

fixes: 30002246

Change-Id: I45df0e924708526cee045b14c291bd23aa1a92db
04d46eb69fb4f4c4c332c36c6ae845da3b2ae848 07-Apr-2016 Chris Craik <ccraik@google.com> Support replace op in new pipeline


Change-Id: Ie48d2da30f5e9d9abe88a5cd973dfb26e38abf63
678ff81105753656aa4822f4f675ef96dc9d2b83 01-Mar-2016 Chris Craik <ccraik@google.com> Clip projected ripples to outlines


Also fixes positioning of ripples to a scrolled projection receiver.

Change-Id: I74b7233c46d7c15839ca8bf50e188ba6646d7432
7a89600bac7ab889a5ba8a994c57d677de0e45d5 20-Feb-2016 Chris Craik <ccraik@google.com> Add create_trivial_array

Change-Id: I5e4236ff59fdaceb95105c5590f4deeda6d0b4c8
7df9ff2a08fd4bbd9b2e734a357cffcf64675df9 11-Feb-2016 John Reck <jreck@google.com> Fix all LA memory leaks forever!

Bug: 27072626

Or at least fix this one and make it harder to leak
going forward. static_asserts are cool, use them liberally

Also makes allocation via LA (slightly) faster by fixing create*
variants to use rvalue references & std::forward, preventing
an accidental pass-by-value

Change-Id: I18fd696a93dd6ea49c8d8c587d4c8bee56dbfdf5
e537330ead4111cae74668bbc25a332e186d6c91 11-Feb-2016 John Reck <jreck@google.com> Revert "Fix all LA memory leaks forever!"

This reverts commit 499d83f21e7ffb687788bba1668b05fe38f6ebaf.

Change-Id: Ia893ae16ebbeae68e49cd13a20587104b73d39a0
499d83f21e7ffb687788bba1668b05fe38f6ebaf 11-Feb-2016 John Reck <jreck@google.com> Fix all LA memory leaks forever!

Bug: 27072626

Or at least fix this one and make it harder to leak
going forward. static_asserts are cool, use them liberally

Also makes allocation via LA (slightly) faster by fixing create*
variants to use rvalue references & std::forward, preventing
an accidental pass-by-value

Change-Id: I5e0e36e72c6dd93324194ebf9a95f8204f05f261
b87eadda1818034ce03d85f30388384d1ac65916 06-Jan-2016 Chris Craik <ccraik@google.com> Partial unclipped save layer support

Not yet implemented in renderer.

Change-Id: I491ec6e7886bfa313d1db71dd5981690d45b78a9
e4db79de127cfe961195f52907af8451026eaa20 23-Dec-2015 Chris Craik <ccraik@google.com> Stencil support in new recorder/reorderer


Adds complex (non-rectangular) clipping support, and overdraw
visualization. Doesn't support stencil clipping in layers.

Change-Id: I8d10c7f1d2769ab5756774ca672344cc09901f87
a2a70723b8cbda4354d23f901f995623e819012c 17-Dec-2015 Chris Craik <ccraik@google.com> Simplify ClipArea to prefer Rect args

Change-Id: I8af83d01dc5dd8009a0cd235dd8b59dab61d8560
6fe991e5e76f9af9dab960100d5768d96d5f4daa 20-Oct-2015 Chris Craik <ccraik@google.com> Work to support saveLayer in new pipeline

clipped SaveLayers will now be pulled to the beginning of the frame,
prior to drawing FBO 0. This will remove the need for switching FBOs

Change-Id: I4d8dc1f845e84e9b49d5acdf4f4703eef4a9cb06
d9ee550888011a64fa3f35e666360ec8278597d8 06-Oct-2015 John Reck <jreck@google.com> Reduce, reuse, recycle SNAPSHOTS!

Shaves like, 1 whole us off of reset

Change-Id: I459370448583d5e22fd302ba1353319564a814be
4d3e704b04c6abd7995df640d12662b0271f6c7b 20-Aug-2015 Chris Craik <ccraik@google.com> Remove return values from clipping operations


Also switch mode to enum class

Change-Id: Iabb38634c01f2e3203b1b715967d8828d95da190
fca52b7583d1e5f5ff8ed06554875d2a30ef56fa 28-Apr-2015 Chris Craik <ccraik@google.com> Use path intersection instead of saveLayer+mesh to mask projected ripples


SaveLayer's performance cost is high, and proportional to the surface
being projected onto. Since ripples (even unbounded ones) are now
always projected to the arbitrary background content behind them, this
cost is especially important to avoid.

This removes the last semi-secret, saveLayer from the projected
ripple implementation.

Also fixes the HW test app to correctly demonstrate this projection
masking behavior.

Additionaly, alters PathTessellator to gracefully handle
counter-clockwise paths, and simplifies the work done by
ShadowTessellator to ensure all of its paths are counterclockwise.

Change-Id: Ibe9e12812bd10a774e20b1d444a140c368cbba8c
487a92caef2eb90a62e8f8d7a6fe6315f1c1d8d8 06-Jan-2015 Rob Tsuk <robtsuk@google.com> Clipping performance improvements

Create a ClipArea class to handle tracking clip regions. This class can
select the most efficient implementation depending on the types of
clipping presented.

ClipArea re-used the rectangle and region-based clipping
implementations as well as adding a "list of rotated rectangles"
approach that is more efficient for rotated views with children.

Change-Id: I2133761a2462ebc0852b394220e265974b3086f0
e83cbd451868a734bfac07ccd680d5617080b579 04-Sep-2014 Chris Craik <ccraik@google.com> Prioritize reveal clipping over Outline clipping


Also update docs around clipping nesting behavior,
and some Z ordering behavior.

Change-Id: Iaa204350a0adfdcbd8c4b821fb4a9c0ae22f2613
69e5adffb19135d51bde8e458f4907d7265f3e23 14-Aug-2014 Chris Craik <ccraik@google.com> Define shadow casting behavior within layers


Savelayers and HW layers both now support shadow casting.

For save layers, the light source should always be correct, for HW
layers, the light source position is set when the layer is created,
and updated when it is resized.

Change-Id: Ie85567dd43c2bb0a0b08fd0bd4db41efa793ac2b
af4d04cab6d48ae0d6a5e79bd30f679af87abaad 29-Jul-2014 Chris Craik <ccraik@google.com> Use RoundRect clipping for circle reveal animation


Also, remove inverse clipping feature from reveal animator.

Change-Id: I770a4eb48cd123b0ca0f39d16a0f3eefd1be3653
f2985ba3f41c4619f7b64797d07e3a008e17b20a 19-May-2014 Chris Craik <ccraik@google.com> Merge "Correct viewport initialization, bounds comparison"
1a49868fd82f8975da5685fdb6ca3cc83a99bdf5 18-May-2014 Ben Cheng <bccheng@google.com> Use default visibility for Snapshot::getLocalClip (attempt #2).

The change appeared to be dropped.
See commit 65ba94f79d6e737c3e66c09032221999b2eb50d7 for details.

Change-Id: Ib60968d6327ef04d21e4adca2c394f66343f204b
deeda3d337aed1eee218b89a7aba5992ced371f0 06-May-2014 Chris Craik <ccraik@google.com> Round rect outline clipping

Change-Id: Iee9cf4f719f6f1917507b69189ad114fa365917b
924197513aa2df4c1fb2977c1727f5d2c21f2689 15-May-2014 Chris Craik <ccraik@google.com> Correct viewport initialization, bounds comparison

Change-Id: Ibd751856e3712991e149800ed179464397dad7c3
a64a2bef1048db5a742843f1e3bea9e80d0defc5 14-May-2014 Chris Craik <ccraik@google.com> Combine projection matrix, and viewport management

Merge management of ortho projection matrix with the viewport size,
since they should always be changed together.

Change-Id: Iccb8f30828f4fb7848999ac54852e7ed2d6f2eb1
ddc52285ca6fd147f442a21e90e0e4702a10d304 11-May-2014 Jorim Jaggi <jjaggi@google.com> Revert "Simplify projection matrix management."

This reverts commit 0efaa71d5414287ed4beac0a88cf76f7e33a1e74.
0c0ec26366045e515790a6acdab782965efc63b4 10-May-2014 Chris Craik <ccraik@google.com> Simplify projection matrix management.

Store in and use from snapshot, and remove the kFlagOrthoDirty flag,
as it's redundant with kFlagIsFboLayer.

Change-Id: I2bd380192d50117f4ce1fd2058213669a886f406
3f085429fd47ebd32ac2463b3eae2a5a6c17be25 16-Apr-2014 Chris Craik <ccraik@google.com> Clip TouchFeedbackDrawable effect to receiver Outline

Projected RenderNodes are now wrapped with a ClipRect or masked
SaveLayer, so that they are clipped to the outline of the projection
receiver surface.

Change-Id: I1d4afc1bb5d638d650bc0b1dac51a498f216773e
65ba94f79d6e737c3e66c09032221999b2eb50d7 02-Apr-2014 Ben Cheng <bccheng@google.com> Use default visibility for Snapshot::getLocalClip.

The method is in libhwui.so but used by libandroid_runtime.so
(via android_view_GLES20Canvas.cpp). If the compiler decides not to
inline this method, the linker won't be able to resolve the dependency
when it has hidden visibility.

The problem is found when testing GCC 4.9.

Change-Id: I3b4d096c7767f0bef0796886dfb2c5ba2ecff48c
5f803623559aab395a29d575c37c4e39c23a4b4e 21-Mar-2013 Chris Craik <ccraik@google.com> Isolate tiling clip state from snapshot


Snapshots frequently have their clip overwritten due to applying
deferred state - now, store tiling clip information in a separate
rect, outside of the snapshot so it isn't overwritten.

Change-Id: I21ca4c45dcd802eae99e8de86f11525196777ccb
8ce00301a023eecaeb8891ce906f67b513ebb42a 16-Jan-2013 Romain Guy <romainguy@google.com> Implement clipRect with a transform, clipRegion & clipPath
Bug #7146141

When non-rectangular clipping occurs in a layer the render buffer
used as the stencil buffer is not cached. If this happens on a
View's hardware layer the render buffer will live for as long
as the layer is bound to the view. When a stencil buffer is
required because of a call to Canvas.saveLayer() it will be allocated
on every frame. A future change will address this problem.

If "show GPU overdraw" is enabled, non-rectangular clips are not
supported anymore and we fall back to rectangular clips instead.
This is a limitation imposed by OpenGL ES that cannot be worked
around at this time.

This change also improves the Matrix4 implementation to easily
detect when a rect remains a rect after transform.

Change-Id: I0e69fb901792d38bc0c4ca1bf9fdb02d7db415b9
a3dc55f83ab583e0a66b893c71b849afa046770a 28-Sep-2012 Romain Guy <romainguy@google.com> Fix a couple of rendering issues
Bug #7253839

1. Make sure we don't make GL calls while recording display lists

2. Disable an early and trivial clip optimization in font renderer
when a perspective transformation is used on the Canvas

Change-Id: I3f1052164239329346854f72d0a0d401fbfecf06
0baaac5e9adf3ee280ae1239e2e58754a9d2b099 01-Sep-2012 Romain Guy <romainguy@google.com> Revert "Revert "Add more support for transformed clip rects and paths""

This reverts commit a8557d2169e14997637f57bc897640c8882d4a46.

Change-Id: I36d4883d548fc47ba6c0b4a42012107d0d2f85a6
a8557d2169e14997637f57bc897640c8882d4a46 01-Sep-2012 Mathias Agopian <mathias@google.com> Revert "Add more support for transformed clip rects and paths"

this introduced a dead lock in GradientCache's ctor.

This reverts commit dfe082f63e94cde9aee271c94d13de5e7217e036.

Bug: 7096001
Change-Id: I57b8bbab11fb7cb502fa58e3bbf5d19864db874f
dfe082f63e94cde9aee271c94d13de5e7217e036 01-Sep-2012 Romain Guy <romainguy@google.com> Add more support for transformed clip rects and paths

Change-Id: I41791b1e1bffef77d503dc9e52428395d2309688
db8c9a6a4d9bf8c39f834b25611926caf21380f6 22-Mar-2012 Chet Haase <chet@google.com> Optimization of alpha with DisplayList properties

Some views (such as ImageView and TextView) handle non-opaque alpha
values directly. This was originally an optimization, but we can handle it faster
in many cases without this optimization when DisplayList properties are enabled.
Basically, if a view has non-overlapping rendering, we set the alpha value directly
on the renderer (the equivalent of setting it on the Paint object) and draw each
primitive with that alpha value. Doing it this way avoids re-creating DisplayLists
while getting the same speedup that onSetAlpha() used to get pre-DisplayList properties.

Change-Id: I0f7827f075d3b35093a882d4adbb300a1063c288
967e2bf3ac8943a8e8a374bf86021915445cda67 08-Feb-2012 Romain Guy <romainguy@google.com> Preliminary support for clipRect(Rect, Op)

This adds basic support for clip regions. It is currently disabled at compile
time. Enabling clip regions will require setting up a stencil buffer.

Change-Id: I638616a972276e38737f8ac0633692c3845eaa74
ada4d53d50dc869b8278573ad640dc44118d3bcf 03-Feb-2012 Romain Guy <romainguy@google.com> Separate interface definition and implementation of Snapshot

The Snapshot class is getting complicated enough that its implementation
should now live in a separate .cpp file. This will become particularly
useful when support for clip regions and paths will be added later on.

Change-Id: I050fac5683a9f7a0ff2f7a6beec3dd28aa5eb0d8
421458aad764cd9d1403d2540ab979b336b02341 22-Nov-2011 Romain Guy <romainguy@google.com> Draw in the correct FBO after invoking a GL functor
Bug #5650514

After invoking a GL functor, libhwui restores a few OpenGL states
including the current FBO. The renderer was however making the
wrong assumption that the FBO to restore to was the base layer
instead of the FBO associated with the current canvas state.

Change-Id: Ie565500832ebffd673f6a43b83422d6cc05470a0
ed7a8fc768df158241819f062a12dafdaf8a628d 05-Oct-2011 Romain Guy <romainguy@google.com> Canvas.getClipBounds() was broken and unreliable with OpenGL ES 2.0

This bug was affecting several third party applications. The bug was
introduced by an optimization that prevented the local clip to be
recomputed when needed.

Change-Id: I7b5c464db21b5ff1a7274af75a3a64d0e9d84772
f28daffda50042c1b7cbfeb34b4d47741c6e21a8 04-Feb-2011 Romain Guy <romainguy@google.com> Empty the clip rect when intersection is empty.
Bug #3410035

Change-Id: I5ceb80514d3b20c9ad230478549ad31ced403d53
f219da5e32e85deb442468ee9a63bb28eb198557 16-Jan-2011 Romain Guy <romainguy@google.com> Don't blend transparent pixels when rendering layers.

With this change, the rendere keeps track of what regions are rendered into
and generates a mesh that matches these regions exactly. The mesh is used
to composite the layer on screen.

Change-Id: I1f342576b9134fb29caff7fb8f4c1da179fe956d
af636ebf5feb2837683fbfe965040cb706b32ec1 10-Dec-2010 Romain Guy <romainguy@google.com> Don't set the invisible flag when saving an empty layer.
Bug #3270371

Change-Id: I65e85671c2fb70d74553c91213e5e759e0ac64ee
5b3b35296e8b2c8d3f07d32bb645d5414db41a1d 28-Oct-2010 Romain Guy <romainguy@google.com> Optimize FBO drawing with regions.
This optimization is currently disabled until Launcher is
modified to take advantage of it. The optimization can be
enabled by turning on RENDER_LAYERS_AS_REGIONS in the
OpenGLRenderer.h file.

Change-Id: I2fdf59d0f4dc690a3d7f712173ab8db3848b27b1
d2a1ff003b9b1212c9ab4b5f679b5b097720a359 14-Oct-2010 Romain Guy <romainguy@google.com> Fix text rendering issue.

The local clip rect could be off by one pixel when a 3D transform
was applied to a text primitive. This would cause small rendering
glitches in Launcher in particular.

Change-Id: I1254f6a5838c26810cbe969b096679d40b8dd504
dbc26d2ba13f80a7590c57de2d80530d96832969 12-Oct-2010 Romain Guy <romainguy@google.com> Don't draw fully transparent views/primitives.

Change-Id: Icd7d8ef1f57b51a24faf32f7004125e6300d4fdc
eb99356a0548684a501766e6a524529ab93304c8 06-Oct-2010 Romain Guy <romainguy@google.com> Optimize saveLayer() when the clip flag is set.

This speeds up applications, especially Launcher.
3b3e457c270a4bc5fe3047e815b5867d99b36f8a 04-Oct-2010 Romain Guy <romainguy@google.com> Snap the clip rectangle to pixel boundaries.

Change-Id: Iac2765303552f385995fe46e219af456e0501da7
87a76578f76f4a6bceb187da6b7a01899ca0d85a 14-Sep-2010 Romain Guy <romainguy@google.com> Docs updates.

Change-Id: Iff395e1c6d81a484a2c4ad6e88357c0134971b78
f607bdc167f66b3e7003acaa4736ae46d78c1492 11-Sep-2010 Romain Guy <romainguy@google.com> Correct implementation of saveLayer().

Change-Id: I5375126636913e0a84f2d6bbd0ebe40d2e4f2763
8aef54fa17f2a3753d9a8f2027629bc480088f69 02-Sep-2010 Romain Guy <romainguy@android.com> Add support for Canvas flags on save.

This is required for the rewrite of layers support.

Change-Id: I5c0867dcf5aeb0392c8d0fbab05febb0eaff70d9
8b55f377655d13a445b08a0a8ed09b6e95c752b0 19-Aug-2010 Romain Guy <romainguy@google.com> Fix drawing issues with layers.

Prior to this change layers would clip their content incorrectly. They would
also not apply alpha properly.

Change-Id: Id7b3aaa7dbdc51de68fe050e64458f68e40503fd
2542d199745cdf3ec910b8e3e4cff5851ed24e9b 18-Aug-2010 Romain Guy <romainguy@google.com> Layers were using an extra Snapshot causing extra clipping.

Bug #2919310

Change-Id: I72ccd44bba7a3f3db72f581aa96198b6226e4478
8fb954263dd2f918ad339045cc6d82e346515599 18-Aug-2010 Romain Guy <romainguy@google.com> Fix save()/restore() issues in the OpenGL renderer.

The save stack now behaves exactly like in Skia.

Change-Id: If7e642f41f2c8f693f6e8c26cba81507d466562e
1d83e1981c8b89da93dff37a4f8b2b1ad8480b44 17-Aug-2010 Romain Guy <romainguy@google.com> Correctly set the viewport in layers.

Bug #2919295

Change-Id: I16ce79ab0d5747cb01c6c1abe531da3dfd93fb54
af28b514964861d81b48902f942f706050936d38 12-Aug-2010 Romain Guy <romainguy@google.com> Better support for rotation and perspective matrices.

Change-Id: I56b5ae3321735ba5ee42aafc9bc0eb399b9e75b5
959c91f7f7b4f921d341264f5b4ef54e702a0df0 12-Aug-2010 Romain Guy <romainguy@google.com> Bunch of fixes.

Fixes memory leak, fixes multiple context support, fix 3d transforms.

Change-Id: I7462cfbc57857dbd4de4e76b9d4cba58a1bce77b
b82da65cb1601be504241f36778395cd6cb9f87b 30-Jul-2010 Romain Guy <romainguy@google.com> Fix improper clipping after a save()

Change-Id: I13426a67f20d77e2710bd500d82884098f4be97c
ae5575b3421c8fbe590ab046d7d5f2b36ecfd821 30-Jul-2010 Romain Guy <romainguy@google.com> Fix gradients rendering and destructor crashes.

This changes binds all textures to GL_TEXTURE0, this will have
to be changed when combining shader capabilities.

Change-Id: I02df4f5ba41e9b01ffa52fd7c26b41477c7ed18f
09147fbdc8206a0cac78bfe9083e7e15b3c5689c 22-Jul-2010 Romain Guy <romainguy@google.com> Add support for text culling.

Change-Id: Ibf0adacdc5c64d40a8000b21d7cb0797d63efe29
7fac2e18339f765320d759e8d4c090f92431959e 17-Jul-2010 Romain Guy <romainguy@android.com> Add plumbing to support gradients in OpenGL renderer.

The LinearGradient class keeps a copy of the various parameters that
define the gradient. The copies are native arrays to avoid copying
Java arrays on every draw call. The gradient code path is implemented
until OpenGLRenderer::drawRect() (see TODO.) The actual gradient
implementation will be added in a latter change.

Change-Id: I9300d250ef5e2e9c2e097c3116ee71dfc9d752d8
079ba2c85b15e882629b8d188f5fbdb42f7f8eea 16-Jul-2010 Romain Guy <romainguy@android.com> Improve clip support (add intersect, union and replace.)

This change also modifies the way the clip is stored. The clip is now
always stored in screen-space coordinates.

Change-Id: I96375784d82dfe975bc6477a159e6866e7052487
d27977d1a91d5a6b3cc9fa7664ac7e835e7bd895 15-Jul-2010 Romain Guy <romainguy@google.com> Add support for BitmapShader.

This change also fixes an issue with the clip and layers.

Change-Id: I5fd9832098d8cf7ae8eb781ff9bffe7defaea279
3d58c03de0d8877b36cdb78b0ca8b5cac7f600e2 15-Jul-2010 Romain Guy <romainguy@google.com> Do not apply transforms when using drawColor().

This fixes an issue in the way the clip transformations were applied.

Change-Id: I91e7b5d15baf244d1280e48938282bb33609081d
260e102162322958cf17dbd895cd6bd30dc87e32 12-Jul-2010 Romain Guy <romainguy@google.com> Optimize shader binding changes.

This change also cleans up the internal API a little bit by using mat4
everywhere instead of float[16] (for the ortho matrix for instance.)

Change-Id: I35924c7dc17bad17f30307118d5ed437c2ed37e0
dda570201ac851dd85af3861f7e575721d3345da 06-Jul-2010 Romain Guy <romainguy@android.com> Add a layer (FBO) cache.

The cache is used to draw layers so that a new
texture does not have to be recreated every time
a call to saveLayer() happens.

The FBO cache used a KeyedVector, which is a bad
idea. The cache should be able to store several
FBOs of the same size (this happens a lot during
scrolling with fading edges for instance.) This
will be changed in a future CL.

Change-Id: Ic316189e625f0dbcf0d273a71cc981a433d48726
f86ef57f8bcd8ba43ce222ec6a8b4f67d3600640 01-Jul-2010 Romain Guy <romainguy@google.com> Don't use full screen FBOs, this dramatically increase performance.

The next step will be to add an FBO cache to avoid churning memory on every
frame we draw. This change also adds support for drawBitmap(Bitmap, Matrix, Paint).

Change-Id: I7825cdcf0cad9bffe6219e05d8328a53d4a6e583
d55a86120dd1e8ebcc6906c9ffd463f7460348da 29-Jun-2010 Romain Guy <romainguy@google.com> Add support for saveLayer().

saveLayer() is affected by the paint's alpha and xfermode.

Change-Id: I28693a9337052643adccdb4889a8f228d4e17903
5cbbce535744b89df5ecea95de21ee3733298260 28-Jun-2010 Romain Guy <romainguy@android.com> Reduced the complexity of layers composition.

This change also refactors the code base a bit by moving classes out of
OpenGLRenderer into separate headers/implementations. This makes the code
more manageable.

This change also adds documentation for implementation methods. The
undocumented methods are simply Skia's Canvas methods.

Change-Id: I54c68b443580a0129251dddc1a7ac95813d5289e