aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
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 /bench
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 'bench')
-rw-r--r--bench/PicturePlaybackBench.cpp2
-rw-r--r--bench/PictureRecordBench.cpp6
-rw-r--r--bench/benchmain.cpp12
3 files changed, 12 insertions, 8 deletions
diff --git a/bench/PicturePlaybackBench.cpp b/bench/PicturePlaybackBench.cpp
index fa693c2468..436b652e8c 100644
--- a/bench/PicturePlaybackBench.cpp
+++ b/bench/PicturePlaybackBench.cpp
@@ -38,7 +38,7 @@ protected:
virtual void onDraw(const int loops, SkCanvas* canvas) {
SkPictureRecorder recorder;
- SkCanvas* pCanvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
+ SkCanvas* pCanvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT, NULL, 0);
this->recordCanvas(pCanvas);
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
diff --git a/bench/PictureRecordBench.cpp b/bench/PictureRecordBench.cpp
index 4c82fe2881..62f02b6c2b 100644
--- a/bench/PictureRecordBench.cpp
+++ b/bench/PictureRecordBench.cpp
@@ -59,7 +59,7 @@ protected:
for (int i = 0; i < loops; i++) {
if (0 == i % kMaxLoopsPerCanvas) {
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
+ canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT, NULL, 0);
}
SkColor color = SK_ColorYELLOW + (i % 255);
@@ -125,7 +125,7 @@ protected:
for (int i = 0; i < loops; i++) {
if (0 == i % kMaxLoopsPerCanvas) {
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
+ canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT, NULL, 0);
}
paint.setColor(rand.nextU());
canvas->drawPaint(paint);
@@ -159,7 +159,7 @@ public:
protected:
virtual void onDraw(const int loops, SkCanvas*) SK_OVERRIDE {
SkPictureRecorder recorder;
- SkCanvas* canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT);
+ SkCanvas* canvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT, NULL, 0);
for (int i = 0; i < loops; i++) {
canvas->drawPaint(fPaint[i % ObjCount]);
}
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index ef83d192e5..8b824f33cf 100644
--- a/bench/benchmain.cpp
+++ b/bench/benchmain.cpp
@@ -506,13 +506,16 @@ int tool_main(int argc, char** argv) {
canvas.reset(SkDeferredCanvas::Create(surface.get()));
break;
case kRecord_BenchMode:
- canvas.reset(SkRef(recorderTo.beginRecording(dim.fX, dim.fY, kRecordFlags)));
+ canvas.reset(SkRef(recorderTo.beginRecording(dim.fX, dim.fY,
+ NULL, kRecordFlags)));
break;
case kPictureRecord_BenchMode: {
SkPictureRecorder recorderFrom;
- bench->draw(1, recorderFrom.beginRecording(dim.fX, dim.fY, kRecordFlags));
+ bench->draw(1, recorderFrom.beginRecording(dim.fX, dim.fY,
+ NULL, kRecordFlags));
recordFrom.reset(recorderFrom.endRecording());
- canvas.reset(SkRef(recorderTo.beginRecording(dim.fX, dim.fY, kRecordFlags)));
+ canvas.reset(SkRef(recorderTo.beginRecording(dim.fX, dim.fY,
+ NULL, kRecordFlags)));
break;
}
case kNormal_BenchMode:
@@ -578,7 +581,8 @@ int tool_main(int argc, char** argv) {
if ((benchMode == kRecord_BenchMode || benchMode == kPictureRecord_BenchMode)) {
// Clear the recorded commands so that they do not accumulate.
- canvas.reset(SkRef(recorderTo.beginRecording(dim.fX, dim.fY, kRecordFlags)));
+ canvas.reset(SkRef(recorderTo.beginRecording(dim.fX, dim.fY,
+ NULL, kRecordFlags)));
}
timer.start();