History log of /frameworks/base/libs/hwui/TextureCache.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
48a8f431fa52ae2ee25ffba9d20676f03bb710ff 06-Feb-2016 Chris Craik <ccraik@google.com> Move several property queries to Properties class

bug:17478770

This removes a lot of redundant property query code, and puts the
queries all in one place, so defining them automatically will be simpler
in the future.

Change-Id: I0428550e6081f07bc6554ffdf73b22284325abb8
/frameworks/base/libs/hwui/TextureCache.h
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/TextureCache.h
68f5b8a7810a011a068db3390c714bf02f3072c6 09-Sep-2015 Chris Craik <ccraik@google.com> Move texture upload behavior to TextureState

Change-Id: If1cb32bbc04f437fa0d079084de832de9fd777c2
/frameworks/base/libs/hwui/TextureCache.h
272a685f17cc4828257e521a6f62b7b17870f75e 30-Jul-2015 John Reck <jreck@google.com> Replace most usages of utils/Vector.h

Change-Id: I540d1b3523244d6c71fc52d6fb30555271c25644
/frameworks/base/libs/hwui/TextureCache.h
00e79c9947b741194ff6c0d08ede9b3befbf9c9d 21-Jul-2015 John Reck <jreck@google.com> Mark isInUse per-window

Bug: 22509159
Change-Id: I0ae0f1fa582ee38dcb9f24ca20f0b4d0c57ccb32
/frameworks/base/libs/hwui/TextureCache.h
6ad690e16f8e139bfd29a035b52ab616d813a74b 18-Jul-2015 Chris Craik <ccraik@google.com> Fix AssetAtlas usage in BitmapShaders

bug:22521999

Change-Id: I60859748ceee19ebc89ec98845e550ea26e36ecd
/frameworks/base/libs/hwui/TextureCache.h
4538ef2abcdf672e12f00bd944a816af35f16ed1 09-Jun-2015 John Reck <jreck@google.com> Delete unused

Change-Id: If27e1eb8e42313eae14df58a24ca54fafb2992fa
/frameworks/base/libs/hwui/TextureCache.h
117bdbcfa3e8306dad21e7e01fa71b00cdfa7265 05-Feb-2015 Chris Craik <ccraik@google.com> Glop ColorFilter & VertexBuffer support, initial enable

Enables Glop rendering for supported Rects and VertexBuffers
Also removes unused Query object

Change-Id: Ibe227bc362685a153159f75077664f0947764e06
/frameworks/base/libs/hwui/TextureCache.h
3d4eed7f1aa99401dabe2e45b82f98fb4fc2d754 04-Dec-2014 Derek Sollenberger <djsollen@google.com> Update HWUI to store its own SkBitmap objects

This enables us to...

1) simplify the lifecycle/ownership between Java and HWUI
2) remove DisplayListRenderer::drawBitmapData and associated logic
3) track pixel lifecycle using standard SkPixelRef refcounting
4) Remove uncessary calls to ref/unref the bitmap's pixels and colorTable

Change-Id: I3c95078da20995444f6388a029414280fd654318
/frameworks/base/libs/hwui/TextureCache.h
e84a208317e0ed388fcdad1e6743c7849acb51b0 22-Dec-2014 Chris Craik <ccraik@google.com> Add overrides and switch to nullptr keyword

Changes generated with clang-modernize.

Additionally, fixed some struct-vs-class usage to make clang happy.

Change-Id: Ic6ef2427401ff1e794d26f21f7b44868fc75fb72
/frameworks/base/libs/hwui/TextureCache.h
59cf734f9ee8fa0154d199f0f36779a6ffe0dfb5 11-Dec-2014 Yohann Roussel <yroussel@google.com> resolved conflicts for merge of d67bb501 to master

Change-Id: I40698ce1e382cb41eec7af5ea49ac0e2f997d555
ebd52610cfeff6e557fde284a7e1efc5e6438285 11-Dec-2014 John Reck <jreck@google.com> Don't preload textures for AssetAtlas

Bug: 18317479

RenderNode::prepareSubTree calls prefetchAndMarkInUse
on every bitmapResoruce in the DisplayList. However,
this resulted in textures being uploaded for bitmaps
that would be drawn from the AssetAtlas instead.

To fix this we teach TextureCache about the AssetAtlas
so that calls to TextureCache return the Texture from
AssetAtlas if it exists. Thus usage of AssetAtlas
is now purely to allow for further optimizations via
draw merging instead of a requirement to get
any benefit at all.

Change-Id: I65282fa05bac46f4e93822b3467ffa0261ccf200
/frameworks/base/libs/hwui/TextureCache.h
fb7ff703e0f5fbf16c7805a162a3c5f44de5914b 25-Nov-2014 John Reck <jreck@google.com> am 5ab86ba0: am 89a63f02: am 0c31d97a: Merge "Switch TextureCache to SkPixelRef::fStableId" into lmp-mr1-dev

* commit '5ab86ba05decf12e8ee3f693aab6b265905049c6':
Switch TextureCache to SkPixelRef::fStableId
71d08a07189c2b433080203895d9d5e936b16b9e 25-Nov-2014 John Reck <jreck@google.com> Switch TextureCache to SkPixelRef::fStableId

Bug: 18245805
Change-Id: I08e6792dbeed86b13e569c7f2137de0e50dc2763
/frameworks/base/libs/hwui/TextureCache.h
2dc236b2bae13b9a0ed9b3f7320502aecd7983b3 15-Oct-2014 Tom Hudson <tomhudson@google.com> Clean up physical coupling

Narrow the use of #include directives in hwui, replacing with forward
declarations where straightforward. Speeds compiles; doesn't do any
restructuring of code.

Change-Id: Icac2baffb5896f55d8c6718e9bd9d4bfa02d3ca0
/frameworks/base/libs/hwui/TextureCache.h
2357d72ce2427c7b91f8c23487f0d49590e78ea6 16-Jun-2014 ztenghui <ztenghui@google.com> resolved conflicts for merge of ecae1ffd to master

Change-Id: I1ba660ce832e3360fa136be6aa0415645bfda328
c5e0a295418a1fd8c17608041962d70296af6794 27-Nov-2013 Lu, Shenghua <shenghua.lu@intel.com> update parameters in uploadToTexture() for GLES20

Google optimized the uploadToTexture with GLES3.0+,
This allows us to upload a sub-rectangle of texture,
but this has compliance issue with GLES 2.0.

With OpenGL ES 2.0 we need to copy the bitmap in a
temporary buffer if the stride doesn't match the width,
and then upload entire temporary stripes.

Change-Id: I8987cd8347913c61b7fa45bd47be1189aa6bdb05
Signed-off-by: Shenghua Lu <shenghua.lu@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Guobin Zhang<guobin.zhang@intel.com>
/frameworks/base/libs/hwui/TextureCache.h
d1ad5e62fda248c6d185cde3cb6d9f01a223066c 05-May-2014 Leon Scroggins III <scroggo@google.com> Inspect SkShader to determine hw shader.

Instead of duplicating internal info about SkShader, inspect the
SkShader installed on the SkPaint.

core/java/android/view/GLES20Canvas.java:
Remove setupModifiers, nResetModifiers, and nSetupShader.

core/jni/android/graphics/Shader.cpp:
Remove calls to create/destroy the (previously) attached SkiaShader.

core/jni/android_view_GLES20Canvas.cpp:
Remove native code for setupShader and resetModifiers.

graphics/java/android/graphics/BitmapShader.java:
graphics/java/android/graphics/ComposeShader.java:
graphics/java/android/graphics/LinearGradient.java:
graphics/java/android/graphics/RadialGradient.java:
graphics/java/android/graphics/Shader.java:
graphics/java/android/graphics/SweepGradient.java:
Remove code keeping track of native SkiaShader.

libs/hwui/Caches.h:
Include Extensions.h.

libs/hwui/DeferredDisplayList.cpp:
Compare shaders on the paint, instead of on DrawModifiers.

libs/hwui/DisplayList.cpp:
libs/hwui/DisplayList.h:
Remove vector of SkiaShaders.

libs/hwui/DisplayListOp.h:
Access the SkShader on mPaint.
Remove SetupShaderOp and ResetShaderOp.

libs/hwui/DisplayListRenderer.cpp:
libs/hwui/DisplayListRenderer.h:
Remove resetShader, setupShader, refShader, and mShaderMap.

libs/hwui/FontRenderer.cpp:
Pass SkShader to setupDrawShader and setupDrawShaderUniforms.

libs/hwui/OpenGLRenderer.cpp:
libs/hwui/OpenGLRenderer.h:
Add LayerShader, a class inheriting from SkShader, to mimic the
behavior of SkiaLayerShader. Unlike SkiaLayerShader, it can be set on
the SkPaint so it can be inspected later.
Set a LayerShader instead of a SkiaLayerShader.
setupDrawShader and setupDrawShaderUniforms now inspect an SkShader
passed in.
Inspect SkShader instead of mDrawModifiers.mShader.
Remove resetShader and setupShader.
setupDrawColorUniforms now takes a boolean indicating whether there is
a shader.
Add an inline function for accessing the SkShader on an SkPaint.
In setupDrawBlending(Layer*, bool), do not check the shader (which will
never be set), but do check whether the color filter may change the
alpha (newly fixed behavior).
In setupDrawBlending(SkPaint, ...), check the SkShader and whether the
color filter affects alpha (the latter is new behavior).

libs/hwui/Renderer.h:
Remove pure virtual functions setupShader and resetShader.

libs/hwui/ResourceCache.cpp:
libs/hwui/ResourceCache.h:
Remove functions for refing/unrefing shaders.

libs/hwui/SkiaShader.cpp:
libs/hwui/SkiaShader.h:
Much of this code was redundant and has been removed.
Convert structs into class with nothing but static functions for
calling describe/setupProgram.

libs/hwui/TextureCache.cpp:
libs/hwui/TextureCache.h:
Use the SkPixelRef as the key to the bitmap Lru cache, since shader
inspection will provide a different SkBitmap pointer (though it will
hold the correct SkPixelRef with the correct generation ID).

tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java:
tests/CanvasCompare/src/com/android/test/hwuicompare/ResourceModifiers.java:
Update manual test to have more shaders: radial, sweep, compose,
invalid compose.

BUG:10650594

Change-Id: Iaa7189178bda1c55f96da044d2a9fa602ba36034
/frameworks/base/libs/hwui/TextureCache.h
860d155f866cc15a725e7ce03763280987f24901 12-Apr-2014 John Reck <jreck@google.com> Fix issue with bitmap uploading

Bug: 13912749

Change-Id: Ic23fa1d280118dc93dc2716a4a24cc0bbbdca595
/frameworks/base/libs/hwui/TextureCache.h
d218a92c0afb8c0d98135b20b52ac87236e1c935 03-Jan-2014 Chris Craik <ccraik@google.com> Use const where possible for drawing parameters

They should never be modified by a Renderer, only read and copied.

Change-Id: I9d8d55dca19115ee9dfeb2bb3f092ba2fb327cd4
/frameworks/base/libs/hwui/TextureCache.h
318ae7bb92869d99a05388c598ad105e7aa4cdbd 25-Sep-2013 Romain Guy <romainguy@google.com> Take SkBitmap's stride into account when uploading textures
Bug #10151807

Change-Id: I7ba4804fa3619088fea70eb55f10519fff0bf5f0
/frameworks/base/libs/hwui/TextureCache.h
059e12ccd20f5c249724a8362d6bac325334ea76 29-Nov-2012 Romain Guy <romainguy@google.com> Use LruCache instead of GenerationCache in libhwui

Change-Id: Ic26ddc7151eb5462bcd243b21daf7187ed6d3bec
/frameworks/base/libs/hwui/TextureCache.h
52439570800891345981c0968b513843edc2b27a 17-Oct-2012 Romain Guy <romainguy@google.com> Enable mipmapping, without a deadlock this time
Bug #7353771

Change-Id: I89a08a58608e374f1c604a26ee0769d5850b2f7b
/frameworks/base/libs/hwui/TextureCache.h
713e1bb9df6bdfc21bd5c40d1a6ecf6c822a4be5 17-Oct-2012 Romain Guy <romainguy@google.com> Add API to enable mipmaps on Bitmap
Bug #7353771

This API can be used when scaling large images down to a small size
to get nicer looking results.

Change-Id: If09087eed36077eee5355f6047a3ca67747d7d9e
/frameworks/base/libs/hwui/TextureCache.h
e651cc6239616a202f6e96ebc2ed93b4b8b3627c 15-May-2012 Romain Guy <romainguy@google.com> Remove all Dalvik allocations from Cavnas.drawBitmap(int[], ...)

Change-Id: Ie28538a2104d21154fdc78a56525e7403f08287d
/frameworks/base/libs/hwui/TextureCache.h
029f64303b8fe506ef34c12777da86b830d3bf7a 05-Mar-2012 Derek Sollenberger <djsollen@google.com> Add missing includes for Mutex.h

The missing header was being transitively included through a
Skia header which is being removed.

Change-Id: I5a65bae076027951fe07d1e7eecd4732124fb0e4
/frameworks/base/libs/hwui/TextureCache.h
5baa3a62a97544669fba6d65a11c07f252e654dd 20-Dec-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
/frameworks/base/libs/hwui/TextureCache.h
eca0ca2424afc1e98912405906edfc32f7733e16 04-Nov-2011 Romain Guy <romainguy@google.com> Memory optimizations for libhwui
Bug #5566149

Lazily initialize font renderers
Keep 60% of the texture cache when an app goes to the background
Delete least used font renderer when going to the background
Delete all font renderers on full memory trim

Change-Id: I3c2454d46dc1107ec0f0f72a9ce69cbbcc8825e7
/frameworks/base/libs/hwui/TextureCache.h
fe48f65922d4a3cc4aefe058cee5acec51504a20 12-Nov-2010 Romain Guy <romainguy@google.com> Free resources only from the GL context thread.
Bug #3179882

Resources were freed following garbage collections on a worker thread.
This worker thread had no EGL context, which would cause the renderer
to incorrectly assume that the memory was liberated.

Change-Id: Ifdb51f94ddf42641e8654522787bfac532976c7c
/frameworks/base/libs/hwui/TextureCache.h
e190aa69756aecfaffabdd4c6d32cb6b3220d842 11-Nov-2010 Romain Guy <romainguy@google.com> Add new runtime debug flags.

Change-Id: I07955de166a89b5053c6c13f250bb3e2936ca86e
/frameworks/base/libs/hwui/TextureCache.h
c15008e72ec00ca20a271c3006dac649fd07533b 10-Nov-2010 Romain Guy <romainguy@google.com> Move all debug flags in a single place.

This change also adds a new memory usage flag. When turned on, the
following is printed after every frame:

D/OpenGLRenderer( 3723): Current memory usage / total memory usage (bytes):
D/OpenGLRenderer( 3723): TextureCache 3766680 / 20971520
D/OpenGLRenderer( 3723): LayerCache 3538944 / 8388608
D/OpenGLRenderer( 3723): GradientCache 135168 / 524288
D/OpenGLRenderer( 3723): PathCache 41180 / 4194304
D/OpenGLRenderer( 3723): TextDropShadowCache 0 / 2097152
D/OpenGLRenderer( 3723): FontRenderer 0 262144 / 262144
D/OpenGLRenderer( 3723): FontRenderer 1 262144 / 262144
D/OpenGLRenderer( 3723): FontRenderer 2 262144 / 262144
D/OpenGLRenderer( 3723): Other:
D/OpenGLRenderer( 3723): FboCache 2 / 12
D/OpenGLRenderer( 3723): PatchCache 31 / 512
D/OpenGLRenderer( 3723): Total memory usage:
D/OpenGLRenderer( 3723): 8268404 bytes, 7.89 MB

This should help tracking possibe memory issues.

Change-Id: I83f483ca1d2dbef904829bce368e33fe5503e8d6
/frameworks/base/libs/hwui/TextureCache.h
9e10841c27d973b930e1b49a099c69d866659505 09-Nov-2010 Romain Guy <romainguy@google.com> Correctly remove unused paths from the cache.

Change-Id: I41d9334dcd9871634037344ab49bf69383498161
/frameworks/base/libs/hwui/TextureCache.h
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
/frameworks/base/libs/hwui/TextureCache.h
d98aa2de9ab18e09c2be1997f41212740f51f6e6 26-Oct-2010 Chet Haase <chet@google.com> DisplayList optimizations and fixes.

We now use a copy of SkPaint objects to avoid having it changed from under us.
We reuse copies that have not changed. We also copy the SkMatrix every time to
avoid the same problem.

Change-Id: If3fd80698f2d43ea16d23302063e0fd8d0549027
/frameworks/base/libs/hwui/TextureCache.h
21b028a44f3e0bd9b0f0432b8b92c45f661d22a4 09-Oct-2010 Romain Guy <romainguy@google.com> Move GenerationCache to the utils directory.

Change-Id: I210ffa8f1d76a102bb7d971c649c20a74d03fbe6
/frameworks/base/libs/hwui/TextureCache.h
7adaf3d1aa18c7e521f7154e545fe52d329763c3 05-Oct-2010 Romain Guy <romainguy@google.com> Add support for paletted textures.

Change-Id: I36e6069bd58f78c609cdd1f3e4560c98f128f48e
/frameworks/base/libs/hwui/TextureCache.h
8c749f87d29e1a363ddf9027c3a51753c612d510 22-Sep-2010 Romain Guy <romainguy@android.com> Fix texture corruption issue, faster re-upload of textures.

Bug #2950691

Change-Id: I57e2bc1d1a23e8683c25de7d09d6f5af2df59f41
/frameworks/base/libs/hwui/TextureCache.h
a2341a9f6addcd79723965ec5b1a1c5ae0f8bd65 09-Sep-2010 Romain Guy <romainguy@google.com> Purge Skia objects from GL caches as needed.

Change-Id: I754c671cf790ad5ae8bf047ad328034217da4ecc
/frameworks/base/libs/hwui/TextureCache.h
9aaa8269a3e7291aab84d01c3fc9c744d8f2d2f4 09-Sep-2010 Romain Guy <romainguy@google.com> Fix possible infinite loop when purging textures.

Change-Id: Ib05b398ae03e734da2dab0496df416fed4570b1c
/frameworks/base/libs/hwui/TextureCache.h
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/TextureCache.h
163935113919a184122b8b3bd672ef08c8df65dc 08-Aug-2010 Romain Guy <romainguy@android.com> Make libhwui entirely optional.

The makefile variable USE_OPENGL_RENDERER must be set to true to compile
libhwui and the related code in the JNI layer.

This change also removes obsolete APIs from Canvas that must not be used
and would be confusing if left in. These APIs were remnants of our first
attempt at an OpenGL renderer for the view hierarchy and had not been
taken out before Android 1.0 was released.

Change-Id: I2475ff1307212bab26c926724f3c508681c7dae1
/frameworks/base/libs/hwui/TextureCache.h
9cccc2b9bdd4850a3f9679569aaec3ab98477a5d 08-Aug-2010 Romain Guy <romainguy@android.com> Enforce maximum texture size.

When an app tries to render a bitmap or path larger than the GPU's maximum
texture size, the drawing command is ignored and a warning is logged. This
change also makes texture drawing more robust by catching potential errors
during texture creation.

This change also fixes a crash in the FontRenderer. The destructor would
sometimes try to free an uninitialized array.

Change-Id: I95ae0939c52192d97b340aa02417bf6d0c962c57
/frameworks/base/libs/hwui/TextureCache.h
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/TextureCache.h
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/TextureCache.h
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/TextureCache.h
7d139ba2c331f11e9b485753cc727a0ff202f2a4 02-Jul-2010 Romain Guy <romainguy@android.com> Remove extra leftover logs and use uint32_t instead of unsigned int.

Change-Id: I944f82fe3255de38dc04048cc8bd861f578f01a7
/frameworks/base/libs/hwui/TextureCache.h
121e2242565d5f09ad83a2d33ecd2225838802c5 02-Jul-2010 Romain Guy <romainguy@google.com> Track the size in memory of the texture cache.

The texture cache was previously checking the number of stored textures. This was
not very useful as this could easily lead to an abuse of memory. The new cache
instead tracks the total size occupied in RAM by the cached textures. When a new
texture is generated, older textures are kicked out as needed.

Change-Id: Ib27142f4a018d5bf84774c1fb6f45a67a85f20bc
/frameworks/base/libs/hwui/TextureCache.h
fe8809471a40cac8acc984adfa51c39e13e83947 01-Jul-2010 Romain Guy <romainguy@google.com> Remove unnecessary return and add bitmap generation ID tracking.

Change-Id: Icf5e0635e789f5ea53268c22fad51cf733b5b1a6
/frameworks/base/libs/hwui/TextureCache.h
364703c6fa4aa1a7d2ef5b0c048ea2a0d57a4c40 01-Jul-2010 Romain Guy <romainguy@google.com> Fix the build.

Change-Id: I08bd6daf25351daca3ae552e1cfcfce85eefa73b
/frameworks/base/libs/hwui/TextureCache.h
ce0537b80087a6225273040a987414b1dd081aa0 30-Jun-2010 Romain Guy <romainguy@google.com> Add hooks for drawBitmap().

Change-Id: I58e962c3a8b2bc75c2605fe369ad3002579d86e0

Add texture cache.

Change-Id: I1c0e5581d228869e114438258a1014e33e024ad7
/frameworks/base/libs/hwui/TextureCache.h