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

Side by Side Diff: samplecode/SampleArc.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 | « samplecode/SampleApp.cpp ('k') | samplecode/SampleDegenerateTwoPtRadials.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 2011 Google Inc. 3 * Copyright 2011 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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkGradientShader.h" 11 #include "SkGradientShader.h"
12 #include "SkPath.h" 12 #include "SkPath.h"
13 #include "SkRegion.h" 13 #include "SkRegion.h"
14 #include "SkShader.h" 14 #include "SkShader.h"
15 #include "SkUtils.h" 15 #include "SkUtils.h"
16 #include "SkComposeShader.h" 16 #include "SkComposeShader.h"
17 #include "Sk1DPathEffect.h" 17 #include "Sk1DPathEffect.h"
18 #include "SkCornerPathEffect.h" 18 #include "SkCornerPathEffect.h"
19 #include "SkPathMeasure.h" 19 #include "SkPathMeasure.h"
20 #include "SkRandom.h" 20 #include "SkRandom.h"
21 #include "SkColorPriv.h" 21 #include "SkColorPriv.h"
22 #include "SkColorFilter.h" 22 #include "SkColorFilter.h"
23 #include "SkLayerRasterizer.h" 23 #include "SkLayerRasterizer.h"
24 24
25 #include "SkParsePath.h" 25 #include "SkParsePath.h"
26 static void testparse() { 26 static void testparse() {
27 SkRect r; 27 SkRect r;
28 r.set(0, 0, SkFloatToScalar(10), SkFloatToScalar(10.5f)); 28 r.set(0, 0, 10, 10.5f);
29 SkPath p, p2; 29 SkPath p, p2;
30 SkString str, str2; 30 SkString str, str2;
31 31
32 p.addRect(r); 32 p.addRect(r);
33 SkParsePath::ToSVGString(p, &str); 33 SkParsePath::ToSVGString(p, &str);
34 SkParsePath::FromSVGString(str.c_str(), &p2); 34 SkParsePath::FromSVGString(str.c_str(), &p2);
35 SkParsePath::ToSVGString(p2, &str2); 35 SkParsePath::ToSVGString(p2, &str2);
36 } 36 }
37 37
38 class ArcsView : public SampleView { 38 class ArcsView : public SampleView {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 canvas->translate(w * 8 / 7, 0); 117 canvas->translate(w * 8 / 7, 0);
118 } 118 }
119 119
120 canvas->restore(); 120 canvas->restore();
121 } 121 }
122 122
123 virtual void onDrawContent(SkCanvas* canvas) { 123 virtual void onDrawContent(SkCanvas* canvas) {
124 fSweep = SampleCode::GetAnimScalar(SkIntToScalar(360)/24, 124 fSweep = SampleCode::GetAnimScalar(SkIntToScalar(360)/24,
125 SkIntToScalar(360)); 125 SkIntToScalar(360));
126 // fSweep = SkFloatToScalar(359.99f); 126 // fSweep = 359.99f;
127 127
128 SkRect r; 128 SkRect r;
129 SkPaint paint; 129 SkPaint paint;
130 130
131 paint.setAntiAlias(true); 131 paint.setAntiAlias(true);
132 paint.setStrokeWidth(SkIntToScalar(2)); 132 paint.setStrokeWidth(SkIntToScalar(2));
133 paint.setStyle(SkPaint::kStroke_Style); 133 paint.setStyle(SkPaint::kStroke_Style);
134 134
135 r.set(0, 0, SkIntToScalar(200), SkIntToScalar(200)); 135 r.set(0, 0, SkIntToScalar(200), SkIntToScalar(200));
136 r.offset(SkIntToScalar(20), SkIntToScalar(20)); 136 r.offset(SkIntToScalar(20), SkIntToScalar(20));
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 private: 182 private:
183 SkScalar fSweep; 183 SkScalar fSweep;
184 184
185 typedef SampleView INHERITED; 185 typedef SampleView INHERITED;
186 }; 186 };
187 187
188 ////////////////////////////////////////////////////////////////////////////// 188 //////////////////////////////////////////////////////////////////////////////
189 189
190 static SkView* MyFactory() { return new ArcsView; } 190 static SkView* MyFactory() { return new ArcsView; }
191 static SkViewRegister reg(MyFactory); 191 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleDegenerateTwoPtRadials.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698