History log of /frameworks/base/libs/hwui/LayerCache.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/LayerCache.cpp
9fded232a9548a304e0145011df8849fba0dcda7 12-Nov-2015 Chris Craik <ccraik@google.com> Recycle OffscreenBuffers

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

Change-Id: I00ecd0b61657196b51704f70ca31a9d1c1ac254e
/frameworks/base/libs/hwui/LayerCache.cpp
bef837dc57b47fd7fcc17c86d741cf77eac4487b 30-Jul-2015 John Reck <jreck@google.com> Remove the rest of utils/Vector.h usage

Change-Id: I90ab2c17ba1903a8241cba7f623b74ed136dd845
/frameworks/base/libs/hwui/LayerCache.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/LayerCache.cpp
e5c6584a402fb3b1fe0507e4e00e601bec8f1bbc 03-Mar-2015 Chris Craik <ccraik@google.com> Constructor cleanup

Change-Id: Ic39911d08f44c3174de91fb92fcd4cab73fe4654
/frameworks/base/libs/hwui/LayerCache.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/LayerCache.cpp
07adacf4996c8ca494332ec938786fa15832c722 19-Dec-2014 Chris Craik <ccraik@google.com> Cleanup

Change-Id: I91ffb9c66697741116fdeaa31abdf6cfd79155df
/frameworks/base/libs/hwui/LayerCache.cpp
edaecc1db0584fa017822dfc2da0c968b53967e6 11-Nov-2014 Andreas Gampe <agampe@google.com> resolved conflicts for merge of 1d03b816 to lmp-mr1-dev-plus-aosp

(cherry picked from commit 1272887050a269d6d506b42099c2857847ad100b)

Change-Id: Ib673768fe5fc03615626ef4b10590e5317f22172
/frameworks/base/libs/hwui/LayerCache.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/LayerCache.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/LayerCache.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/LayerCache.cpp
17035b0211a3c9d45ea46a99217a6acbe76e8fbe 03-Sep-2014 John Reck <jreck@google.com> Have destroy call freePrefetchedLayers

Bug: 17208461

There's a potential race condition between HardwareRenderer.destroy()
being called (which calls destroyCanvasAndSurface()) and the renderer
being finalized (which is what calls freePrefetchedLayers), during which
time it's possible we get a TRIM_MEMORY_COMPLETE and destroy the EGL
context.

Fix this race condition by moving stopDrawing() and freePrefetchedLayers()
into destroyCanvasAndSurface() where they should have been in the first
place.

Also, if we hit the assertion failure, dump the current state of
Caches to try and provide more context for the failure.

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

Bug: 15513308
Bug: 15449247

Change-Id: I13a29f9c8d4975cdda6dcb33b6332c2555ff0f7c
/frameworks/base/libs/hwui/LayerCache.cpp
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/LayerCache.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/LayerCache.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/LayerCache.cpp
e3a9b24b5e3f9b2058486814a6d27729e51ad466 08-Jan-2013 Romain Guy <romainguy@google.com> Add plumbing for better text scaling

Fonts are now described by a transform matrix. This lead to switching
from a vector to a hashmap. This change therefore adds new comparators
and hash computations to Font.

Change-Id: I2daffa7d6287c18554c606b8bfa06640d28b4530
/frameworks/base/libs/hwui/LayerCache.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/LayerCache.cpp
5c88fc744db977ef26887df9605beaa409394806 03-Apr-2012 Romain Guy <romainguy@google.com> Prevent crash when flushing the layers cache
Bug #6258973

When flushing the layer caches we would attempt to delete the FBOs
associate with layers in the cache. The FBO property was however not
always properly cleared when recycling layers.

Change-Id: I7dedfe391d659a0849f1e1d84df17313b2c6e2b2
/frameworks/base/libs/hwui/LayerCache.cpp
a1d3c91afbd52c7e8b01f4a9060c5459f02ae7a5 13-Dec-2011 Romain Guy <romainguy@google.com> Further reduce the number of GL commands sent to the driver

Change-Id: Id922b2a166ea4573b767c27d3195e11c70320b23
/frameworks/base/libs/hwui/LayerCache.cpp
39d252a6632d057d5077f7eaf1b8ed7a142f3397 13-Dec-2011 Romain Guy <romainguy@google.com> Various OpenGL optimizations

Change-Id: Ib0742c96f10f5f50e7e5148b742c31b6c232d127
/frameworks/base/libs/hwui/LayerCache.cpp
28d8ff6dbcc1b137131c70b72b4dbd211db7fbd9 22-Aug-2011 Romain Guy <romainguy@google.com> Move constants to the correct header

Change-Id: Id4bd14f72487bd7156cd2e1930eaf97b47896273
/frameworks/base/libs/hwui/LayerCache.cpp
65b345fa22b878e141b8fd8ece9c208df00fa40f 28-Jul-2011 Romain Guy <romainguy@google.com> Reclaim more memory, more often.

Yay.

Change-Id: I04557ad575c307a55088549f48f0e9ad994b7275
/frameworks/base/libs/hwui/LayerCache.cpp
eea60692b060737faeaa02bb30f5b79e2202b482 27-Jul-2011 Romain Guy <romainguy@google.com> Improve layers debugging

Change-Id: Ia4950dd5f0e0a224ecb69c581d33aa4f32260a7c
/frameworks/base/libs/hwui/LayerCache.cpp
912a7b32d0c59ba38265c5dd6ff84ce93f909a7f 27-Jul-2011 Romain Guy <romainguy@google.com> Make sure we have a current EGL context when invoking EGL
Bug #5081795

Change-Id: Iee3382d362a71c1e6c5c498b319bf7f7bcf5a2f0
/frameworks/base/libs/hwui/LayerCache.cpp
e3c26851dc315b730ea0fe5ef35bb1db81f6d675 26-Jul-2011 Romain Guy <romainguy@google.com> Improve rendering performance on some GPUs

This change sets textures filtering to GL_NEAREST by default. GL_LINEAR
filtering is only used when textures are transformed with a scale or
a rotation. This helps save a couple of fps on some GPUs.

Change-Id: I1efaa452c2c79905f00238e54d886a37203a2ac1
/frameworks/base/libs/hwui/LayerCache.cpp
9ace8f5e79e76893fe4ca9e4d10f6c4056330485 08-Jul-2011 Romain Guy <romainguy@google.com> Use NEAREST filtering for layers whenever possible.

Change-Id: Id5bee1bd4a322cf93e8000b08e18f1e1b058648e
/frameworks/base/libs/hwui/LayerCache.cpp
aa6c24c21c727a196451332448d4e3b11a80be69 29-Apr-2011 Romain Guy <romainguy@google.com> New widget: TextureView
Bug #4343984

TextureView can be used to render media content (video, OpenGL,
RenderScript) inside a View.

The key difference with SurfaceView is that TextureView does
not create a new Surface. This gives the ability to seamlessly
transform, animate, fade, etc. a TextureView, which was hard
if not impossible to do with a SurfaceView.
A TextureView also interacts perfectly with ScrollView,
ListView, etc. It allows application to embed media content
in a much more flexible way than before.

For instance, to render the camera preview at 50% opacity,
all you need to do is the following:

mTextureView.setAlpha(0.5f);
Camera c = Camera.open();
c.setPreviewTexture(mTextureView.getSurfaceTexture());
c.startPreview();

TextureView uses a SurfaceTexture to get the job done. More
APIs are required to make it easy to create OpenGL contexts
for a TextureView. It can currently be done with a bit of
JNI code.

Change-Id: Iaa7953097ab5beb8437bcbbfa03b2df5b7f80cd7
/frameworks/base/libs/hwui/LayerCache.cpp
09b7c91de73b59aa3f679b3ae3ba299f82ec9f8a 03-Feb-2011 Romain Guy <romainguy@google.com> Allocate layers from the layers pool.
Bug #3413433

This change will be beneficial to Launcher to avoid hiccups when
swiping pages of icons. When a layer is discarded, it is kept
in the layers pool instead of being destroyed right away. This
favors memory reuse over allocations.

Change-Id: Ifb6944ba83d6ceb67c331527c0827b26ce648eb1
/frameworks/base/libs/hwui/LayerCache.cpp
c9855a53edfac818dc68714557185977556f849d 22-Jan-2011 Romain Guy <romainguy@google.com> Log only 1 line per process when using OpenGLRenderer.

Change-Id: Idbdd6b84f31301e58ed53e0d50fd61fece192dfa
/frameworks/base/libs/hwui/LayerCache.cpp
171c592f0b7066acf279863c8a52ddabea49d3db 06-Jan-2011 Romain Guy <romainguy@google.com> New layers API for Views.

This API can be used to back a view and its children with either a
software layer (bitmap) or hardware layer (FBO). Layers have
various usages, including color filtering and performance
improvements during animations.

Change-Id: Ifc3bea847918042730fc5a8c2d4206dd6c9420a3
/frameworks/base/libs/hwui/LayerCache.cpp
e91080581f467d55913a8c5ab53dedc2dab2e5b6 13-Oct-2010 Romain Guy <romainguy@google.com> Tweak layers caching for better performance in Launcher.

Change-Id: Ia6e67699d98f69c8a93385b3ecbdd814c7b16921
/frameworks/base/libs/hwui/LayerCache.cpp
8550c4c7b5952b7a4e1e0ede95c9492d03099a13 09-Oct-2010 Romain Guy <romainguy@google.com> Better cache for layers, reduce memory usage and increase framerate.

Change-Id: I5ff864a361db4791bd5ff6be716f7ce692ef572d
/frameworks/base/libs/hwui/LayerCache.cpp
eb99356a0548684a501766e6a524529ab93304c8 06-Oct-2010 Romain Guy <romainguy@google.com> Optimize saveLayer() when the clip flag is set.

This speeds up applications, especially Launcher.
/frameworks/base/libs/hwui/LayerCache.cpp
0bb5667b4ef91fefd0500fae0186789d15d54e0e 01-Oct-2010 Romain Guy <romainguy@android.com> Fix INVALID_OPERATION error with layers rendering.

This change is a workaround for a driver bug that causes an INVALID_OPERATION
to be thrown on every glCopyTexSubImage() call. This change also adds a new
test for gradients local matrices.

Change-Id: I41b7437481026702d0a3a9677f099b4557c0a84e
/frameworks/base/libs/hwui/LayerCache.cpp
38c85b907a478af96d71b9a5df5a2066b8475311 23-Sep-2010 Romain Guy <romainguy@android.com> Correctly initialize/refresh layers.

Change-Id: Id8cdcf587b13098460f7d4aa1bd17708784d89bb
/frameworks/base/libs/hwui/LayerCache.cpp
b025b9c8b4efefadb01937db61a1f8ee7d2452bf 16-Sep-2010 Romain Guy <romainguy@google.com> Better error handling in the OpenGL renderer.

Add a glGetError() check on every frame
Don't attempt to create textures larger than the maximum size allowed

Change-Id: Iee4afae16089406dbe8bf10fc93b674f1271a0ca
/frameworks/base/libs/hwui/LayerCache.cpp
f607bdc167f66b3e7003acaa4736ae46d78c1492 11-Sep-2010 Romain Guy <romainguy@google.com> Correct implementation of saveLayer().

Change-Id: I5375126636913e0a84f2d6bbd0ebe40d2e4f2763
/frameworks/base/libs/hwui/LayerCache.cpp
fb8b763f762ae21923c58d64caa729b012f40e05 24-Aug-2010 Romain Guy <romainguy@google.com> Use only one GL context per process, share chaches.

Change-Id: Ieabaa25338d2f4b8d4fd90e7401ad6e7452eae11
/frameworks/base/libs/hwui/LayerCache.cpp
1e79386ba34f0db38c1b35b22cdf122632534354 17-Jul-2010 Romain Guy <romainguy@android.com> Optimize textures binding.

The renderer is still changing textures' wrap modes every time, this will require
a latter optimization.

Change-Id: I3eb92cb8c886c4a692b7f0ca759911f9371d4d2c
/frameworks/base/libs/hwui/LayerCache.cpp
f18fd99b5c182329cd8936a9611f0103d8ece44a 08-Jul-2010 Romain Guy <romainguy@google.com> Create FBOs in LayerCache.

This moves a bit of code away from OpenGLRenderer and matches
what happens with the TextureCache.

Change-Id: I3c67f54f83d7240770daa015861c0e75a1dd8c42
/frameworks/base/libs/hwui/LayerCache.cpp
6c81893c626499e58c8eeb20d6c35ec4e1ce808b 08-Jul-2010 Romain Guy <romainguy@google.com> Simpler way to deal with the FBO multi-cache.

This change removes the need for the SortedList and instead just
add a generated id to each FBO stored in the cache. This is an
artificial way to store several FBOs with the same dimensions.

Change-Id: I9638364e9bdc0f2391261937a0c86096f20505bf
/frameworks/base/libs/hwui/LayerCache.cpp
5f0c6a483900f3989f4d2a8f913cf5b6a9777d03 07-Jul-2010 Romain Guy <romainguy@google.com> Optimize FBO cache.

This change introduces a new generational cache called GenerationMultiCache
that can store several values with the same key. This can be used to use
multiple layers of the same size at the same time, without recreating them
over and over again.

Change-Id: I425466a20908b862c5f464a0f9e582ec18cbd7ac
/frameworks/base/libs/hwui/LayerCache.cpp
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
/frameworks/base/libs/hwui/LayerCache.cpp