summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Snapshot.h
Commit message (Collapse)AuthorAgeFilesLines
* Use path intersection instead of saveLayer+mesh to mask projected ripplesChris Craik2015-05-261-0/+27
| | | | | | | | | | | | | | | | | | | | | bug:14297149 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
* Clipping performance improvementsRob Tsuk2015-01-141-29/+23
| | | | | | | | | | | | 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
* Prioritize reveal clipping over Outline clippingChris Craik2014-09-041-1/+5
| | | | | | | | | | bug:15780987 bug:17350602 Also update docs around clipping nesting behavior, and some Z ordering behavior. Change-Id: Iaa204350a0adfdcbd8c4b821fb4a9c0ae22f2613
* Define shadow casting behavior within layersChris Craik2014-08-151-0/+4
| | | | | | | | | | | | bug:15860114 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
* Use RoundRect clipping for circle reveal animationChris Craik2014-07-301-3/+3
| | | | | | | | bug:16630975 Also, remove inverse clipping feature from reveal animator. Change-Id: I770a4eb48cd123b0ca0f39d16a0f3eefd1be3653
* Merge "Correct viewport initialization, bounds comparison"Chris Craik2014-05-191-1/+1
|\
| * Correct viewport initialization, bounds comparisonChris Craik2014-05-151-1/+1
| | | | | | | | Change-Id: Ibd751856e3712991e149800ed179464397dad7c3
* | Use default visibility for Snapshot::getLocalClip (attempt #2).Ben Cheng2014-05-171-1/+1
| | | | | | | | | | | | | | The change appeared to be dropped. See commit 65ba94f79d6e737c3e66c09032221999b2eb50d7 for details. Change-Id: Ib60968d6327ef04d21e4adca2c394f66343f204b
* | Round rect outline clippingChris Craik2014-05-151-0/+42
|/ | | | Change-Id: Iee9cf4f719f6f1917507b69189ad114fa365917b
* Combine projection matrix, and viewport managementChris Craik2014-05-141-20/+34
| | | | | | | Merge management of ortho projection matrix with the viewport size, since they should always be changed together. Change-Id: Iccb8f30828f4fb7848999ac54852e7ed2d6f2eb1
* Revert "Simplify projection matrix management."Jorim Jaggi2014-05-111-5/+6
| | | | This reverts commit 0efaa71d5414287ed4beac0a88cf76f7e33a1e74.
* Simplify projection matrix management.Chris Craik2014-05-091-6/+5
| | | | | | | Store in and use from snapshot, and remove the kFlagOrthoDirty flag, as it's redundant with kFlagIsFboLayer. Change-Id: I2bd380192d50117f4ce1fd2058213669a886f406
* Clip TouchFeedbackDrawable effect to receiver OutlineChris Craik2014-04-231-2/+7
| | | | | | | | 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
* Use default visibility for Snapshot::getLocalClip.Ben Cheng2014-04-021-1/+1
| | | | | | | | | | | 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
* Isolate tiling clip state from snapshotChris Craik2013-03-211-0/+2
| | | | | | | | | | bug:8409891 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
* Implement clipRect with a transform, clipRegion & clipPathRomain Guy2013-01-171-5/+7
| | | | | | | | | | | | | | | | | | | | | 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
* Fix a couple of rendering issuesRomain Guy2012-09-281-0/+5
| | | | | | | | | | | 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
* Revert "Revert "Add more support for transformed clip rects and paths""Romain Guy2012-08-311-6/+3
| | | | | | This reverts commit a8557d2169e14997637f57bc897640c8882d4a46. Change-Id: I36d4883d548fc47ba6c0b4a42012107d0d2f85a6
* Revert "Add more support for transformed clip rects and paths"Mathias Agopian2012-08-311-3/+6
| | | | | | | | | this introduced a dead lock in GradientCache's ctor. This reverts commit dfe082f63e94cde9aee271c94d13de5e7217e036. Bug: 7096001 Change-Id: I57b8bbab11fb7cb502fa58e3bbf5d19864db874f
* Add more support for transformed clip rects and pathsRomain Guy2012-08-311-6/+3
| | | | Change-Id: I41791b1e1bffef77d503dc9e52428395d2309688
* Optimization of alpha with DisplayList propertiesChet Haase2012-04-031-0/+11
| | | | | | | | | | | | 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
* Preliminary support for clipRect(Rect, Op)Romain Guy2012-02-071-1/+24
| | | | | | | 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
* Separate interface definition and implementation of SnapshotRomain Guy2012-02-021-102/+36
| | | | | | | | 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
* Draw in the correct FBO after invoking a GL functorRomain Guy2011-11-211-1/+2
| | | | | | | | | | | 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
* Canvas.getClipBounds() was broken and unreliable with OpenGL ES 2.0Romain Guy2011-10-041-23/+9
| | | | | | | | 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
* Empty the clip rect when intersection is empty.Romain Guy2011-02-041-0/+4
| | | | | | Bug #3410035 Change-Id: I5ceb80514d3b20c9ad230478549ad31ced403d53
* Don't blend transparent pixels when rendering layers.Romain Guy2011-01-161-1/+1
| | | | | | | | 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
* Don't set the invisible flag when saving an empty layer.Romain Guy2010-12-091-3/+14
| | | | | | Bug #3270371 Change-Id: I65e85671c2fb70d74553c91213e5e759e0ac64ee
* Optimize FBO drawing with regions.Romain Guy2010-11-021-4/+22
| | | | | | | | | 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
* Fix text rendering issue.Romain Guy2010-10-141-1/+0
| | | | | | | | 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
* Don't draw fully transparent views/primitives.Romain Guy2010-10-111-3/+9
| | | | Change-Id: Icd7d8ef1f57b51a24faf32f7004125e6300d4fdc
* Optimize saveLayer() when the clip flag is set.Romain Guy2010-10-051-3/+45
| | | This speeds up applications, especially Launcher.
* Snap the clip rectangle to pixel boundaries.Romain Guy2010-10-041-0/+1
| | | | Change-Id: Iac2765303552f385995fe46e219af456e0501da7
* Docs updates.Romain Guy2010-09-131-0/+5
| | | | Change-Id: Iff395e1c6d81a484a2c4ad6e88357c0134971b78
* Correct implementation of saveLayer().Romain Guy2010-09-121-51/+18
| | | | Change-Id: I5375126636913e0a84f2d6bbd0ebe40d2e4f2763
* Add support for Canvas flags on save.Romain Guy2010-09-011-31/+60
| | | | | | This is required for the rewrite of layers support. Change-Id: I5c0867dcf5aeb0392c8d0fbab05febb0eaff70d9
* Fix drawing issues with layers.Romain Guy2010-08-181-1/+7
| | | | | | | Prior to this change layers would clip their content incorrectly. They would also not apply alpha properly. Change-Id: Id7b3aaa7dbdc51de68fe050e64458f68e40503fd
* Layers were using an extra Snapshot causing extra clipping.Romain Guy2010-08-181-8/+1
| | | | | | Bug #2919310 Change-Id: I72ccd44bba7a3f3db72f581aa96198b6226e4478
* Fix save()/restore() issues in the OpenGL renderer.Romain Guy2010-08-171-1/+8
| | | | | | The save stack now behaves exactly like in Skia. Change-Id: If7e642f41f2c8f693f6e8c26cba81507d466562e
* Correctly set the viewport in layers.Romain Guy2010-08-171-1/+7
| | | | | | Bug #2919295 Change-Id: I16ce79ab0d5747cb01c6c1abe531da3dfd93fb54
* Better support for rotation and perspective matrices.Romain Guy2010-08-121-15/+4
| | | | Change-Id: I56b5ae3321735ba5ee42aafc9bc0eb399b9e75b5
* Bunch of fixes.Romain Guy2010-08-111-4/+17
| | | | | | Fixes memory leak, fixes multiple context support, fix 3d transforms. Change-Id: I7462cfbc57857dbd4de4e76b9d4cba58a1bce77b
* Fix improper clipping after a save()Romain Guy2010-07-301-2/+7
| | | | Change-Id: I13426a67f20d77e2710bd500d82884098f4be97c
* Fix gradients rendering and destructor crashes.Romain Guy2010-07-291-1/+1
| | | | | | | This changes binds all textures to GL_TEXTURE0, this will have to be changed when combining shader capabilities. Change-Id: I02df4f5ba41e9b01ffa52fd7c26b41477c7ed18f
* Add support for text culling.Romain Guy2010-07-221-9/+17
| | | | Change-Id: Ibf0adacdc5c64d40a8000b21d7cb0797d63efe29
* Add plumbing to support gradients in OpenGL renderer.Romain Guy2010-07-161-16/+16
| | | | | | | | | | 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
* Improve clip support (add intersect, union and replace.)Romain Guy2010-07-161-32/+47
| | | | | | | This change also modifies the way the clip is stored. The clip is now always stored in screen-space coordinates. Change-Id: I96375784d82dfe975bc6477a159e6866e7052487
* Add support for BitmapShader.Romain Guy2010-07-151-0/+12
| | | | | | This change also fixes an issue with the clip and layers. Change-Id: I5fd9832098d8cf7ae8eb781ff9bffe7defaea279
* Do not apply transforms when using drawColor().Romain Guy2010-07-141-1/+11
| | | | | | This fixes an issue in the way the clip transformations were applied. Change-Id: I91e7b5d15baf244d1280e48938282bb33609081d
* Optimize shader binding changes.Romain Guy2010-07-121-1/+1
| | | | | | | 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