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

Side by Side Diff: gm/dashing.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/copyTo4444.cpp ('k') | gm/degeneratesegments.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 2012 Google Inc. 2 * Copyright 2012 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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 28 matching lines...) Expand all
39 39
40 protected: 40 protected:
41 virtual uint32_t onGetFlags() const SK_OVERRIDE { 41 virtual uint32_t onGetFlags() const SK_OVERRIDE {
42 return kSkipTiled_Flag; 42 return kSkipTiled_Flag;
43 } 43 }
44 44
45 SkString onShortName() { 45 SkString onShortName() {
46 return SkString("dashing"); 46 return SkString("dashing");
47 } 47 }
48 48
49 SkISize onISize() { return skiagm::make_isize(640, 300); } 49 SkISize onISize() { return SkISize::Make(640, 300); }
50 50
51 virtual void onDraw(SkCanvas* canvas) { 51 virtual void onDraw(SkCanvas* canvas) {
52 static const struct { 52 static const struct {
53 int fOnInterval; 53 int fOnInterval;
54 int fOffInterval; 54 int fOffInterval;
55 } gData[] = { 55 } gData[] = {
56 { 1, 1 }, 56 { 1, 1 },
57 { 4, 1 }, 57 { 4, 1 },
58 }; 58 };
59 59
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 protected: 126 protected:
127 virtual uint32_t onGetFlags() const SK_OVERRIDE { 127 virtual uint32_t onGetFlags() const SK_OVERRIDE {
128 return kSkipTiled_Flag; 128 return kSkipTiled_Flag;
129 } 129 }
130 130
131 SkString onShortName() { 131 SkString onShortName() {
132 return SkString("dashing2"); 132 return SkString("dashing2");
133 } 133 }
134 134
135 SkISize onISize() { return skiagm::make_isize(640, 480); } 135 SkISize onISize() { return SkISize::Make(640, 480); }
136 136
137 virtual void onDraw(SkCanvas* canvas) { 137 virtual void onDraw(SkCanvas* canvas) {
138 static const int gIntervals[] = { 138 static const int gIntervals[] = {
139 3, // 3 dashes: each count [0] followed by intervals [1..count] 139 3, // 3 dashes: each count [0] followed by intervals [1..count]
140 2, 10, 10, 140 2, 10, 10,
141 4, 20, 5, 5, 5, 141 4, 20, 5, 5, 5,
142 2, 2, 2 142 2, 2, 2
143 }; 143 };
144 144
145 void (*gProc[])(SkPath*, const SkRect&) = { 145 void (*gProc[])(SkPath*, const SkRect&) = {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 protected: 188 protected:
189 virtual uint32_t onGetFlags() const SK_OVERRIDE { 189 virtual uint32_t onGetFlags() const SK_OVERRIDE {
190 return kSkipTiled_Flag; 190 return kSkipTiled_Flag;
191 } 191 }
192 192
193 SkString onShortName() { 193 SkString onShortName() {
194 return SkString("dashing3"); 194 return SkString("dashing3");
195 } 195 }
196 196
197 SkISize onISize() { return skiagm::make_isize(640, 480); } 197 SkISize onISize() { return SkISize::Make(640, 480); }
198 198
199 // Draw a 100x100 block of dashed lines. The horizontal ones are BW 199 // Draw a 100x100 block of dashed lines. The horizontal ones are BW
200 // while the vertical ones are AA. 200 // while the vertical ones are AA.
201 void drawDashedLines(SkCanvas* canvas, 201 void drawDashedLines(SkCanvas* canvas,
202 SkScalar lineLength, 202 SkScalar lineLength,
203 SkScalar phase, 203 SkScalar phase,
204 SkScalar dashLength, 204 SkScalar dashLength,
205 int strokeWidth, 205 int strokeWidth,
206 bool circles) { 206 bool circles) {
207 SkPaint p; 207 SkPaint p;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 protected: 322 protected:
323 virtual uint32_t onGetFlags() const SK_OVERRIDE { 323 virtual uint32_t onGetFlags() const SK_OVERRIDE {
324 return kSkipTiled_Flag; 324 return kSkipTiled_Flag;
325 } 325 }
326 326
327 SkString onShortName() { 327 SkString onShortName() {
328 return SkString("dashing4"); 328 return SkString("dashing4");
329 } 329 }
330 330
331 SkISize onISize() { return skiagm::make_isize(640, 950); } 331 SkISize onISize() { return SkISize::Make(640, 950); }
332 332
333 virtual void onDraw(SkCanvas* canvas) { 333 virtual void onDraw(SkCanvas* canvas) {
334 static const struct { 334 static const struct {
335 int fOnInterval; 335 int fOnInterval;
336 int fOffInterval; 336 int fOffInterval;
337 } gData[] = { 337 } gData[] = {
338 { 1, 1 }, 338 { 1, 1 },
339 { 4, 2 }, 339 { 4, 2 },
340 { 0, 4 }, // test for zero length on interval 340 { 0, 4 }, // test for zero length on interval
341 }; 341 };
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 401
402 static skiagm::GM* F0(void*) { return new DashingGM; } 402 static skiagm::GM* F0(void*) { return new DashingGM; }
403 static skiagm::GM* F1(void*) { return new Dashing2GM; } 403 static skiagm::GM* F1(void*) { return new Dashing2GM; }
404 static skiagm::GM* F2(void*) { return new Dashing3GM; } 404 static skiagm::GM* F2(void*) { return new Dashing3GM; }
405 static skiagm::GM* F3(void*) { return new Dashing4GM; } 405 static skiagm::GM* F3(void*) { return new Dashing4GM; }
406 406
407 static skiagm::GMRegistry gR0(F0); 407 static skiagm::GMRegistry gR0(F0);
408 static skiagm::GMRegistry gR1(F1); 408 static skiagm::GMRegistry gR1(F1);
409 static skiagm::GMRegistry gR2(F2); 409 static skiagm::GMRegistry gR2(F2);
410 static skiagm::GMRegistry gR3(F3); 410 static skiagm::GMRegistry gR3(F3);
OLDNEW
« no previous file with comments | « gm/copyTo4444.cpp ('k') | gm/degeneratesegments.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698