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

Side by Side Diff: gm/selftest.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/samplerstress.cpp ('k') | gm/shaderbounds.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 /** 8 /**
9 * Pathologically simple drawing tests, designed to generate consistent 9 * Pathologically simple drawing tests, designed to generate consistent
10 * output images across platforms for gm/tests/run.sh 10 * output images across platforms for gm/tests/run.sh
11 */ 11 */
12 12
13 #include "gm.h" 13 #include "gm.h"
14 #include "SkCanvas.h" 14 #include "SkCanvas.h"
15 #include "SkPaint.h" 15 #include "SkPaint.h"
16 16
17 class SelfTestGM : public skiagm::GM { 17 class SelfTestGM : public skiagm::GM {
18 public: 18 public:
19 SelfTestGM(const char name[], SkColor color, uint32_t flags) : 19 SelfTestGM(const char name[], SkColor color, uint32_t flags) :
20 fName(name), fColor(color), fFlags(flags) {} 20 fName(name), fColor(color), fFlags(flags) {}
21 const static int kWidth = 300; 21 const static int kWidth = 300;
22 const static int kHeight = 200; 22 const static int kHeight = 200;
23 23
24 protected: 24 protected:
25 SkString onShortName() { 25 SkString onShortName() {
26 return fName; 26 return fName;
27 } 27 }
28 28
29 SkISize onISize() { return skiagm::make_isize(kWidth, kHeight); } 29 SkISize onISize() { return SkISize::Make(kWidth, kHeight); }
30 30
31 virtual void onDraw(SkCanvas* canvas) { 31 virtual void onDraw(SkCanvas* canvas) {
32 SkPaint paint; 32 SkPaint paint;
33 paint.setStyle(SkPaint::kFill_Style); 33 paint.setStyle(SkPaint::kFill_Style);
34 paint.setColor(fColor); 34 paint.setColor(fColor);
35 canvas->drawRectCoords(0, 0, SkIntToScalar(kWidth), SkIntToScalar(kHeigh t), paint); 35 canvas->drawRectCoords(0, 0, SkIntToScalar(kWidth), SkIntToScalar(kHeigh t), paint);
36 } 36 }
37 37
38 virtual uint32_t onGetFlags() const { return fFlags; } 38 virtual uint32_t onGetFlags() const { return fFlags; }
39 39
(...skipping 13 matching lines...) Expand all
53 53
54 static skiagm::GM* F1(void*) { 54 static skiagm::GM* F1(void*) {
55 return new SelfTestGM("selftest1", kTranslucentGreen, 0); 55 return new SelfTestGM("selftest1", kTranslucentGreen, 0);
56 } 56 }
57 static skiagm::GM* F2(void*) { 57 static skiagm::GM* F2(void*) {
58 return new SelfTestGM("selftest2", kTranslucentBlue, skiagm::GM::kSkipPipe_ Flag); 58 return new SelfTestGM("selftest2", kTranslucentBlue, skiagm::GM::kSkipPipe_ Flag);
59 } 59 }
60 60
61 static skiagm::GMRegistry gR1(F1); 61 static skiagm::GMRegistry gR1(F1);
62 static skiagm::GMRegistry gR2(F2); 62 static skiagm::GMRegistry gR2(F2);
OLDNEW
« no previous file with comments | « gm/samplerstress.cpp ('k') | gm/shaderbounds.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698