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

Side by Side Diff: gm/mixedxfermodes.cpp

Issue 281383013: skiagm::make_isize -> SkISize::Make (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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/matriximagefilter.cpp ('k') | gm/modecolorfilters.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 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 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 "gm.h" 8 #include "gm.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
11 #include "SkShader.h" 11 #include "SkShader.h"
12 #include "SkXfermode.h" 12 #include "SkXfermode.h"
13 13
14 namespace skiagm { 14 namespace skiagm {
15 15
16 /** 16 /**
17 * Renders overlapping shapes with random SkXfermode::Modes against a checkerboa rd. 17 * Renders overlapping shapes with random SkXfermode::Modes against a checkerboa rd.
18 */ 18 */
19 class MixedXfermodesGM : public GM { 19 class MixedXfermodesGM : public GM {
20 public: 20 public:
21 MixedXfermodesGM() { 21 MixedXfermodesGM() {
22 } 22 }
23 23
24 protected: 24 protected:
25 virtual SkString onShortName() SK_OVERRIDE { 25 virtual SkString onShortName() SK_OVERRIDE {
26 return SkString("mixed_xfermodes"); 26 return SkString("mixed_xfermodes");
27 } 27 }
28 28
29 virtual SkISize onISize() SK_OVERRIDE { 29 virtual SkISize onISize() SK_OVERRIDE {
30 return make_isize(790, 640); 30 return SkISize::Make(790, 640);
31 } 31 }
32 32
33 void drawShape(SkCanvas* canvas, 33 void drawShape(SkCanvas* canvas,
34 const SkPaint& paint, 34 const SkPaint& paint,
35 SkRandom* random) { 35 SkRandom* random) {
36 static const SkRect kRect = SkRect::MakeXYWH(SkIntToScalar(-50), SkIntTo Scalar(-50), 36 static const SkRect kRect = SkRect::MakeXYWH(SkIntToScalar(-50), SkIntTo Scalar(-50),
37 SkIntToScalar(75), SkIntToS calar(105)); 37 SkIntToScalar(75), SkIntToS calar(105));
38 int shape = random->nextULessThan(5); 38 int shape = random->nextULessThan(5);
39 switch (shape) { 39 switch (shape) {
40 case 0: 40 case 0:
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 SkPath fConvexPath; 136 SkPath fConvexPath;
137 typedef GM INHERITED; 137 typedef GM INHERITED;
138 }; 138 };
139 139
140 ////////////////////////////////////////////////////////////////////////////// 140 //////////////////////////////////////////////////////////////////////////////
141 141
142 static GM* MyFactory(void*) { return new MixedXfermodesGM; } 142 static GM* MyFactory(void*) { return new MixedXfermodesGM; }
143 static GMRegistry reg(MyFactory); 143 static GMRegistry reg(MyFactory);
144 144
145 } 145 }
OLDNEW
« no previous file with comments | « gm/matriximagefilter.cpp ('k') | gm/modecolorfilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698