History log of /frameworks/base/libs/hwui/Layer.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
db009173f800bb0d626c42786b5bd0f57cc6545a 17-Mar-2016 John Reck <jreck@google.com> Fix NPE in clearTexture()

Change-Id: I38d261968506ab8b312584c7e688e2b148fadd1f
Fixes: 25928378
/frameworks/base/libs/hwui/Layer.cpp
2de7771740ee08fcaff638ec6b2e460bb72fff04 20-Jan-2016 John Reck <jreck@google.com> Normalize GL_UNPACK_ALIGNMENT

Several places were setting GL_UNPACK_ALIGNMENT
unneccessarily, whereas other places were assuming an
unpack alignment of 1. Since we never actually
do explicit row-alignment, set GL_UNPACK_ALIGNMENT
to 1 at context creation time and never change it

Bug: 26584230

Also turns on aggressive glGetError checking to
better catch potential problem zones

Change-Id: I190c8f0f0494a7f046d5ed769405c75d363be59a
/frameworks/base/libs/hwui/Layer.cpp
a55b5d6c65cde2b7cc28bb3ea160bfaaef7a446a 15-Jan-2016 John Reck <jreck@google.com> Fix "leak" in FrameBuilder.textureLayer test

DeferredLayerUpdater always did a post to delete itself, which
would result in the test thinking it had leaked an object since
it wasn't deleted when it returned. Fix this by deleting immediately
if we're already on the right thread.

Remove RenderState's requireGlContext assert as it's now
covered by GpuMemoryTracker, which is also more test friendly.
RenderState's assert required an actual EGL context, which we
don't mock away in unit tests.

Change-Id: Ic23eb54e7151355f7acca483d7464350c9d6a87f
/frameworks/base/libs/hwui/Layer.cpp
38e0c32852e3b9d8ca4a9d3791577f52536419cb 10-Nov-2015 John Reck <jreck@google.com> Track texture memory globally

Also mostly consolidates texture creation

Change-Id: Ifea01303afda531dcec99b8fe2a0f64cf2f24420
/frameworks/base/libs/hwui/Layer.cpp
89add11bb4c4a3cae38d84d1151e60617efb26a5 11-Dec-2015 John Reck <jreck@google.com> resolve merge conflicts of f1df0f59c1 to master.

Change-Id: Ia0ae0f753541f5203a4a3683721361c5e90ddae8
441cc421b51377ec27bf97ed690c63aa5509ae90 11-Dec-2015 Sangkyu Lee <geteuid@gmail.com> Fix memory leak in HWUI

std::unique_ptr::release just releases the ownership of the
managed object. To delete the object, std::unique_ptr::reset
function should be called.

Change-Id: If65f74085b1fc2be3a9fffc433326e0bcdb40ff3
/frameworks/base/libs/hwui/Layer.cpp
818c9fbf1d76d5df19253ba4eb964efa939ec9ec 23-Oct-2015 Chris Craik <ccraik@google.com> Initial version of clipped saveLayer in new pipeline

Additionally disables usage of FBO cache, so FBO destruction safely
interacts with renderstate caching.

Change-Id: I25c277cb7afec2ca33bf226445d6c8867a15a915
/frameworks/base/libs/hwui/Layer.cpp
bf6f0f260886a04a1680c7f9917124a751322ca4 01-Oct-2015 Chris Craik <ccraik@google.com> Move more utils into paintutils

Change-Id: I1eb3fd52386bc61a592da235533e40b509eeec24
/frameworks/base/libs/hwui/Layer.cpp
64e445bf74bee2098781d608cedfd723d8cc88d3 02-Sep-2015 Chris Craik <ccraik@google.com> CanvasState frame init refactor

bug:23760482

Change-Id: Idc0802b4b8a6a3cebd20797350f4eb01bcc3fe77
/frameworks/base/libs/hwui/Layer.cpp
b9ce116dac378b4cf4490f265dcbd5704a1dd43c 21-Aug-2015 Chris Craik <ccraik@google.com> Switch several enums to enum classes

Change-Id: I00ecd0b61657196b51704f70ca31a9d1c1ac254e
/frameworks/base/libs/hwui/Layer.cpp
5a4690bf26932c0d6940e4af8516d920e09ae81a 14-Jul-2015 Chris Craik <ccraik@google.com> Clean up unncessary defines

LOG_TAG and TRACE_TAG are already defined in the makefile

Change-Id: I9e53e3dacbe018441edd74cb7c8c90846defee74
/frameworks/base/libs/hwui/Layer.cpp
50210d912925aef14e4ce69be82e4949122a3cd9 15-May-2015 Alan Viverette <alanv@google.com> Adjust light source for window position

Bug: 16523629
Change-Id: I2f3fed1edcac0a3cfd5034aded45e08ececfebaf
/frameworks/base/libs/hwui/Layer.cpp
e5c6584a402fb3b1fe0507e4e00e601bec8f1bbc 03-Mar-2015 Chris Craik <ccraik@google.com> Constructor cleanup

Change-Id: Ic39911d08f44c3174de91fb92fcd4cab73fe4654
/frameworks/base/libs/hwui/Layer.cpp
44eb2c00861098dd3e2950d923646814b4cc57c2 29-Jan-2015 Chris Craik <ccraik@google.com> Refactor blending and texture gl state

Change-Id: Ia6b3c8b2afd3dfcee7f3ce401d846b789612054a
/frameworks/base/libs/hwui/Layer.cpp
49bc4acfadf9c5b1e520217278ccb38010d38c89 29-Jan-2015 John Reck <jreck@google.com> resolved conflicts for merge of fe5ac4fc to master

Change-Id: I6c0cc82db14b56297586469f940e408c0e218b3b
57998017ff137f7d4ec33df21b6596141f8c4547 29-Jan-2015 John Reck <jreck@google.com> Allow ~Layer() to happen after onGLContextDestroyed

Bug: 19146354
Change-Id: I9e885936168bd541bfbed4064ad67ab524f58e32
/frameworks/base/libs/hwui/Layer.cpp
65fe5eeb19e2e15c8b1ee91e8a2dcf0c25e48ca6 27-Jan-2015 Chris Craik <ccraik@google.com> Move scissor state to RenderState

Change-Id: I1227a3886fb24e4d9fad79fca469794f06cfb15e
/frameworks/base/libs/hwui/Layer.cpp
d41c4d8c732095ae99c955b6b82f7306633004b1 06-Jan-2015 Chris Craik <ccraik@google.com> Add overrides and switch to nullptr keyword for all files

Adds remaining missing overrides and nullptr usages, missed due to
an extreme failure in tool usage.

Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
/frameworks/base/libs/hwui/Layer.cpp
51d6a3db97bdd5315f1a17a4b447d10a92217b98 23-Dec-2014 Chris Craik <ccraik@google.com> Cleanup various clang warnings, use unique_ptrs in several places

Change-Id: I347904b25e51fcc7de14b1e72f1acd0f6ba26f3f
/frameworks/base/libs/hwui/Layer.cpp
70850ea258cbf91477efa57a1f1a23cc0044cc93 18-Nov-2014 Chris Craik <ccraik@google.com> Improve logging around performance critical events

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
/frameworks/base/libs/hwui/Layer.cpp
0e89e2b7bcb2c035e8cee77f93120e7c5617f8d2 31-Oct-2014 John Reck <jreck@google.com> Layer changes

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
/frameworks/base/libs/hwui/Layer.cpp
bfd1cd620991ac2fa9202fdce6c00ec47d071935 10-Sep-2014 Chris Craik <ccraik@google.com> Additional layer logging

bug:17208461

Track layer's last known state.

Change-Id: Ic1799191f5839a1d6cc56f598f2ac2671dc27a6f
/frameworks/base/libs/hwui/Layer.cpp
8a226d24b8b2fde4c855d0051cb7bfc5b5813c36 09-Sep-2014 Chris Craik <ccraik@google.com> Don't track TextureLayer lifecycles in RenderState

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
/frameworks/base/libs/hwui/Layer.cpp
443a714fa7c0dd07fee3527cc5bc3d3ca1fb7d44 05-Sep-2014 John Reck <jreck@google.com> Yet more layer tracking logging

Bug: 17208461

Change-Id: I55e7d0921eb565867e966d68b798b7b92c391b55
/frameworks/base/libs/hwui/Layer.cpp
1d4774233304c484673e2af2c1de2ab41021c979 27-Aug-2014 Chris Craik <ccraik@google.com> Crash instead of leaking layers/textures between GL contexts

bug:17208461
Change-Id: I4d58f301cf0f5e8145e808a5d6ade4de7801970b
/frameworks/base/libs/hwui/Layer.cpp
69e5adffb19135d51bde8e458f4907d7265f3e23 14-Aug-2014 Chris Craik <ccraik@google.com> Define shadow casting behavior within layers

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
/frameworks/base/libs/hwui/Layer.cpp
ec4cefc152749f9805d3a971a4a395687b5a3831 29-Jul-2014 John Reck <jreck@google.com> Add layer/texture creation tracing

Change-Id: I0af6a36c97a9f5f35d28e0e36539ba8d8011ea7c
/frameworks/base/libs/hwui/Layer.cpp
3b20251a355c88193c439f928a84ae69483fb488 23-Jun-2014 John Reck <jreck@google.com> No-fail invokeFunctor

Bug: 15513308
Bug: 15449247

Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
/frameworks/base/libs/hwui/Layer.cpp
a7090e0cfd7c719a6d4c03aae34f5db98754cbdd 21-Jun-2014 Chris Craik <ccraik@google.com> Update 'DisplayList' vs 'RenderNode' naming in several places

Change-Id: I635c6627d098b661fb9b0ba1bd42fa6d7277d287
/frameworks/base/libs/hwui/Layer.cpp
3281442aa75872b8947f0b0a5203257c6849129d 21-Jun-2014 Chris Craik <ccraik@google.com> Merge "Wrap ViewGroup content in save/restore to protect composited children"
80d4902196899d1325cd9f52c06ae0174cf9bd4c 21-Jun-2014 Chris Craik <ccraik@google.com> Wrap ViewGroup content in save/restore to protect composited children

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
/frameworks/base/libs/hwui/Layer.cpp
0732ba5756296f1ae3da48a39e4d498aba366386 17-Jun-2014 Chris Craik <ccraik@android.com> am 88b1c9ad: am e709d53f: am 0d28bb47: Merge "Fix the texture ID reuse issue in HWUI."

* commit '88b1c9ad87ca6d6faaf824bff4ee9d3c799362e5':
Fix the texture ID reuse issue in HWUI.
4a473c7d9406a2d6f6792f0f48d933424740ec5c 10-Jun-2014 jiayuanr <jiayuanr@codeaurora.org> Fix the texture ID reuse issue in HWUI.

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
/frameworks/base/libs/hwui/Layer.cpp
797b95b26bbb7557678af78b9a2a61830158920f 21-May-2014 Chris Craik <ccraik@google.com> Define light position (using new lighting spec) in Java

Also updates the relative shadow strengths.

Change-Id: I6cac7275d38df98aea9f0dda463cd7207102986a
/frameworks/base/libs/hwui/Layer.cpp
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
/frameworks/base/libs/hwui/Layer.cpp
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
/frameworks/base/libs/hwui/Layer.cpp
087bc0c14bdccf7c258dce0cdef46a69a839b427 05-Apr-2014 John Reck <jreck@google.com> Refcount RenderNode

Change-Id: I7a86db8acc2b78ef33d987a43a119f5933d7d752
/frameworks/base/libs/hwui/Layer.cpp
b265e2ca50b6ceb2fd2987ef1f7d063b1bde19ae 27-Mar-2014 Chris Craik <ccraik@google.com> Support shadows on the root RenderNode

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
/frameworks/base/libs/hwui/Layer.cpp
668f0e38ef0277d55d3118af37e17b8c435df85c 26-Mar-2014 John Reck <jreck@google.com> Async drawing!

Change-Id: I7e728356f58af88174328a8c0b90d27b128bfe01
/frameworks/base/libs/hwui/Layer.cpp
bfb07a03777af424e99bca1dac4c903aaf44e99d 25-Mar-2014 John Reck <jreck@google.com> Move where updateProperties is called

Change-Id: I27da448996019094c44487ce28c5689d098d6535
/frameworks/base/libs/hwui/Layer.cpp
d0a0b2a3140bfb1819a116413ce9d81886697a07 21-Mar-2014 John Reck <jreck@google.com> Add stagingProperties

Change-Id: Ic7de551f8843fd70a77f738e33028e25c020bb3c
/frameworks/base/libs/hwui/Layer.cpp
113e0824d6bddf4376240681f9cf6a2deded9498 18-Mar-2014 John Reck <jreck@google.com> Move RenderNode to own file

Change-Id: I9380d161fd3ddd7b569c262dd8e7aa0c96151b1e
/frameworks/base/libs/hwui/Layer.cpp
e18264b079481a244b30e3f71012c53bbd861f92 12-Mar-2014 John Reck <jreck@google.com> Rename DisplayList->RenderNode

Change-Id: Id42e23c9a1a6eb6eaeafef707ced7fa6887b03d0
/frameworks/base/libs/hwui/Layer.cpp
9757ac0b9d62f6aea5e47cfb375f445c78bb7897 26-Feb-2014 Chris Craik <ccraik@google.com> Fix TextureView texture filtering.

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
/frameworks/base/libs/hwui/Layer.cpp
674554fc36932ca50b15bba41ac6f650254d4e72 19-Feb-2014 Derek Sollenberger <djsollen@google.com> Reapply "Refactor setting an SkPaint onto a hwui Layer."

This reverts commit 90d0c75e94a32fb7d993fae69762820aabc2fcbb.

Change-Id: Ie807761231edf7c848b019931dccbf466208c0be
/frameworks/base/libs/hwui/Layer.cpp
90d0c75e94a32fb7d993fae69762820aabc2fcbb 12-Feb-2014 Derek Sollenberger <djsollen@google.com> Revert "Refactor setting an SkPaint onto a hwui Layer."

This reverts commit e889298cd6ae1fc0d76bc00d7d12586db03eb261.

Change-Id: I4b1d609b2d4280595d40cb10d6c18875c22999f8
/frameworks/base/libs/hwui/Layer.cpp
e889298cd6ae1fc0d76bc00d7d12586db03eb261 11-Feb-2014 Derek Sollenberger <djsollen@google.com> Refactor setting an SkPaint onto a hwui Layer.

This CL removes the unecessary JNI call to set the colorFilter on
a layer.

Change-Id: I9e088f888938d4315745aa618334bfdb9e61343a
/frameworks/base/libs/hwui/Layer.cpp
76d3a1b8d035d27bc80b0f2fc480a903bd001514 10-Dec-2013 Derek Sollenberger <djsollen@google.com> Removing SkiaColorFilter and inspecting the native object directly.

bug: 10650594
Change-Id: I4fcf66d008765afa0e35d011f58bc792183cb74f
/frameworks/base/libs/hwui/Layer.cpp
3783e70b557fe58f51d551242a42e7232e991c10 27-Jan-2014 Chris Craik <ccraik@google.com> Remove logging of DisplayList staleness

Change-Id: Ie6b3af3065d4d10ec0bc9b419223d3458d297ea8
/frameworks/base/libs/hwui/Layer.cpp
bb615a6ffbc8a051007163916f1ed085d10b5327 24-Jan-2014 Chris Craik <ccraik@google.com> Clear root level reorder lists to prevent accessing stale DisplayLists

bug:12581401

Adds temporary logging which should log/crash earlier on incorrectly
reordering hierarchies.

Change-Id: Iee00940718c3cc868161e754aff93cd3b2747094
/frameworks/base/libs/hwui/Layer.cpp
f57776b2d195f0937906eb88b777bb55ccc36967 26-Oct-2013 Chris Craik <ccraik@google.com> 3d view system!

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
/frameworks/base/libs/hwui/Layer.cpp
448455fe783b0a711340322dca272b8cc0ebe473 22-Jul-2013 Romain Guy <romainguy@google.com> Use global indices array to draw layers

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
/frameworks/base/libs/hwui/Layer.cpp
fb5c9050978afad2c1df570a13a6747f438c27f7 17-Jun-2013 Romain Guy <romainguy@google.com> Merge "Cancel layer update when a layer is about to be destroyed Bug #9310706"
e93482f5eac3df581d57e64c2a771a96aa868585 17-Jun-2013 Romain Guy <romainguy@google.com> Cancel layer update when a layer is about to be destroyed
Bug #9310706

Change-Id: I73eea6314c326f15a979617e3a05b525935f0d3f
/frameworks/base/libs/hwui/Layer.cpp
8c6e17c2a9b0ad7864a261cc9a30b9623e20bdcb 17-Jun-2013 Chris Craik <ccraik@google.com> Check for layer renderer in flush

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
/frameworks/base/libs/hwui/Layer.cpp
28ce94a4ffc7576f40776d212f1ada79fafaa061 31-May-2013 Chris Craik <ccraik@google.com> Overdraw avoidance and merging of clipped ops

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
/frameworks/base/libs/hwui/Layer.cpp
be1b127c7bec252e0c6ab0e06ed6babed07d496f 06-Jun-2013 Romain Guy <romainguy@google.com> Assume a texture is unbound after deleting it
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
/frameworks/base/libs/hwui/Layer.cpp
8aa195d7081b889f3a7b1f426cbd8556377aae5e 05-Jun-2013 Romain Guy <romainguy@google.com> Introduce Caches::bindTexture() to reduce glBindTexture calls

Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
/frameworks/base/libs/hwui/Layer.cpp
34416eaa1c07b3d7a139e780cea8f8d73219650e 16-Apr-2013 Chris Craik <ccraik@google.com> Make layer double drawing visible in overdraw debug mode

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
/frameworks/base/libs/hwui/Layer.cpp
a151ef8c667a52d9fae28c09f780784f19bdb039 05-Apr-2013 Romain Guy <romainguy@google.com> Merge "First OpenGL ES 3.0 based optimization" into jb-mr2-dev
1206b9bba91f7ed899c5c87427cce725fe5aadfc 04-Apr-2013 Chris Craik <ccraik@google.com> Traverse layers in update order

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
/frameworks/base/libs/hwui/Layer.cpp
0908764b2b3cf5075df4178a5f0a8547dcb7b317 04-Apr-2013 Romain Guy <romainguy@google.com> First OpenGL ES 3.0 based optimization

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
/frameworks/base/libs/hwui/Layer.cpp
02b49b70ede0b9eb760ff334823aee1d9520ed85 29-Mar-2013 Romain Guy <romainguy@google.com> Prevent crash when a single layer is enqueued several times for updates
Bug #8504687

Change-Id: I9b01bbc4e3f37af23dfe5e68d3d03ad3d238b94a
/frameworks/base/libs/hwui/Layer.cpp
696dcf84a382fcc5ef7041e0bbf3af20b0ecb99f 28-Mar-2013 Romain Guy <romainguy@google.com> Update layers to clear them
Bug #8489505

A layer should be updated even with an empty deferred display list. It is
possible for a layer to request an update just to execute a clear which
will be handled by LayerRenderer::prepareDirty().

Change-Id: Iffb98bd71d6caa8d4a701df98197676f9423c0c2
/frameworks/base/libs/hwui/Layer.cpp
ce4a7dfc516ee61301e9af91fad17ca1320efaab 28-Mar-2013 Romain Guy <romainguy@google.com> Don't crash when making a layer larger than supported dimensions
Bug #8437401

A misplaced ref count decrement was causing a crash when attempting to
resize a layer to dimensions larger than the max texture size supported
by the GPU.

This change fixes the crash and clarifies the warnings to make it more
obvious what's happening.

Change-Id: I632dc1b90aaa2605969e10523491a81c4922d3dc
/frameworks/base/libs/hwui/Layer.cpp
96885eb480c5e0526fe2f77d30f6e551f3f3ceab 26-Mar-2013 Romain Guy <romainguy@google.com> Avoid multiple font cache texture uploads
Bug #8378964

This change defers drawing into layers until after the renderer for FBO0
is ready to draw. At that point, all the precaching is done which means
all glyphs can be uploaded at once in the font caches.

Change-Id: Ie1f7a7ff30f76f06fb3dbc72c7d05e66207d1ecb
/frameworks/base/libs/hwui/Layer.cpp
8d4aeb7111afac0c3c7e56d4ad5d92f9cfce2ffd 13-Feb-2013 Romain Guy <romainguy@google.com> Add a render buffer cache to reuse stencil buffers
Bug #7146141

This new cache is used in a similar way to LayerCache. It helps
reuse already allocated stencil buffers and thus avoid churning
memory on every frame.

Change-Id: I19551d72da52c40039e65904563600e492c8b193
/frameworks/base/libs/hwui/Layer.cpp
3bbacf27c0be1bae4e4483577fc89ae3113abe5d 07-Feb-2013 Romain Guy <romainguy@google.com> Add a RenderBuffer object to store stencil buffers.
Bug #7146141

This change is needed to add a render buffer cache to avoid
creating and destroying stencil buffers on every frame.

This change also allows the renderer to use a 1 bit or 4 bit
stencil buffer whenever possible.

Finally this change fixes a bug introduced by a previous CL
which causes the stencil buffer to not be updated in certain
conditions. The fix relies on a new optional parameter in
drawColorRects() that can be used to avoid performing a
quickReject on rectangles generated by the clip region.

Change-Id: I2f55a8e807009887b276a83cde9f53fd5c01199f
/frameworks/base/libs/hwui/Layer.cpp
2055abaa0a590c35e27e1ae2e7d7cfccdfb98b59 19-Jan-2013 Romain Guy <romainguy@google.com> Allow layers with a stencil buffer to be resized on the fly
Bug #7146141

This change moves the resizeLayer() from LayerCache (where it should
never have been anyway) to Layer. This makes a little more sense.

Change-Id: I8b2f9c19c558e738405a58b9e71ec5799fc6be88
/frameworks/base/libs/hwui/Layer.cpp
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
/frameworks/base/libs/hwui/Layer.cpp
5bb3c730f5ebd2a0db1b02a8981c6fdbea6c1a2e 30-Nov-2012 Romain Guy <romainguy@google.com> Apply dev. settings at runtime
Bug #7434649

Change-Id: I16f00eaa8a5eefd9f9849e196cf2cb1659215390
/frameworks/base/libs/hwui/Layer.cpp
7c25aab491707f7324f9941b8cfa9bd2b4b97e76 19-Oct-2012 Romain Guy <romainguy@google.com> Defer layer rendering to avoid stalls
Bug #7326824

When a layer is taken out of the cache and initialized it gets cleared
to prepare it for future rendering. This triggers the following sequence
of operations:

glBindFramebuffer(layer.fbo)
attach texture storage to FBO
glClear()
glBindFramebuffer(defaultFbo)

The clear forces a resolve on tilers which stalls the CPU for a little
while, thus producing jank during animations. This change moves the
clear to the next frame when we know we will have to execute a resolve
anyway.

Change-Id: Ic1939c25df20ed65a4c48dc81ee549b2cd8b6ec3
/frameworks/base/libs/hwui/Layer.cpp
98d3a64ffa13596e3ea9125bbff40c51ec96bd8d 26-Sep-2012 Chet Haase <chet@google.com> Assign default texture id of 0

Some logic depends on a default value of 0, which was not being
assigned.

Issue #7195815 chrome url bar is corrupted
Issue #7190656 Textures corrupted on mr1

Change-Id: I346b7b76e885bf8f04740e711fd88f917a5418c7
/frameworks/base/libs/hwui/Layer.cpp
56257aff8a55c847be72be9924c392033fd8151d 26-Sep-2012 Dave Burke <daveburke@google.com> Revert "Deleting objects on the wrong thread is a silly idea Bug #7195815"

This reverts commit 8a1374946a928fcba7495c87ff6adda327fdfb9f

Change-Id: I53564a6c531d334afcc1fce0bea1e57ae266aa78
/frameworks/base/libs/hwui/Layer.cpp
8a1374946a928fcba7495c87ff6adda327fdfb9f 26-Sep-2012 Romain Guy <romainguy@google.com> Deleting objects on the wrong thread is a silly idea
Bug #7195815

Turns out that multi-threading is hard.

Change-Id: Ib0b4bd6dc3caea27f7ced22cbb363bb955fe58ab
/frameworks/base/libs/hwui/Layer.cpp
97dc9172b0e58979c63de0dedbab656399a62281 24-Sep-2012 Romain Guy <romainguy@google.com> Avoid deadlock when deleting layers
Bug #7217459

Change-Id: I12bfa6c30c5030bd1b23ea6a3ce64240ab1dfba3
/frameworks/base/libs/hwui/Layer.cpp
603f6de35f21d74ae242d52d501f4f5c25ff4f4c 15-Sep-2012 Chet Haase <chet@google.com> Fix occasional crash bug with layers

Launcher occasionally crashes with a stack trace indicating that the memory
of a Layer object is corrupt. It is possible for us to delete a Layer
structure and then, briefly, use it to draw a DisplayList again before
that DisplayList gets recreated (without the layer that got deleted).

When this happens, if the memory got corrupted, it's possible to crash.

The fix is to add Layer to the other objects which we currently refcount
(bitmaps, shaders, etc.). Then instead of deleting a Layer, we decrement the
refcount. We increment when creating it, then increment it again when it's
referenced from a DisplayList. Then we decrement the refcount instead of
deleting it, and decrement when we clear a DisplayList that refers to it.
Then when the refcount reaches 0, we delete it.

Issue #6994632 Native crash in launcher when trying to launch all apps screen

Change-Id: I0627be8d49bb2f9ba8d158a84b764bb4e7df934c
/frameworks/base/libs/hwui/Layer.cpp
d15ebf25c595b855f6978d0600218e3ea5f31e92 05-Sep-2012 Chet Haase <chet@google.com> Enable changing properties of layer paint

Previously, to draw a layered view with a changed Paint object for the
drawLayer operation, you'd have to invalidate the parent view, to get the
native DisplayList to pick up the new Paint properties. This change adds
API and functionality so that the developer can call setLayerPaint(), which
does the proper invalidation (lightweight, doesn't cause redrawing the view).

Issue #6923810 Make it easy to efficiently animate a layer's Paint

Change-Id: I7fea79788d50f6d9c86dd5e5b2a4490cb95142bb
/frameworks/base/libs/hwui/Layer.cpp