aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-17 23:35:06 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-17 23:35:06 +0000
commit5fb2ce38b3dcb8e60e9e112df23c9d42456d7069 (patch)
tree521360e38040e661934a07f7fe1c2c49f520940b /samplecode
parentd24a130c1217873d0744d35722005516a0acb774 (diff)
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
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleAll.cpp2
-rw-r--r--samplecode/SampleApp.cpp2
-rw-r--r--samplecode/SamplePictFile.cpp18
-rw-r--r--samplecode/SamplePicture.cpp6
-rw-r--r--samplecode/SampleTiling.cpp2
5 files changed, 15 insertions, 15 deletions
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 79c6c3658e..4f4116b3b0 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -308,7 +308,7 @@ protected:
{
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 5020ec2b4c..67be5be335 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1376,7 +1376,7 @@ SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) {
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 11bd1f057b..59a7f4b55a 100644
--- a/samplecode/SamplePictFile.cpp
+++ b/samplecode/SamplePictFile.cpp
@@ -129,7 +129,7 @@ private:
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 @@ private:
}
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 @@ private:
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 51e8f0b67a..202e172234 100644
--- a/samplecode/SamplePicture.cpp
+++ b/samplecode/SamplePicture.cpp
@@ -63,10 +63,10 @@ public:
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 @@ protected:
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 d26701273e..ffae6a4d94 100644
--- a/samplecode/SampleTiling.cpp
+++ b/samplecode/SampleTiling.cpp
@@ -106,7 +106,7 @@ protected:
SkPictureRecorder recorder;
SkCanvas* textCanvas = NULL;
if (NULL == fTextPicture) {
- textCanvas = recorder.beginRecording(1000, 1000);
+ textCanvas = recorder.beginRecording(1000, 1000, NULL, 0);
}
if (NULL != textCanvas) {