[go: nahoru, domu]

remove call to setBitmapDevice (deprecated).
Review URL: https://codereview.appspot.com/6569070

git-svn-id: http://skia.googlecode.com/svn/trunk/src@5715 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkPicture.cpp b/core/SkPicture.cpp
index 7e8b371..b3d3751 100644
--- a/core/SkPicture.cpp
+++ b/core/SkPicture.cpp
@@ -13,6 +13,7 @@
 
 #include "SkCanvas.h"
 #include "SkChunkAlloc.h"
+#include "SkDevice.h"
 #include "SkPicture.h"
 #include "SkRegion.h"
 #include "SkStream.h"
@@ -185,25 +186,26 @@
         fRecord = NULL;
     }
 
+    SkBitmap bm;
+    bm.setConfig(SkBitmap::kNo_Config, width, height);
+    SkAutoTUnref<SkDevice> dev(SkNEW_ARGS(SkDevice, (bm)));
+
     if (recordingFlags & kOptimizeForClippedPlayback_RecordingFlag) {
         SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(width),
                                            SkIntToScalar(height));
         SkRTree* tree = SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren,
                                         aspectRatio);
         SkASSERT(NULL != tree);
-        fRecord = SkNEW_ARGS(SkBBoxHierarchyRecord, (recordingFlags, tree));
+        fRecord = SkNEW_ARGS(SkBBoxHierarchyRecord, (recordingFlags, tree, dev));
         tree->unref();
     } else {
-        fRecord = SkNEW_ARGS(SkPictureRecord, (recordingFlags));
+        fRecord = SkNEW_ARGS(SkPictureRecord, (recordingFlags, dev));
     }
+    fRecord->beginRecording();
 
     fWidth = width;
     fHeight = height;
 
-    SkBitmap bm;
-    bm.setConfig(SkBitmap::kNo_Config, width, height);
-    fRecord->setBitmapDevice(bm);
-
     return fRecord;
 }