History log of /frameworks/base/libs/hwui/TextureCache.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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.cpp
71d08a07189c2b433080203895d9d5e936b16b9e 25-Nov-2014 John Reck <jreck@google.com> Switch TextureCache to SkPixelRef::fStableId

Bug: 18245805
Change-Id: I08e6792dbeed86b13e569c7f2137de0e50dc2763
/frameworks/base/libs/hwui/TextureCache.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/TextureCache.cpp
ec4cefc152749f9805d3a971a4a395687b5a3831 29-Jul-2014 John Reck <jreck@google.com> Add layer/texture creation tracing

Change-Id: I0af6a36c97a9f5f35d28e0e36539ba8d8011ea7c
/frameworks/base/libs/hwui/TextureCache.cpp
1103b3255945d2eb2fa9c191e84e2270b343cca9 08-Jul-2014 Mike Reed <reed@google.com> SkBitmap::Config is deprecated, use SkColorType

Change-Id: Ic953741325607bf85598c097bb3ab648d4a08996
/frameworks/base/libs/hwui/TextureCache.cpp
b933055cf3f7f8ea89bfd3bc9c37a3891ff7310a 16-Jun-2014 Mike Reed <reed@google.com> stop using (deprecated) SkBitmap::Config

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

Change-Id: I1ba660ce832e3360fa136be6aa0415645bfda328
ecae1ffd7719a60e471550436f885299d27de7df 16-Jun-2014 Tenghui Zhu <ztenghui@android.com> am df36dd20: am 386caf6c: Merge "update parameters in uploadToTexture() for GLES20"

* commit 'df36dd200c55a6ad463b46bab0ffff49d21206ff':
update parameters in uploadToTexture() for GLES20
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.cpp
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.cpp
860d155f866cc15a725e7ce03763280987f24901 12-Apr-2014 John Reck <jreck@google.com> Fix issue with bitmap uploading

Bug: 13912749

Change-Id: Ic23fa1d280118dc93dc2716a4a24cc0bbbdca595
/frameworks/base/libs/hwui/TextureCache.cpp
2488727a5955c87d775df23649919af71d064d13 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Update framework to use M33 Skia. DO NOT MERGE

(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
the length (read(NULL, 0)) is no longer implemented, since it is
no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Icaf597783da3ffb079ea18badb78fa31403bf8b8
/frameworks/base/libs/hwui/TextureCache.cpp
96978ee290ea0ef666c49ffa8733a8c74304c9f1 17-Mar-2014 Leon Scroggins III <scroggo@google.com> am f8d8777d: Update framework to use M33 Skia. DO NOT MERGE

* commit 'f8d8777dddf91c741981b4f795f2fb2b1d81c1b6':
Update framework to use M33 Skia. DO NOT MERGE
f8d8777dddf91c741981b4f795f2fb2b1d81c1b6 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Update framework to use M33 Skia. DO NOT MERGE

(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
the length (read(NULL, 0)) is no longer implemented, since it is
no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33

Conflicts:
core/jni/android/graphics/Bitmap.cpp
core/jni/android/graphics/Graphics.cpp
core/jni/android/graphics/Typeface.cpp
graphics/java/android/graphics/Bitmap.java
/frameworks/base/libs/hwui/TextureCache.cpp
fa03b57295f7c73372bb62b0a1a3e906c3ee659e 11-Mar-2014 Chris Craik <ccraik@android.com> am 7b4cce68: am c3bac8a0: Merge "Fix graphics corruption caused by HWUI caches"

* commit '7b4cce68853d8bcfce2b6bd7f999915063eb56d2':
Fix graphics corruption caused by HWUI caches
5e49b497ae2019586937aae0e8159292363728b5 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Update framework to use M33 Skia. DO NOT MERGE

(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
the length (read(NULL, 0)) is no longer implemented, since it is
no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33
/frameworks/base/libs/hwui/TextureCache.cpp
300bdfa13dd903c9335c11838cc0a604d0f8f2e6 26-Feb-2014 Chris Craik <ccraik@android.com> am 328b7ee6: am aecb8c43: am 7b4cce68: am c3bac8a0: Merge "Fix graphics corruption caused by HWUI caches"

* commit '328b7ee6a2ba2dc8f162fa57dbafd4bfc89bb72e':
Fix graphics corruption caused by HWUI caches
36fad8f6fcfbc2087b910600ed5a6f9741177d00 09-Jan-2014 Sangkyu Lee <sk82.lee@lge.com> Fix graphics corruption caused by HWUI caches

Some caches(PatchCache, TextureCache, PathCache) for HWUI
uses deferred removal for their cache entries even though
actual resource objects are immediately freed by
ResourceCache.
For this reason, the uniqueness of a resource address in
the caches is not guaranteed in specific cases.
(Because malloc() can return the same address when malloc()
and free() called very frequently.)

So it can be possible the cache have two cache entries for
two different resources but the same memory address.
(Of course one of the resources is already freed.)
It also can be possible mGarbage vector in PatchCache has
duplicated addresses and this can lead to duplicated free
blocks in the free block list and graphics corruption.
(Deferred removal was implmeneted based on an assumption of
unique resource addresses.)

So this patch makes sure resource objects are freed after
the resources are removed from the caches to guarantee
the uniqueness of a resource address and prevent graphics
corruption.

Change-Id: I040f033a4fc783d2c4bc04b113589657c36fb15b
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
/frameworks/base/libs/hwui/TextureCache.cpp
8790be6de3644e332ec6a17c855da89ffc13a9bf 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

Change-Id: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a
/frameworks/base/libs/hwui/TextureCache.cpp
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.cpp
4b9a19a8f865970e0079f431c8c2c2a8e4333ae9 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Call SkBitmap::config() instead of ::getConfig()

getConfig() has been deprecated.

Change-Id: I32066256ab82ac4760c752c80856d1b56d291fae
/frameworks/base/libs/hwui/TextureCache.cpp
e63f7c622a2086aefa80983c6f41b74fb166bb42 17-Oct-2013 Chris Craik <ccraik@google.com> Clean unused parameters, disable warnings

Change-Id: Iddb872f53075dd022eeef45265594d1c6a9e2bc0
/frameworks/base/libs/hwui/TextureCache.cpp
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.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/TextureCache.cpp
8aa195d7081b889f3a7b1f426cbd8556377aae5e 05-Jun-2013 Romain Guy <romainguy@google.com> Introduce Caches::bindTexture() to reduce glBindTexture calls

Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
/frameworks/base/libs/hwui/TextureCache.cpp
ca89e2a68703bd428e8b66547d033a6ed35b3595 09-Mar-2013 Romain Guy <romainguy@google.com> Precache paths from a worker thread

Change-Id: I3e7b53d67e0e03e403beaf55c39350ead7f1e309
/frameworks/base/libs/hwui/TextureCache.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/TextureCache.cpp
059e12ccd20f5c249724a8362d6bac325334ea76 29-Nov-2012 Romain Guy <romainguy@google.com> Use LruCache instead of GenerationCache in libhwui

Change-Id: Ic26ddc7151eb5462bcd243b21daf7187ed6d3bec
/frameworks/base/libs/hwui/TextureCache.cpp
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.cpp
a33d161250b0787f4e7a3f3f09244451e22496ce 17-Oct-2012 Mathias Agopian <mathias@google.com> workaround to unbreak the build (deadlock during boot)

bug: 7363206
Change-Id: Ie79c309e367ba07336a5299af9fd59c6bd2390e7
/frameworks/base/libs/hwui/TextureCache.cpp
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.cpp
d43b22da291fd08017fac627561091a633c85807 16-Oct-2012 Romain Guy <romainguy@google.com> Always use the correct pixel store size
Bug #7357394

When a bitmap is reused it may change configuration which can lead
to a different pixel store alignment. Our current texture cache
implementation assumes this never happens and keeps the old alignment
which can lead to distorted texture (if the bitmap goes from
ARGB8888 to RGB565 for instance.)

Change-Id: Ic57acf2403411ae4d0924e92f221298350612617
/frameworks/base/libs/hwui/TextureCache.cpp
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.cpp
3762c311729fe9f3af085c14c5c1fb471d994c03 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
/frameworks/base/libs/hwui/TextureCache.cpp
8564c8da817a845353d213acd8636b76f567b234 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE

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

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
/frameworks/base/libs/hwui/TextureCache.cpp
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.cpp
8f9a9f61ab793d9387a5942b307e74324704893b 05-Dec-2011 Romain Guy <romainguy@google.com> Clip text correctly
Bug #5706056

A newly introduced optimization relied on the display list renderer
to properly measure text to perform fast clipping. The paint used
to measure text needs to have AA and glyph id encoding set to return
the correct results. Unfortunately these properties were set by
the GL renderer and not by the display list renderer. This change
simply sets the properties in the display list renderer instead.

This change also improves the error message printed out when the
application attempts to use a bitmap larger than the max texture
size.

Change-Id: I4d84e1c7d194aed9ad476f69434eaa2c8f3836a8
/frameworks/base/libs/hwui/TextureCache.cpp
d21b6e1fe337b35f62cf2028e9bd0637fd009a75 01-Dec-2011 Romain Guy <romainguy@google.com> Optimize away unnecessary state changes

Change-Id: I0f6816f9f6234853575ecee5033186ad19e76380
/frameworks/base/libs/hwui/TextureCache.cpp
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.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/TextureCache.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/TextureCache.cpp
b37cbec6d06578a72bdd9c2caa3fd964ade71c53 25-Feb-2011 Romain Guy <romainguy@google.com> Correctly blend translucent GIF bitmaps.

Change-Id: Ifeb2c1d97a4c6dfeb1a7b5b26f1a3153e9f8da7f
/frameworks/base/libs/hwui/TextureCache.cpp
f6834478b379856d3e5de92ddce7de0e6ba9fa4a 23-Jan-2011 Romain Guy <romainguy@google.com> Always render text underline extra.
Bug #3381287

Change-Id: Ibfbc9c51c8dccef216daccc37d835e5dbf143a6a
/frameworks/base/libs/hwui/TextureCache.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/TextureCache.cpp
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.cpp
e190aa69756aecfaffabdd4c6d32cb6b3220d842 11-Nov-2010 Romain Guy <romainguy@google.com> Add new runtime debug flags.

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

Change-Id: I41d9334dcd9871634037344ab49bf69383498161
/frameworks/base/libs/hwui/TextureCache.cpp
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.cpp
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.cpp
7adaf3d1aa18c7e521f7154e545fe52d329763c3 05-Oct-2010 Romain Guy <romainguy@google.com> Add support for paletted textures.

Change-Id: I36e6069bd58f78c609cdd1f3e4560c98f128f48e
/frameworks/base/libs/hwui/TextureCache.cpp
29d8997bd43b7c4ad37fc3d6f91eaafa74913c88 23-Sep-2010 Romain Guy <romainguy@android.com> Fix OpenGL errors in various places.

Change-Id: I3a4e115d8fb13b6c443e65460d92987b16f2524c
/frameworks/base/libs/hwui/TextureCache.cpp
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.cpp
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.cpp
9aaa8269a3e7291aab84d01c3fc9c744d8f2d2f4 09-Sep-2010 Romain Guy <romainguy@google.com> Fix possible infinite loop when purging textures.

Change-Id: Ib05b398ae03e734da2dab0496df416fed4570b1c
/frameworks/base/libs/hwui/TextureCache.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/TextureCache.cpp
e9e7fd0813f1485d20c6cd0014d59aff53c35d84 19-Aug-2010 Romain Guy <romainguy@google.com> Update OpenGLRenderer test to test opaque ARGB8888 bitmaps.

Change-Id: I7159825f4b1d6f5a1cd09ec091994801b52b6bda
/frameworks/base/libs/hwui/TextureCache.cpp
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.cpp
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.cpp
22158e139a3d6c6a9787ca0de224e9368f643284 06-Aug-2010 Romain Guy <romainguy@google.com> Automatically cleanup textures that don't fit in the cache.

Change-Id: I4f29ed96ea11118b391fb957e1e4d1b8fcef1537
/frameworks/base/libs/hwui/TextureCache.cpp
bd0e6aa0ff0bd8b376772c3e23513a6021bdda87 23-Jul-2010 Romain Guy <romainguy@google.com> Add a way to query GL extensions.

Change-Id: Ic27dbf72289dacf641b640a749fbd40c12cd474f
/frameworks/base/libs/hwui/TextureCache.cpp
c0ac193b9415680f0a69e20a3f5f22d16f8053be 20-Jul-2010 Romain Guy <romainguy@google.com> Add support for linear gradients.

Change-Id: Id15329da065045b3f06fdaed615f33cd57608496
/frameworks/base/libs/hwui/TextureCache.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/TextureCache.cpp
594f4065141a53427cad6f4fc89219d2f27e1a7d 14-Jul-2010 Romain Guy <romainguy@google.com> Enable 32-bits only assets.

Go away dithering!

Change-Id: Iee5ee2e9430606e732d9b0abb3adc9f68275bd6d
/frameworks/base/libs/hwui/TextureCache.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/TextureCache.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/TextureCache.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/TextureCache.cpp
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.cpp
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.cpp
8ba548f81d1ab5f1750cbf86098c4a14e0b8bead 01-Jul-2010 Romain Guy <romainguy@google.com> Add implementation for drawBitmap(Bitmap, Rect, Rect, Paint)

Change-Id: I10904d2325a5431d15801aebcec1048715678e8c
/frameworks/base/libs/hwui/TextureCache.cpp
c1396e93b6a5286a5183c00c781b62e940a12c1f 01-Jul-2010 Romain Guy <romainguy@google.com> Add implementation for drawBitmap().

Change-Id: Iada9325f3c5642b61c2e0c4cd80bcfbc92cb491e
/frameworks/base/libs/hwui/TextureCache.cpp
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.cpp
364703c6fa4aa1a7d2ef5b0c048ea2a0d57a4c40 01-Jul-2010 Romain Guy <romainguy@google.com> Fix the build.

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