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

Side by Side Diff: gm/picture.cpp

Issue 953383002: fuzzer fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix up width and height in initializer Created 5 years, 9 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
« no previous file with comments | « gm/complexclip2.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 2014 Google Inc. 2 * Copyright 2014 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 "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkPictureRecorder.h" 10 #include "SkPictureRecorder.h"
(...skipping 21 matching lines...) Expand all
32 paint.setXfermodeMode(SkXfermode::kPlus_Mode); 32 paint.setXfermodeMode(SkXfermode::kPlus_Mode);
33 canvas->drawRect(SkRect::MakeXYWH(25, 25, 50, 50), paint); 33 canvas->drawRect(SkRect::MakeXYWH(25, 25, 50, 50), paint);
34 34
35 return rec.endRecording(); 35 return rec.endRecording();
36 } 36 }
37 37
38 // Exercise the optional arguments to drawPicture 38 // Exercise the optional arguments to drawPicture
39 // 39 //
40 class PictureGM : public skiagm::GM { 40 class PictureGM : public skiagm::GM {
41 public: 41 public:
42 PictureGM() : fPicture(make_picture()) {} 42 PictureGM()
43 : fPicture(NULL)
44 {}
43 45
44 protected: 46 protected:
47 void onOnceBeforeDraw() SK_OVERRIDE {
48 fPicture.reset(make_picture());
49 }
50
45 SkString onShortName() SK_OVERRIDE { 51 SkString onShortName() SK_OVERRIDE {
46 return SkString("pictures"); 52 return SkString("pictures");
47 } 53 }
48 54
49 SkISize onISize() SK_OVERRIDE { 55 SkISize onISize() SK_OVERRIDE {
50 return SkISize::Make(450, 120); 56 return SkISize::Make(450, 120);
51 } 57 }
52 58
53 void onDraw(SkCanvas* canvas) SK_OVERRIDE { 59 void onDraw(SkCanvas* canvas) SK_OVERRIDE {
54 canvas->translate(10, 10); 60 canvas->translate(10, 10);
(...skipping 14 matching lines...) Expand all
69 canvas->drawPicture(fPicture, &matrix, &paint); 75 canvas->drawPicture(fPicture, &matrix, &paint);
70 } 76 }
71 77
72 private: 78 private:
73 SkAutoTUnref<SkPicture> fPicture; 79 SkAutoTUnref<SkPicture> fPicture;
74 80
75 typedef skiagm::GM INHERITED; 81 typedef skiagm::GM INHERITED;
76 }; 82 };
77 83
78 DEF_GM( return SkNEW(PictureGM); ) 84 DEF_GM( return SkNEW(PictureGM); )
OLDNEW
« no previous file with comments | « gm/complexclip2.cpp ('k') | gm/pictureshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698