Merge "Ensure that a canvas is always backed by some form of SkDevice." into jb-mr2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c37b63d6e7
@@ -77,7 +77,14 @@ public:
|
||||
}
|
||||
|
||||
static SkCanvas* initRaster(JNIEnv* env, jobject, SkBitmap* bitmap) {
|
||||
return bitmap ? new SkCanvas(*bitmap) : new SkCanvas;
|
||||
if (bitmap) {
|
||||
return new SkCanvas(*bitmap);
|
||||
} else {
|
||||
// Create an empty bitmap device to prevent callers from crashing
|
||||
// if they attempt to draw into this canvas.
|
||||
SkBitmap emptyBitmap;
|
||||
return new SkCanvas(emptyBitmap);
|
||||
}
|
||||
}
|
||||
|
||||
static void copyCanvasState(JNIEnv* env, jobject clazz,
|
||||
|
||||
Reference in New Issue
Block a user