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

Side by Side Diff: src/core/SkStrokerPriv.cpp

Issue 117053002: remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats (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
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 "SkStrokerPriv.h" 10 #include "SkStrokerPriv.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 if (count > 1) 146 if (count > 1)
147 { 147 {
148 for (int i = 1; i < count; i += 2) 148 for (int i = 1; i < count; i += 2)
149 outer->quadTo(pts[i].fX, pts[i].fY, pts[i+1].fX, pts[i+1].fY); 149 outer->quadTo(pts[i].fX, pts[i].fY, pts[i+1].fX, pts[i+1].fY);
150 150
151 after.scale(radius); 151 after.scale(radius);
152 HandleInnerJoin(inner, pivot, after); 152 HandleInnerJoin(inner, pivot, after);
153 } 153 }
154 } 154 }
155 155
156 #ifdef SK_SCALAR_IS_FLOAT 156 #define kOneOverSqrt2 (0.707106781f)
157 #define kOneOverSqrt2 (0.707106781f)
158 #else
159 #define kOneOverSqrt2 (46341)
160 #endif
161 157
162 static void MiterJoiner(SkPath* outer, SkPath* inner, const SkVector& beforeUnit Normal, 158 static void MiterJoiner(SkPath* outer, SkPath* inner, const SkVector& beforeUnit Normal,
163 const SkPoint& pivot, const SkVector& afterUnitNormal, 159 const SkPoint& pivot, const SkVector& afterUnitNormal,
164 SkScalar radius, SkScalar invMiterLimit, 160 SkScalar radius, SkScalar invMiterLimit,
165 bool prevIsLine, bool currIsLine) 161 bool prevIsLine, bool currIsLine)
166 { 162 {
167 // negate the dot since we're using normals instead of tangents 163 // negate the dot since we're using normals instead of tangents
168 SkScalar dotProd = SkPoint::DotProduct(beforeUnitNormal, afterUnitNormal) ; 164 SkScalar dotProd = SkPoint::DotProduct(beforeUnitNormal, afterUnitNormal) ;
169 AngleType angleType = Dot2AngleType(dotProd); 165 AngleType angleType = Dot2AngleType(dotProd);
170 SkVector before = beforeUnitNormal; 166 SkVector before = beforeUnitNormal;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 251
256 SkStrokerPriv::JoinProc SkStrokerPriv::JoinFactory(SkPaint::Join join) 252 SkStrokerPriv::JoinProc SkStrokerPriv::JoinFactory(SkPaint::Join join)
257 { 253 {
258 static const SkStrokerPriv::JoinProc gJoiners[] = { 254 static const SkStrokerPriv::JoinProc gJoiners[] = {
259 MiterJoiner, RoundJoiner, BluntJoiner 255 MiterJoiner, RoundJoiner, BluntJoiner
260 }; 256 };
261 257
262 SkASSERT((unsigned)join < SkPaint::kJoinCount); 258 SkASSERT((unsigned)join < SkPaint::kJoinCount);
263 return gJoiners[join]; 259 return gJoiners[join];
264 } 260 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698