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

Side by Side Diff: gm/pictureimagefilter.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/pathopsskpclip.cpp ('k') | gm/pictureshader.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 9
10 #include "SkPictureImageFilter.h" 10 #include "SkPictureImageFilter.h"
11 11
12 // This GM exercises the SkPictureImageFilter ImageFilter class. 12 // This GM exercises the SkPictureImageFilter ImageFilter class.
13 13
14 class PictureImageFilterGM : public skiagm::GM { 14 class PictureImageFilterGM : public skiagm::GM {
15 public: 15 public:
16 PictureImageFilterGM() { 16 PictureImageFilterGM() {
17 } 17 }
18 18
19 protected: 19 protected:
20 virtual SkString onShortName() SK_OVERRIDE { 20 virtual SkString onShortName() SK_OVERRIDE {
21 return SkString("pictureimagefilter"); 21 return SkString("pictureimagefilter");
22 } 22 }
23 23
24 void makePicture() { 24 void makePicture() {
25 SkPictureRecorder recorder; 25 SkPictureRecorder recorder;
26 SkCanvas* canvas = recorder.beginRecording(100, 100); 26 SkCanvas* canvas = recorder.beginRecording(100, 100, NULL, 0);
27 canvas->clear(0x00000000); 27 canvas->clear(0x00000000);
28 SkPaint paint; 28 SkPaint paint;
29 paint.setAntiAlias(true); 29 paint.setAntiAlias(true);
30 paint.setColor(0xFFFFFFFF); 30 paint.setColor(0xFFFFFFFF);
31 paint.setTextSize(SkIntToScalar(96)); 31 paint.setTextSize(SkIntToScalar(96));
32 const char* str = "e"; 32 const char* str = "e";
33 canvas->drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint); 33 canvas->drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
34 fPicture.reset(recorder.endRecording()); 34 fPicture.reset(recorder.endRecording());
35 } 35 }
36 36
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 private: 85 private:
86 SkAutoTUnref<SkPicture> fPicture; 86 SkAutoTUnref<SkPicture> fPicture;
87 typedef GM INHERITED; 87 typedef GM INHERITED;
88 }; 88 };
89 89
90 /////////////////////////////////////////////////////////////////////////////// 90 ///////////////////////////////////////////////////////////////////////////////
91 91
92 DEF_GM( return new PictureImageFilterGM; ) 92 DEF_GM( return new PictureImageFilterGM; )
OLDNEW
« no previous file with comments | « gm/pathopsskpclip.cpp ('k') | gm/pictureshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698