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

Side by Side Diff: samplecode/SampleAll.cpp

Issue 540963002: Change SkPicture::draw to playback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 } 315 }
316 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); 316 SkAutoTUnref<SkPicture> picture(recorder.endRecording());
317 317
318 canvas->translate(0, SkIntToScalar(120)); 318 canvas->translate(0, SkIntToScalar(120));
319 319
320 SkRect clip; 320 SkRect clip;
321 clip.set(0, 0, SkIntToScalar(160), SkIntToScalar(160)); 321 clip.set(0, 0, SkIntToScalar(160), SkIntToScalar(160));
322 do { 322 do {
323 canvas->save(); 323 canvas->save();
324 canvas->clipRect(clip); 324 canvas->clipRect(clip);
325 picture->draw(canvas); 325 picture->playback(canvas);
326 canvas->restore(); 326 canvas->restore();
327 if (clip.fRight < SkIntToScalar(320)) 327 if (clip.fRight < SkIntToScalar(320))
328 clip.offset(SkIntToScalar(160), 0); 328 clip.offset(SkIntToScalar(160), 0);
329 else if (clip.fBottom < SkIntToScalar(480)) 329 else if (clip.fBottom < SkIntToScalar(480))
330 clip.offset(-SkIntToScalar(320), SkIntToScalar(160)); 330 clip.offset(-SkIntToScalar(320), SkIntToScalar(160));
331 else 331 else
332 break; 332 break;
333 } while (true); 333 } while (true);
334 } 334 }
335 } 335 }
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 private: 595 private:
596 SkPoint fClickPt; 596 SkPoint fClickPt;
597 SkBitmap fBug, fTb, fTx; 597 SkBitmap fBug, fTb, fTx;
598 typedef SampleView INHERITED; 598 typedef SampleView INHERITED;
599 }; 599 };
600 600
601 ////////////////////////////////////////////////////////////////////////////// 601 //////////////////////////////////////////////////////////////////////////////
602 602
603 static SkView* MyFactory() { return new DemoView; } 603 static SkView* MyFactory() { return new DemoView; }
604 static SkViewRegister reg(MyFactory); 604 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698