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

Side by Side Diff: src/core/SkScan_Hairline.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 | « src/core/SkRegion_path.cpp ('k') | src/effects/SkBlurMask.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 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 9
10 #include "SkScan.h" 10 #include "SkScan.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 static int compute_int_quad_dist(const SkPoint pts[3]) { 194 static int compute_int_quad_dist(const SkPoint pts[3]) {
195 // compute the vector between the control point ([1]) and the middle of the 195 // compute the vector between the control point ([1]) and the middle of the
196 // line connecting the start and end ([0] and [2]) 196 // line connecting the start and end ([0] and [2])
197 SkScalar dx = SkScalarHalf(pts[0].fX + pts[2].fX) - pts[1].fX; 197 SkScalar dx = SkScalarHalf(pts[0].fX + pts[2].fX) - pts[1].fX;
198 SkScalar dy = SkScalarHalf(pts[0].fY + pts[2].fY) - pts[1].fY; 198 SkScalar dy = SkScalarHalf(pts[0].fY + pts[2].fY) - pts[1].fY;
199 // we want everyone to be positive 199 // we want everyone to be positive
200 dx = SkScalarAbs(dx); 200 dx = SkScalarAbs(dx);
201 dy = SkScalarAbs(dy); 201 dy = SkScalarAbs(dy);
202 // convert to whole pixel values (use ceiling to be conservative) 202 // convert to whole pixel values (use ceiling to be conservative)
203 int idx = SkScalarCeil(dx); 203 int idx = SkScalarCeilToInt(dx);
204 int idy = SkScalarCeil(dy); 204 int idy = SkScalarCeilToInt(dy);
205 // use the cheap approx for distance 205 // use the cheap approx for distance
206 if (idx > idy) { 206 if (idx > idy) {
207 return idx + (idy >> 1); 207 return idx + (idy >> 1);
208 } else { 208 } else {
209 return idy + (idx >> 1); 209 return idy + (idx >> 1);
210 } 210 }
211 } 211 }
212 212
213 typedef void (*LineProc)(const SkPoint&, const SkPoint&, const SkRegion*, 213 typedef void (*LineProc)(const SkPoint&, const SkPoint&, const SkRegion*,
214 SkBlitter*); 214 SkBlitter*);
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 408
409 SkAAClipBlitterWrapper wrap; 409 SkAAClipBlitterWrapper wrap;
410 if (!clip.quickContains(ir)) { 410 if (!clip.quickContains(ir)) {
411 wrap.init(clip, blitter); 411 wrap.init(clip, blitter);
412 blitter = wrap.getBlitter(); 412 blitter = wrap.getBlitter();
413 clipRgn = &wrap.getRgn(); 413 clipRgn = &wrap.getRgn();
414 } 414 }
415 AntiHairLineRgn(p0, p1, clipRgn, blitter); 415 AntiHairLineRgn(p0, p1, clipRgn, blitter);
416 } 416 }
417 } 417 }
OLDNEW
« no previous file with comments | « src/core/SkRegion_path.cpp ('k') | src/effects/SkBlurMask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698