summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorFlorin Malita <fmalita@google.com>2014-05-07 22:44:46 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-07 22:44:47 +0000
commit531fecca1c55d2f60977a57f5eb546d4d202fb97 (patch)
treebeedf9c8ed5774c9d25cb4445a17de07ac150ace /graphics
parentdfad99ad9fd5953b9d726715c40197a3e70e7dd0 (diff)
parentc677675e9c465dc1de21ecf2e0421835c7eb55b4 (diff)
downloadframeworks_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.java2
-rw-r--r--graphics/java/android/graphics/Canvas.java6
-rw-r--r--graphics/java/android/graphics/NinePatch.java4
-rw-r--r--graphics/java/android/graphics/Picture.java2
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);
}
/**