diff options
author | John Reck <jreck@google.com> | 2014-11-06 09:45:10 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-11-06 09:45:10 -0800 |
commit | a35778c799e8073a42b9e22191bde9d838327ab7 (patch) | |
tree | f4d74fc026f8dcf6d8ea8e5a18be30a14b990b70 /core/jni/android | |
parent | b9744c1c1f5e8cc936da7f1832665f77ad5bb18f (diff) | |
download | frameworks_base-a35778c799e8073a42b9e22191bde9d838327ab7.zip frameworks_base-a35778c799e8073a42b9e22191bde9d838327ab7.tar.gz frameworks_base-a35778c799e8073a42b9e22191bde9d838327ab7.tar.bz2 |
Yank ResourceCache out of Caches
Bug: 17947547
Pull the ResourceCache (aka, ref-counting side channel) out of
Caches so that DisplayListRenderer doesn't use Caches, avoiding
the risk of instantiating Caches on the wrong thread or
without a GL context
Change-Id: I7d63b70b3b0a0163308c5dedd6ef255eadebe8fd
Diffstat (limited to 'core/jni/android')
-rwxr-xr-x | core/jni/android/graphics/Bitmap.cpp | 10 | ||||
-rw-r--r-- | core/jni/android/graphics/NinePatch.cpp | 6 | ||||
-rw-r--r-- | core/jni/android/graphics/Path.cpp | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp index 70cf9a8..d7eef6e 100755 --- a/core/jni/android/graphics/Bitmap.cpp +++ b/core/jni/android/graphics/Bitmap.cpp @@ -17,7 +17,7 @@ #include <jni.h> -#include <Caches.h> +#include <ResourceCache.h> #if 0 #define TRACE_BITMAP(code) code @@ -365,8 +365,8 @@ static jobject Bitmap_copy(JNIEnv* env, jobject, jlong srcHandle, static void Bitmap_destructor(JNIEnv* env, jobject, jlong bitmapHandle) { SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle); #ifdef USE_OPENGL_RENDERER - if (android::uirenderer::Caches::hasInstance()) { - android::uirenderer::Caches::getInstance().resourceCache.destructor(bitmap); + if (android::uirenderer::ResourceCache::hasInstance()) { + android::uirenderer::ResourceCache::getInstance().destructor(bitmap); return; } #endif // USE_OPENGL_RENDERER @@ -376,9 +376,9 @@ static void Bitmap_destructor(JNIEnv* env, jobject, jlong bitmapHandle) { static jboolean Bitmap_recycle(JNIEnv* env, jobject, jlong bitmapHandle) { SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle); #ifdef USE_OPENGL_RENDERER - if (android::uirenderer::Caches::hasInstance()) { + if (android::uirenderer::ResourceCache::hasInstance()) { bool result; - result = android::uirenderer::Caches::getInstance().resourceCache.recycle(bitmap); + result = android::uirenderer::ResourceCache::getInstance().recycle(bitmap); return result ? JNI_TRUE : JNI_FALSE; } #endif // USE_OPENGL_RENDERER diff --git a/core/jni/android/graphics/NinePatch.cpp b/core/jni/android/graphics/NinePatch.cpp index cf23771..be62fdd 100644 --- a/core/jni/android/graphics/NinePatch.cpp +++ b/core/jni/android/graphics/NinePatch.cpp @@ -21,7 +21,7 @@ #include <androidfw/ResourceTypes.h> #include <utils/Log.h> -#include <Caches.h> +#include <ResourceCache.h> #include "Paint.h" #include "Canvas.h" @@ -80,9 +80,9 @@ public: static void finalize(JNIEnv* env, jobject, jlong patchHandle) { int8_t* patch = reinterpret_cast<int8_t*>(patchHandle); #ifdef USE_OPENGL_RENDERER - if (android::uirenderer::Caches::hasInstance()) { + if (android::uirenderer::ResourceCache::hasInstance()) { Res_png_9patch* p = (Res_png_9patch*) patch; - android::uirenderer::Caches::getInstance().resourceCache.destructor(p); + android::uirenderer::ResourceCache::getInstance().destructor(p); return; } #endif // USE_OPENGL_RENDERER diff --git a/core/jni/android/graphics/Path.cpp b/core/jni/android/graphics/Path.cpp index 9d3e74b..30ce58d 100644 --- a/core/jni/android/graphics/Path.cpp +++ b/core/jni/android/graphics/Path.cpp @@ -27,7 +27,7 @@ #include "SkPath.h" #include "SkPathOps.h" -#include <Caches.h> +#include <ResourceCache.h> #include <vector> #include <map> @@ -39,8 +39,8 @@ public: static void finalizer(JNIEnv* env, jobject clazz, jlong objHandle) { SkPath* obj = reinterpret_cast<SkPath*>(objHandle); #ifdef USE_OPENGL_RENDERER - if (android::uirenderer::Caches::hasInstance()) { - android::uirenderer::Caches::getInstance().resourceCache.destructor(obj); + if (android::uirenderer::ResourceCache::hasInstance()) { + android::uirenderer::ResourceCache::getInstance().destructor(obj); return; } #endif |