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

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

Issue 1148053003: fix win 8 bot (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months 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
« no previous file with comments | « no previous file | no next file » | 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 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkStrokerPriv.h" 8 #include "SkStrokerPriv.h"
9 #include "SkGeometry.h" 9 #include "SkGeometry.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 SkScalar dist2 = pt_to_line(end, start, quadPts->fTangentStart); 1049 SkScalar dist2 = pt_to_line(end, start, quadPts->fTangentStart);
1050 if (SkTMax(dist1, dist2) <= fInvResScaleSquared) { 1050 if (SkTMax(dist1, dist2) <= fInvResScaleSquared) {
1051 return STROKER_RESULT(kDegenerate_ResultType, depth, quadPts, 1051 return STROKER_RESULT(kDegenerate_ResultType, depth, quadPts,
1052 "SkTMax(dist1=%g, dist2=%g) <= fInvResScaleSquared", dist1, dist2); 1052 "SkTMax(dist1=%g, dist2=%g) <= fInvResScaleSquared", dist1, dist2);
1053 } 1053 }
1054 return STROKER_RESULT(kSplit_ResultType, depth, quadPts, 1054 return STROKER_RESULT(kSplit_ResultType, depth, quadPts,
1055 "(numerA=%g >= 0) == (numerB=%g >= 0)", numerA, numerB); 1055 "(numerA=%g >= 0) == (numerB=%g >= 0)", numerA, numerB);
1056 } 1056 }
1057 // check to see if the denomerator is teeny relative to the numerator 1057 // check to see if the denomerator is teeny relative to the numerator
1058 bool validDivide = SkScalarAbs(numerA) * SK_ScalarNearlyZero < SkScalarAbs(d enom); 1058 bool validDivide = SkScalarAbs(numerA) * SK_ScalarNearlyZero < SkScalarAbs(d enom);
1059 SkASSERT(!SkScalarNearlyZero(denom / numerA) == validDivide); 1059 // the divide check is the same as checking if the scaled denom is nearly zero
1060 // (commented out because on some platforms the two are not bit-identical)
1061 // SkASSERT(!SkScalarNearlyZero(denom / numerA) == validDivide);
1060 if (validDivide) { 1062 if (validDivide) {
1061 if (kCtrlPt_RayType == intersectRayType) { 1063 if (kCtrlPt_RayType == intersectRayType) {
1062 numerA /= denom; 1064 numerA /= denom;
1063 SkPoint* ctrlPt = &quadPts->fQuad[1]; 1065 SkPoint* ctrlPt = &quadPts->fQuad[1];
1064 // the intersection of the tangents need not be on the tangent segme nt 1066 // the intersection of the tangents need not be on the tangent segme nt
1065 // so 0 <= numerA <= 1 is not necessarily true 1067 // so 0 <= numerA <= 1 is not necessarily true
1066 ctrlPt->fX = start.fX * (1 - numerA) + quadPts->fTangentStart.fX * n umerA; 1068 ctrlPt->fX = start.fX * (1 - numerA) + quadPts->fTangentStart.fX * n umerA;
1067 ctrlPt->fY = start.fY * (1 - numerA) + quadPts->fTangentStart.fY * n umerA; 1069 ctrlPt->fY = start.fY * (1 - numerA) + quadPts->fTangentStart.fY * n umerA;
1068 } 1070 }
1069 return STROKER_RESULT(kQuad_ResultType, depth, quadPts, 1071 return STROKER_RESULT(kQuad_ResultType, depth, quadPts,
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 default: 1756 default:
1755 break; 1757 break;
1756 } 1758 }
1757 1759
1758 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { 1760 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) {
1759 r = rect; 1761 r = rect;
1760 r.inset(radius, radius); 1762 r.inset(radius, radius);
1761 dst->addRect(r, reverse_direction(dir)); 1763 dst->addRect(r, reverse_direction(dir));
1762 } 1764 }
1763 } 1765 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698