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

Side by Side Diff: samplecode/SampleCull.cpp

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 FINISHED: 73 FINISHED:
74 array = new SkIPoint[n]; 74 array = new SkIPoint[n];
75 n = 0; 75 n = 0;
76 76
77 { 77 {
78 SkPath::Iter iter(path, false); 78 SkPath::Iter iter(path, false);
79 for (;;) 79 for (;;)
80 switch (iter.next(pts)) { 80 switch (iter.next(pts)) {
81 case SkPath::kMove_Verb: 81 case SkPath::kMove_Verb:
82 array[n++].set(SkScalarRound(pts[0].fX), SkScalarRound(pts[0].fY )); 82 array[n++].set(SkScalarRoundToInt(pts[0].fX),
83 SkScalarRoundToInt(pts[0].fY));
83 break; 84 break;
84 case SkPath::kLine_Verb: 85 case SkPath::kLine_Verb:
85 array[n++].set(SkScalarRound(pts[1].fX), SkScalarRound(pts[1].fY )); 86 array[n++].set(SkScalarRoundToInt(pts[1].fX),
87 SkScalarRoundToInt(pts[1].fY));
86 break; 88 break;
87 case SkPath::kDone_Verb: 89 case SkPath::kDone_Verb:
88 goto FINISHED2; 90 goto FINISHED2;
89 default: 91 default:
90 break; 92 break;
91 } 93 }
92 } 94 }
93 95
94 FINISHED2: 96 FINISHED2:
95 *count = n; 97 *count = n;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 SkPath fPath; 188 SkPath fPath;
187 int fPtCount; 189 int fPtCount;
188 190
189 typedef SampleView INHERITED; 191 typedef SampleView INHERITED;
190 }; 192 };
191 193
192 ////////////////////////////////////////////////////////////////////////////// 194 //////////////////////////////////////////////////////////////////////////////
193 195
194 static SkView* MyFactory() { return new CullView; } 196 static SkView* MyFactory() { return new CullView; }
195 static SkViewRegister reg(MyFactory); 197 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