summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Layer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactor blending and texture gl stateChris Craik2015-01-301-3/+3
| | | | Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
* resolved conflicts for merge of fe5ac4fc to masterJohn Reck2015-01-291-3/+11
|\ | | | | | | Change-Id: I6c0cc82db14b56297586469f940e408c0e218b3b
| * Allow ~Layer() to happen after onGLContextDestroyedJohn Reck2015-01-291-3/+11
| | | | | | | | | | Bug: 19146354 Change-Id: I9e885936168bd541bfbed4064ad67ab524f58e32
* | Move scissor state to RenderStateChris Craik2015-01-271-3/+4
| | | | | | | | Change-Id: I1227a3886fb24e4d9fad79fca469794f06cfb15e
* | Add overrides and switch to nullptr keyword for all filesChris Craik2015-01-051-13/+13
| | | | | | | | | | | | | | Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
* | Cleanup various clang warnings, use unique_ptrs in several placesChris Craik2014-12-231-11/+3
|/ | | | Change-Id: I347904b25e51fcc7de14b1e72f1acd0f6ba26f3f
* Improve logging around performance critical eventsChris Craik2014-11-191-1/+17
| | | | | | | | | | bug:17702227 Add details useful to developers (such as layer size/View name), and switch away from logging implementation names/details, since they are generally not relevant to developers. Change-Id: Iee605d182f241450f7e75a6d0c283d51fa1312f5
* Layer changesJohn Reck2014-10-311-9/+10
| | | | | | | | | | | | Bug: 17208461 * Switch Layer to be VirtualLightRefBase instead of Caches' side-channel ref-counting * Include active layers in gfxinfo dump * Run gfxinfo dump on the correct thread * Dump gfxinfo on Layer creation failure Change-Id: I28d195699e2334518e215ab28c7a17355aee9678
* Additional layer loggingChris Craik2014-09-101-1/+2
| | | | | | | | bug:17208461 Track layer's last known state. Change-Id: Ic1799191f5839a1d6cc56f598f2ac2671dc27a6f
* Don't track TextureLayer lifecycles in RenderStateChris Craik2014-09-081-5/+11
| | | | | | | | | | bug:17208461 They are destroyed via finalizer-enqueued destroy method, so it's not valid to check that they've been destroyed at gl context destruction time. Change-Id: I670f69825547facd5f31d44acb406418881fee00
* Yet more layer tracking loggingJohn Reck2014-09-041-0/+1
| | | | | | Bug: 17208461 Change-Id: I55e7d0921eb565867e966d68b798b7b92c391b55
* Crash instead of leaking layers/textures between GL contextsChris Craik2014-08-261-0/+2
| | | | | bug:17208461 Change-Id: I4d58f301cf0f5e8145e808a5d6ade4de7801970b
* Define shadow casting behavior within layersChris Craik2014-08-151-2/+16
| | | | | | | | | | | | 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
* Add layer/texture creation tracingJohn Reck2014-07-291-0/+2
| | | | Change-Id: I0af6a36c97a9f5f35d28e0e36539ba8d8011ea7c
* No-fail invokeFunctorJohn Reck2014-06-231-8/+10
| | | | | | | Bug: 15513308 Bug: 15449247 Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
* Update 'DisplayList' vs 'RenderNode' naming in several placesChris Craik2014-06-231-10/+9
| | | | Change-Id: I635c6627d098b661fb9b0ba1bd42fa6d7277d287
* Merge "Wrap ViewGroup content in save/restore to protect composited children"Chris Craik2014-06-201-1/+1
|\
| * Wrap ViewGroup content in save/restore to protect composited childrenChris Craik2014-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug:15570351 Pos Z composited children are drawn before the primary restore for a RenderNode. This means that without an additional save/restore (which wraps the content) they aren't protected from transformations/clips that happen within the ViewGroup's DisplayList. Also changes RenderNode to use OpenGLRenderer tag for displaylist dumping consistency, and simplifies the entry points into RenderNode drawing, since the distinction between tree root vs tree internal is no longer important. Change-Id: I2621eba0592c74d71f85a91a4ab3d0da2d7468d3
* | am 88b1c9ad: am e709d53f: am 0d28bb47: Merge "Fix the texture ID reuse issue ↵Chris Craik2014-06-171-0/+1
|\ \ | |/ |/| | | | | | | | | in HWUI." * commit '88b1c9ad87ca6d6faaf824bff4ee9d3c799362e5': Fix the texture ID reuse issue in HWUI.
| * Fix the texture ID reuse issue in HWUI.jiayuanr2014-06-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | Issue: When the layer of previous frame is destroyed, it doesn't clear the texture id in mBoundTextures[mTextureUnit], so in the next frame, if glGenTexture returns same texture ID of the previous frame, the new texture is not bound. CRs-fixed: 671736 Change-Id: Ifc5fd2115fb1863b3c006ab14b0faabeaeb4eab4
* | Define light position (using new lighting spec) in JavaChris Craik2014-05-211-1/+1
| | | | | | | | | | | | Also updates the relative shadow strengths. Change-Id: I6cac7275d38df98aea9f0dda463cd7207102986a
* | Combine projection matrix, and viewport managementChris Craik2014-05-141-1/+1
| | | | | | | | | | | | | | Merge management of ortho projection matrix with the viewport size, since they should always be changed together. Change-Id: Iccb8f30828f4fb7848999ac54852e7ed2d6f2eb1
* | Clip TouchFeedbackDrawable effect to receiver OutlineChris Craik2014-04-231-0/+1
| | | | | | | | | | | | | | | | 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
* | Refcount RenderNodeJohn Reck2014-04-071-1/+10
| | | | | | | | Change-Id: I7a86db8acc2b78ef33d987a43a119f5933d7d752
* | Support shadows on the root RenderNodeChris Craik2014-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | bug:13211941 Cleans up some of the RenderNode method naming Also removes unnecessary clip/save/restores, clipping shadows predictably, as drawn by the parent, before drawing (and clipping, etc.) the shadow casting child. Change-Id: I795115e1fb869bbbdd7be43e279b97490fecc7e0
* | Async drawing!John Reck2014-03-271-3/+8
| | | | | | | | Change-Id: I7e728356f58af88174328a8c0b90d27b128bfe01
* | Move where updateProperties is calledJohn Reck2014-03-241-1/+0
| | | | | | | | Change-Id: I27da448996019094c44487ce28c5689d098d6535
* | Add stagingPropertiesJohn Reck2014-03-241-0/+1
| | | | | | | | Change-Id: Ic7de551f8843fd70a77f738e33028e25c020bb3c
* | Move RenderNode to own fileJohn Reck2014-03-191-2/+2
| | | | | | | | Change-Id: I9380d161fd3ddd7b569c262dd8e7aa0c96151b1e
* | Rename DisplayList->RenderNodeJohn Reck2014-03-121-2/+2
| | | | | | | | Change-Id: Id42e23c9a1a6eb6eaeafef707ced7fa6887b03d0
* | Fix TextureView texture filtering.Chris Craik2014-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | bug:11748993 TextureView should always be drawn with linear filtering if drawing a buffer sized differently from the layer. This fixes a bug where TextureViews that were sized differently from their contents wouldn't be drawn with texture filtering, causing visible scaling artifacts. Change-Id: I8a5d27452fe7269ec53896992f37cff51e3ce15a
* | Reapply "Refactor setting an SkPaint onto a hwui Layer."Derek Sollenberger2014-02-201-1/+2
| | | | | | | | | | | | This reverts commit 90d0c75e94a32fb7d993fae69762820aabc2fcbb. Change-Id: Ie807761231edf7c848b019931dccbf466208c0be
* | Revert "Refactor setting an SkPaint onto a hwui Layer."Derek Sollenberger2014-02-121-2/+1
| | | | | | | | | | | | This reverts commit e889298cd6ae1fc0d76bc00d7d12586db03eb261. Change-Id: I4b1d609b2d4280595d40cb10d6c18875c22999f8
* | Refactor setting an SkPaint onto a hwui Layer.Derek Sollenberger2014-02-121-1/+2
| | | | | | | | | | | | | | This CL removes the unecessary JNI call to set the colorFilter on a layer. Change-Id: I9e088f888938d4315745aa618334bfdb9e61343a
* | Removing SkiaColorFilter and inspecting the native object directly.Derek Sollenberger2014-02-071-9/+3
| | | | | | | | | | bug: 10650594 Change-Id: I4fcf66d008765afa0e35d011f58bc792183cb74f
* | Remove logging of DisplayList stalenessChris Craik2014-01-271-1/+0
| | | | | | | | Change-Id: Ie6b3af3065d4d10ec0bc9b419223d3458d297ea8
* | Clear root level reorder lists to prevent accessing stale DisplayListsChris Craik2014-01-241-0/+1
| | | | | | | | | | | | | | | | | | bug:12581401 Adds temporary logging which should log/crash earlier on incorrectly reordering hierarchies. Change-Id: Iee00940718c3cc868161e754aff93cd3b2747094
* | 3d view system!Chris Craik2013-12-121-5/+4
|/ | | | | | | | | | | | | | | | | | | True 3d transformations are now supported by DisplayLists and the renderer, initially with the translationZ property on view. Renderer operations used directly by DisplayList (formerly, clip/save/restore/saveLayer) are now more simply managed by allocating them temporarily on the handler's allocator, which exists for a single frame. This is much simpler than continuing to expand the pool of pre-allocated DisplayListOps now that more operations are called directly by DisplayList, especially with z ordered drawing. Still TODO: -APIs for camera positioning, shadows -Make Z apis public, and expose through XML -Make invalidation / input 3d aware Change-Id: I95fe6fa03f9b6ddd34a7e0c6ec8dd9fe47c6c6eb
* Use global indices array to draw layersRomain Guy2013-07-221-2/+0
| | | | | | | | | | | | An array of indices local to a layer would only be necessary if we changed the way we resolve T-junctions. Since we only ever draw quads, let's just use the indices we use everywhere else. This change also uses the global indices array to render list of colored rectangles to save on the number of vertices generated CPU-side. Change-Id: Ia6d1970b0e9247805af5a114ca2a84b5d0b7c282
* Merge "Cancel layer update when a layer is about to be destroyed Bug #9310706"Romain Guy2013-06-171-0/+10
|\
| * Cancel layer update when a layer is about to be destroyedRomain Guy2013-06-171-0/+10
| | | | | | | | | | | | Bug #9310706 Change-Id: I73eea6314c326f15a979617e3a05b525935f0d3f
* | Check for layer renderer in flushChris Craik2013-06-171-1/+2
|/ | | | | | | | | bug:9310706 In some cases flush will occur after a layer is destroyed. Avoid trying to draw after putting the layer in the layer cache. Change-Id: I55d66f420e7354fe552c82eb3145a7d91b4441e3
* Overdraw avoidance and merging of clipped opsChris Craik2013-06-121-6/+8
| | | | | | | | | | | | | | | | | bug:8951267 If an opaque op, or group of opaque ops covers the invalidate region, skip draw operations that precede it. Clipped operations may now be merged, but only if they share a clipRect - this is a very case for e.g. ListView, where all background elements may now be a part of the same MergingDrawBatch. It is this more aggressive merging that groups together clipped background elements in the ListView case, enabling the overdraw avoidance skipping the window background. Change-Id: Ib0961977e272c5ac37f59e4c67d828467422d259
* Assume a texture is unbound after deleting itRomain Guy2013-06-061-1/+1
| | | | | | | | | | | Bug #9316260 The GL specification indicates that deleting a bound texture has the side effect of binding the default texture (name=0). This change replaces all calls to glDeleteTextures() by Caches::deleteTexture() to properly keep track of texture bindings. Change-Id: Ifbc60ef433e0f9776a668dd5bd5f0adbc65a77a0
* Introduce Caches::bindTexture() to reduce glBindTexture callsRomain Guy2013-06-041-9/+50
| | | | Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
* Make layer double drawing visible in overdraw debug modeChris Craik2013-04-161-0/+1
| | | | | | | | | | | | | | | | | | A clipped saveLayer will cause two draws - first to an onscreen buffer, then again back to the framebuffer. This change - when in overdraw debug - reissues draws associated with a clipped saveLayer, but only to the stencil buffer. Operations within a saveLayer are shown correctly to be twice drawn, and View.setAlpha() without an associated hardware layer, or hasOverlappingRendering() are made more visible. Hardware layers, on any frame that they are updated, similarly draw twice, and will also be counted against the stencil buffer doubly. Note: greater depths of layers - e.g. a saveLayer within a saveLayer - are not respected, as that would require additional region tracking. Change-Id: I61fb0e61038fe66013d59914c20bb47a550dea7d
* Merge "First OpenGL ES 3.0 based optimization" into jb-mr2-devRomain Guy2013-04-041-1/+1
|\
| * First OpenGL ES 3.0 based optimizationRomain Guy2013-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change uses a new OpenGL ES 3.0 feature to upload less data when the font cache needs to be update. This can result in significant performance improvements on device with large textures or with locales that use a lot of glyphs (CJK for instance.) This change also fixes various unpack alignment issues. The unpack alignment, as well as the unpack row length, is not texture specific but a global state that affect all glTex/SubImage2D calls. Some of them were missing the appropriate glPixelStorei() call. This could result in corrupted textures. Change-Id: Iefb429d4d0d0b4e0faeadf27daafee6d30a21d85
* | Traverse layers in update orderChris Craik2013-04-041-2/+1
|/ | | | | | | | | | | | | | bug:8540150 Layers now require traversal in update order, as it will be child first, then parent for layer-in-layer Fixes issue with deferred layer playback not flushing in order, and thus child not painting before parent Also fixes DisplayList to only be cleared after flush in deferred list Change-Id: I2f284d00079cdb20798aeef6a1c94e823940db40
* Prevent crash when a single layer is enqueued several times for updatesRomain Guy2013-03-291-0/+19
| | | | | | Bug #8504687 Change-Id: I9b01bbc4e3f37af23dfe5e68d3d03ad3d238b94a