Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: samplecode/SampleAll.cpp

Issue 214953003: split SkPictureRecorder out of SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: update to ToT (again) Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: samplecode/SampleAll.cpp
===================================================================
--- samplecode/SampleAll.cpp (revision 14159)
+++ samplecode/SampleAll.cpp (working copy)
@@ -302,13 +302,17 @@
virtual void onDrawContent(SkCanvas* canvas) {
canvas->save();
- drawPicture(canvas, 0);
+ this->drawPicture(canvas, 0);
canvas->restore();
{
- SkPicture picture;
- SkCanvas* record = picture.beginRecording(320, 480);
- drawPicture(record, 120);
+ SkPictureRecorder recorder;
+ {
+ SkCanvas* record = recorder.beginRecording(320, 480);
+ this->drawPicture(record, 120);
+ }
+ SkAutoTUnref<SkPicture> picture(recorder.endRecording());
+
canvas->translate(0, SkIntToScalar(120));
SkRect clip;
@@ -316,7 +320,7 @@
do {
canvas->save();
canvas->clipRect(clip);
- picture.draw(canvas);
+ picture->draw(canvas);
canvas->restore();
if (clip.fRight < SkIntToScalar(320))
clip.offset(SkIntToScalar(160), 0);

Powered by Google App Engine
This is Rietveld 408576698