From 5fb2ce38b3dcb8e60e9e112df23c9d42456d7069 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Thu, 17 Apr 2014 23:35:06 +0000 Subject: 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 --- bench/PicturePlaybackBench.cpp | 2 +- bench/PictureRecordBench.cpp | 6 +++--- bench/benchmain.cpp | 12 ++++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'bench') 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 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 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 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(); -- cgit v1.2.3