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

Side by Side Diff: src/gpu/batches/GrAAHairLinePathRenderer.cpp

Issue 1926063002: Adjust tolerance to fix bezier glitches issue (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 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 2011 Google Inc. 2 * Copyright 2011 Google Inc.
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 "GrAAHairLinePathRenderer.h" 8 #include "GrAAHairLinePathRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } else { 163 } else {
164 dst[0] = dstTemp[0]; 164 dst[0] = dstTemp[0];
165 } 165 }
166 return conicCnt; 166 return conicCnt;
167 } 167 }
168 168
169 // returns 0 if quad/conic is degen or close to it 169 // returns 0 if quad/conic is degen or close to it
170 // in this case approx the path with lines 170 // in this case approx the path with lines
171 // otherwise returns 1 171 // otherwise returns 1
172 static int is_degen_quad_or_conic(const SkPoint p[3], SkScalar* dsqd) { 172 static int is_degen_quad_or_conic(const SkPoint p[3], SkScalar* dsqd) {
173 static const SkScalar gDegenerateToLineTol = GrPathUtils::kDefaultTolerance; 173 static const SkScalar gDegenerateToLineTol = SK_ScalarRoot2Over2;
174 static const SkScalar gDegenerateToLineTolSqd = 174 static const SkScalar gDegenerateToLineTolSqd =
175 SkScalarMul(gDegenerateToLineTol, gDegenerateToLineTol); 175 SkScalarMul(gDegenerateToLineTol, gDegenerateToLineTol);
176 176
177 if (p[0].distanceToSqd(p[1]) < gDegenerateToLineTolSqd || 177 if (p[0].distanceToSqd(p[1]) < gDegenerateToLineTolSqd ||
178 p[1].distanceToSqd(p[2]) < gDegenerateToLineTolSqd) { 178 p[1].distanceToSqd(p[2]) < gDegenerateToLineTolSqd) {
179 return 1; 179 return 1;
180 } 180 }
181 181
182 *dsqd = p[1].distanceToLineBetweenSqd(p[0], p[2]); 182 *dsqd = p[1].distanceToLineBetweenSqd(p[0], p[2]);
183 if (*dsqd < gDegenerateToLineTolSqd) { 183 if (*dsqd < gDegenerateToLineTolSqd) {
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 GrColor color = GrRandomColor(random); 978 GrColor color = GrRandomColor(random);
979 SkMatrix viewMatrix = GrTest::TestMatrix(random); 979 SkMatrix viewMatrix = GrTest::TestMatrix(random);
980 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); 980 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle);
981 SkPath path = GrTest::TestPath(random); 981 SkPath path = GrTest::TestPath(random);
982 SkIRect devClipBounds; 982 SkIRect devClipBounds;
983 devClipBounds.setEmpty(); 983 devClipBounds.setEmpty();
984 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds) ; 984 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds) ;
985 } 985 }
986 986
987 #endif 987 #endif
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