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

Side by Side Diff: gm/roundrects.cpp

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 years 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/perlinnoise.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 /* 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 8
9 #include "gm.h" 9 #include "gm.h"
10 #include "SkTArray.h" 10 #include "SkTArray.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 { 122 {
123 SkMatrix m; 123 SkMatrix m;
124 m.setRotate(SkIntToScalar(60)); 124 m.setRotate(SkIntToScalar(60));
125 fMatrices.push_back(m); 125 fMatrices.push_back(m);
126 } 126 }
127 } 127 }
128 128
129 SkColor genColor(SkRandom* rand) { 129 SkColor genColor(SkRandom* rand) {
130 SkScalar hsv[3]; 130 SkScalar hsv[3];
131 hsv[0] = SkFloatToScalar(rand->nextRangeF(0.0f, 360.0f)); 131 hsv[0] = rand->nextRangeF(0.0f, 360.0f);
132 hsv[1] = SkFloatToScalar(rand->nextRangeF(0.75f, 1.0f)); 132 hsv[1] = rand->nextRangeF(0.75f, 1.0f);
133 hsv[2] = SkFloatToScalar(rand->nextRangeF(0.75f, 1.0f)); 133 hsv[2] = rand->nextRangeF(0.75f, 1.0f);
134 134
135 return SkHSVToColor(hsv); 135 return SkHSVToColor(hsv);
136 } 136 }
137 137
138 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 138 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
139 SkRandom rand(1); 139 SkRandom rand(1);
140 canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); 140 canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1);
141 SkRect rect = SkRect::MakeLTRB(-20, -30, 20, 30); 141 SkRect rect = SkRect::MakeLTRB(-20, -30, 20, 30);
142 SkRRect circleRect; 142 SkRRect circleRect;
143 circleRect.setRectXY(rect, 5, 5); 143 circleRect.setRectXY(rect, 5, 5);
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 typedef GM INHERITED; 331 typedef GM INHERITED;
332 }; 332 };
333 333
334 ////////////////////////////////////////////////////////////////////////////// 334 //////////////////////////////////////////////////////////////////////////////
335 335
336 static GM* MyFactory(void*) { return new RoundRectGM; } 336 static GM* MyFactory(void*) { return new RoundRectGM; }
337 static GMRegistry reg(MyFactory); 337 static GMRegistry reg(MyFactory);
338 338
339 } 339 }
OLDNEW
« no previous file with comments | « gm/perlinnoise.cpp ('k') | gm/shaderbounds.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698