diff options
author | Mike Reed <reed@google.com> | 2009-04-27 14:32:05 -0400 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2009-04-27 14:32:05 -0400 |
commit | caf0df1b7f99736aed1a0b923ef278fc4fd0fcca (patch) | |
tree | 59d8cc6a5756bb0a637d16768b4a6f41c997bbe2 /graphics | |
parent | fc8db53eee11568b286e8d9c17e211bd6781fab6 (diff) | |
download | frameworks_base-caf0df1b7f99736aed1a0b923ef278fc4fd0fcca.zip frameworks_base-caf0df1b7f99736aed1a0b923ef278fc4fd0fcca.tar.gz frameworks_base-caf0df1b7f99736aed1a0b923ef278fc4fd0fcca.tar.bz2 |
Add call to (new) Canvas.freeCaches() in response to low-memory
This is in conjunction with removing a similar call made by the browser.
Now it will be centralized, and the browser's call site will be removed.
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/Canvas.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java index 32ecd9f..06d53e3 100644 --- a/graphics/java/android/graphics/Canvas.java +++ b/graphics/java/android/graphics/Canvas.java @@ -112,7 +112,9 @@ public class Canvas { * on behalf of the Canvas. Any subsequent drawing with a GL-backed Canvas * will have to recreate those resources. */ - public static native void freeGlCaches(); + public static void freeGlCaches() { + freeCaches(); + } /** * Specify a bitmap for the canvas to draw into. @@ -1405,6 +1407,14 @@ public class Canvas { finalizer(mNativeCanvas); } + /** + * Free up as much memory as possible from private caches (e.g. fonts, + * images) + * + * @hide - for now + */ + public static native void freeCaches(); + private static native int initRaster(int nativeBitmapOrZero); private static native int initGL(); private static native void native_setBitmap(int nativeCanvas, int bitmap); |