diff options
author | Florin Malita <fmalita@google.com> | 2014-05-07 22:44:46 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-07 22:44:47 +0000 |
commit | 531fecca1c55d2f60977a57f5eb546d4d202fb97 (patch) | |
tree | beedf9c8ed5774c9d25cb4445a17de07ac150ace /graphics | |
parent | dfad99ad9fd5953b9d726715c40197a3e70e7dd0 (diff) | |
parent | c677675e9c465dc1de21ecf2e0421835c7eb55b4 (diff) | |
download | frameworks_base-531fecca1c55d2f60977a57f5eb546d4d202fb97.zip frameworks_base-531fecca1c55d2f60977a57f5eb546d4d202fb97.tar.gz frameworks_base-531fecca1c55d2f60977a57f5eb546d4d202fb97.tar.bz2 |
Merge "Encapsulate Canvas.mNativeCanvas"
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/Camera.java | 2 | ||||
-rw-r--r-- | graphics/java/android/graphics/Canvas.java | 6 | ||||
-rw-r--r-- | graphics/java/android/graphics/NinePatch.java | 4 | ||||
-rw-r--r-- | graphics/java/android/graphics/Picture.java | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/graphics/java/android/graphics/Camera.java b/graphics/java/android/graphics/Camera.java index c263a84..a40085b 100644 --- a/graphics/java/android/graphics/Camera.java +++ b/graphics/java/android/graphics/Camera.java @@ -154,7 +154,7 @@ public class Camera { getMatrix(mMatrix); canvas.concat(mMatrix); } else { - nativeApplyToCanvas(canvas.mNativeCanvas); + nativeApplyToCanvas(canvas.getNativeCanvas()); } } diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java index ae3eae1..5b18623 100644 --- a/graphics/java/android/graphics/Canvas.java +++ b/graphics/java/android/graphics/Canvas.java @@ -39,8 +39,12 @@ import javax.microedition.khronos.opengles.GL; public class Canvas { // assigned in constructors or setBitmap, freed in finalizer + private long mNativeCanvas; + /** @hide */ - public long mNativeCanvas; + public long getNativeCanvas() { + return mNativeCanvas; + } // may be null private Bitmap mBitmap; diff --git a/graphics/java/android/graphics/NinePatch.java b/graphics/java/android/graphics/NinePatch.java index 69089b1..6ff5f4f 100644 --- a/graphics/java/android/graphics/NinePatch.java +++ b/graphics/java/android/graphics/NinePatch.java @@ -164,12 +164,12 @@ public class NinePatch { } void drawSoftware(Canvas canvas, RectF location, Paint paint) { - nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mNativeChunk, + nativeDraw(canvas.getNativeCanvas(), location, mBitmap.ni(), mNativeChunk, paint != null ? paint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } void drawSoftware(Canvas canvas, Rect location, Paint paint) { - nativeDraw(canvas.mNativeCanvas, location, mBitmap.ni(), mNativeChunk, + nativeDraw(canvas.getNativeCanvas(), location, mBitmap.ni(), mNativeChunk, paint != null ? paint.mNativePaint : 0, canvas.mDensity, mBitmap.mDensity); } diff --git a/graphics/java/android/graphics/Picture.java b/graphics/java/android/graphics/Picture.java index 25188e0..a16c099 100644 --- a/graphics/java/android/graphics/Picture.java +++ b/graphics/java/android/graphics/Picture.java @@ -107,7 +107,7 @@ public class Picture { if (mRecordingCanvas != null) { endRecording(); } - nativeDraw(canvas.mNativeCanvas, mNativePicture); + nativeDraw(canvas.getNativeCanvas(), mNativePicture); } /** |