Staged removal of SkPicture-derived classes

This CL removes the SkPicture-derived classes (with a flag to keeps clients working). In the process it also lightens the recording factory function so it is no longer ref counted).

The only interesting bits are in SkPicture* and Sk*Picture.*

R=reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/238273012

git-svn-id: http://skia.googlecode.com/svn/trunk@14251 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 79c6c36..4f4116b 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -308,7 +308,7 @@
         {
             SkPictureRecorder recorder;
             {
-                SkCanvas* record = recorder.beginRecording(320, 480);
+                SkCanvas* record = recorder.beginRecording(320, 480, NULL, 0);
                 this->drawPicture(record, 120);
             }
             SkAutoTUnref<SkPicture> picture(recorder.endRecording());
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 5020ec2..67be5be 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1376,7 +1376,7 @@
         pdfDevice->unref();
         canvas = fPdfCanvas;
     } else if (kPicture_DeviceType == fDeviceType) {
-        canvas = fRecorder.beginRecording(9999, 9999);
+        canvas = fRecorder.beginRecording(9999, 9999, NULL, 0);
     } else {
 #if SK_SUPPORT_GPU
         if (kNullGPU_DeviceType != fDeviceType)
diff --git a/samplecode/SamplePictFile.cpp b/samplecode/SamplePictFile.cpp
index 11bd1f0..59a7f4b 100644
--- a/samplecode/SamplePictFile.cpp
+++ b/samplecode/SamplePictFile.cpp
@@ -129,7 +129,7 @@
         if (SkImageDecoder::DecodeFile(path, &bm)) {
             bm.setImmutable();
             SkPictureRecorder recorder;
-            SkCanvas* can = recorder.beginRecording(bm.width(), bm.height());
+            SkCanvas* can = recorder.beginRecording(bm.width(), bm.height(), NULL, 0);
             can->drawBitmap(bm, 0, 0, NULL);
             pic.reset(recorder.endRecording());
         } else {
@@ -147,7 +147,7 @@
             }
             if (false) { // re-record
                 SkPictureRecorder recorder;
-                pic->draw(recorder.beginRecording(pic->width(), pic->height()));
+                pic->draw(recorder.beginRecording(pic->width(), pic->height(), NULL, 0));
                 SkAutoTUnref<SkPicture> p2(recorder.endRecording());
 
                 SkString path2(path);
@@ -161,32 +161,32 @@
             return NULL;
         }
 
-        SkAutoTUnref<SkPictureFactory> factory;
+        SkAutoTDelete<SkBBHFactory> factory;
         switch (bbox) {
         case kNo_BBoxType:
             // no bbox playback necessary
             return pic.detach();
         case kRTree_BBoxType:
-            factory.reset(SkNEW(SkRTreePictureFactory));
+            factory.reset(SkNEW(SkRTreeFactory));
             break;
         case kQuadTree_BBoxType:
-            factory.reset(SkNEW(SkQuadTreePictureFactory));
+            factory.reset(SkNEW(SkQuadTreeFactory));
             break;
         case kTileGrid_BBoxType: {
             SkASSERT(!fTileSize.isEmpty());
-            SkTileGridPicture::TileGridInfo gridInfo;
+            SkTileGridFactory::TileGridInfo gridInfo;
             gridInfo.fMargin = SkISize::Make(0, 0);
             gridInfo.fOffset = SkIPoint::Make(0, 0);
             gridInfo.fTileInterval = fTileSize.toRound();
-            factory.reset(SkNEW_ARGS(SkTileGridPictureFactory, (gridInfo)));
+            factory.reset(SkNEW_ARGS(SkTileGridFactory, (gridInfo)));
             break;
         }
         default:
             SkASSERT(false);
         }
 
-        SkPictureRecorder recorder(factory);
-        pic->draw(recorder.beginRecording(pic->width(), pic->height()));
+        SkPictureRecorder recorder;
+        pic->draw(recorder.beginRecording(pic->width(), pic->height(), factory.get(), 0));
         return recorder.endRecording();
     }
 
diff --git a/samplecode/SamplePicture.cpp b/samplecode/SamplePicture.cpp
index 51e8f0b..202e172 100644
--- a/samplecode/SamplePicture.cpp
+++ b/samplecode/SamplePicture.cpp
@@ -63,10 +63,10 @@
 
         SkPictureRecorder recorder;
 
-        recorder.beginRecording(100, 100);
+        recorder.beginRecording(100, 100, NULL, 0);
         fSubPicture = recorder.endRecording();
 
-        SkCanvas* canvas = recorder.beginRecording(100, 100);
+        SkCanvas* canvas = recorder.beginRecording(100, 100, NULL, 0);
         SkPaint paint;
         paint.setAntiAlias(true);
 
@@ -132,7 +132,7 @@
         this->drawSomething(canvas);
 
         SkPictureRecorder recorder;
-        this->drawSomething(recorder.beginRecording(100, 100));
+        this->drawSomething(recorder.beginRecording(100, 100, NULL, 0));
         SkAutoTUnref<SkPicture> pict(recorder.endRecording());
 
         canvas->save();
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp
index d267012..ffae6a4 100644
--- a/samplecode/SampleTiling.cpp
+++ b/samplecode/SampleTiling.cpp
@@ -106,7 +106,7 @@
         SkPictureRecorder recorder;
         SkCanvas* textCanvas = NULL;
         if (NULL == fTextPicture) {
-            textCanvas = recorder.beginRecording(1000, 1000);
+            textCanvas = recorder.beginRecording(1000, 1000, NULL, 0);
         }
 
         if (NULL != textCanvas) {