diff options
author | Chris Craik <ccraik@google.com> | 2014-04-17 16:31:16 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-04-17 16:31:16 +0000 |
commit | 0932cf87c131f9238538fd7137b282adbe71dc37 (patch) | |
tree | 8a80fe66f342d07b7e4ac61b7948704aaf4b1a70 /graphics/java | |
parent | 2632f19728e388b85ecb77095bbb4b0aa18b75e2 (diff) | |
parent | cd23df6a08cf7a9bdee11e703f40bca5904d779d (diff) | |
download | frameworks_base-0932cf87c131f9238538fd7137b282adbe71dc37.zip frameworks_base-0932cf87c131f9238538fd7137b282adbe71dc37.tar.gz frameworks_base-0932cf87c131f9238538fd7137b282adbe71dc37.tar.bz2 |
Merge "Deprecate color array drawBitmap methods"
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/graphics/Canvas.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java index 9e767d3..bfc3992 100644 --- a/graphics/java/android/graphics/Canvas.java +++ b/graphics/java/android/graphics/Canvas.java @@ -1224,7 +1224,13 @@ public class Canvas { * values. If false, the alpha byte is ignored (assumed to * be 0xFF for every pixel). * @param paint May be null. The paint used to draw the bitmap + * + * @deprecated Usage with a {@link #isHardwareAccelerated() hardware accelerated} canvas + * requires an internal copy of color buffer contents every time this method is called. Using a + * Bitmap avoids this copy, and allows the application to more explicitly control the lifetime + * and copies of pixel data. */ + @Deprecated public void drawBitmap(int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, Paint paint) { // check for valid input @@ -1251,16 +1257,23 @@ public class Canvas { native_drawBitmap(mNativeCanvas, colors, offset, stride, x, y, width, height, hasAlpha, paint != null ? paint.mNativePaint : 0); } - - /** Legacy version of drawBitmap(int[] colors, ...) that took ints for x,y + + /** + * Legacy version of drawBitmap(int[] colors, ...) that took ints for x,y + * + * @deprecated Usage with a {@link #isHardwareAccelerated() hardware accelerated} canvas + * requires an internal copy of color buffer contents every time this method is called. Using a + * Bitmap avoids this copy, and allows the application to more explicitly control the lifetime + * and copies of pixel data. */ + @Deprecated public void drawBitmap(int[] colors, int offset, int stride, int x, int y, int width, int height, boolean hasAlpha, Paint paint) { // call through to the common float version drawBitmap(colors, offset, stride, (float)x, (float)y, width, height, hasAlpha, paint); } - + /** * Draw the bitmap using the specified matrix. * |