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

Side by Side Diff: gm/pathopsskpclip.cpp

Issue 238273012: Staged removal of SkPicture-derived classes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: have SkPicture only friend SkPictureRecorder once 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gm/optimizations.cpp ('k') | gm/pictureimagefilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 15 matching lines...) Expand all
26 virtual SkString onShortName() SK_OVERRIDE { 26 virtual SkString onShortName() SK_OVERRIDE {
27 return SkString("pathopsskpclip"); 27 return SkString("pathopsskpclip");
28 } 28 }
29 29
30 virtual SkISize onISize() SK_OVERRIDE { 30 virtual SkISize onISize() SK_OVERRIDE {
31 return make_isize(1200, 900); 31 return make_isize(1200, 900);
32 } 32 }
33 33
34 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 34 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
35 SkPictureRecorder recorder; 35 SkPictureRecorder recorder;
36 SkCanvas* rec = recorder.beginRecording(1200, 900); 36 SkCanvas* rec = recorder.beginRecording(1200, 900, NULL, 0);
37 SkPath p; 37 SkPath p;
38 SkRect r = { 38 SkRect r = {
39 SkIntToScalar(100), 39 SkIntToScalar(100),
40 SkIntToScalar(200), 40 SkIntToScalar(200),
41 SkIntToScalar(400), 41 SkIntToScalar(400),
42 SkIntToScalar(700) 42 SkIntToScalar(700)
43 }; 43 };
44 p.addRoundRect(r, SkIntToScalar(50), SkIntToScalar(50)); 44 p.addRoundRect(r, SkIntToScalar(50), SkIntToScalar(50));
45 rec->clipPath(p, SkRegion::kIntersect_Op, true); 45 rec->clipPath(p, SkRegion::kIntersect_Op, true);
46 rec->translate(SkIntToScalar(250), SkIntToScalar(250)); 46 rec->translate(SkIntToScalar(250), SkIntToScalar(250));
(...skipping 16 matching lines...) Expand all
63 private: 63 private:
64 typedef GM INHERITED; 64 typedef GM INHERITED;
65 }; 65 };
66 66
67 ////////////////////////////////////////////////////////////////////////////// 67 //////////////////////////////////////////////////////////////////////////////
68 68
69 static GM* MyFactory(void*) { return new PathOpsSkpClipGM; } 69 static GM* MyFactory(void*) { return new PathOpsSkpClipGM; }
70 static GMRegistry reg(MyFactory); 70 static GMRegistry reg(MyFactory);
71 71
72 } 72 }
OLDNEW
« no previous file with comments | « gm/optimizations.cpp ('k') | gm/pictureimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698