summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Raph Levien <raph@google.com> 2014-07-30 21:03:18 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2014-07-30 20:38:44 +0000
commited1e6962bafb0c295cf8bdee778ee4af8ec01171 (patch)
treebd6b4c30589d2478d0a4a4b3ab0dd424ea34e50b
parente47df8466be991b187f445c8cf811891271051bf (diff)
parentfebccd05f2e9ad2422d74fcf33ec9bc900ae83bb (diff)
Merge "Bump refcount of canvas created for Picture" into lmp-dev
-rw-r--r--core/jni/android/graphics/Picture.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/jni/android/graphics/Picture.cpp b/core/jni/android/graphics/Picture.cpp
index d214575be7f3..630999cf4c1d 100644
--- a/core/jni/android/graphics/Picture.cpp
+++ b/core/jni/android/graphics/Picture.cpp
@@ -42,6 +42,10 @@ Canvas* Picture::beginRecording(int width, int height) {
mWidth = width;
mHeight = height;
SkCanvas* canvas = mRecorder->beginRecording(width, height, NULL, 0);
+ // the java side will wrap this guy in a Canvas.java, which will call
+ // unref in its finalizer, so we have to ref it here, so that both that
+ // Canvas.java and our picture can both be owners
+ canvas->ref();
return Canvas::create_canvas(canvas);
}