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

Unified Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 24269004: Reenable GrAAHairlinePathRenderer assert w/ fix (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Improved comment Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAHairLinePathRenderer.cpp
===================================================================
--- src/gpu/GrAAHairLinePathRenderer.cpp (revision 11380)
+++ src/gpu/GrAAHairLinePathRenderer.cpp (working copy)
@@ -738,8 +738,6 @@
const SkMatrix& viewM = drawState->getViewMatrix();
- devBounds->outset(SK_Scalar1, SK_Scalar1);
-
int vertCnt = kVertsPerLineSeg * lineCnt;
drawState->setVertexAttribs<gHairlineLineAttribs>(SK_ARRAY_COUNT(gHairlineLineAttribs));
@@ -763,9 +761,10 @@
for (int i = 0; i < lineCnt; ++i) {
add_line(&lines[2*i], toSrc, drawState->getCoverage(), &verts);
}
- // All the verts computed by add_line are within unit distance of the end points. Add a little
- // extra to account for vector normalization precision.
- static const SkScalar kOutset = SK_Scalar1 + SK_Scalar1 / 20;
+ // All the verts computed by add_line are within sqrt(1^2 + 0.5^2) of the end points.
+ static const SkScalar kSqrtOfOneAndAQuarter = SkFloatToScalar(1.118f);
+ // Add a little extra to account for vector normalization precision.
+ static const SkScalar kOutset = kSqrtOfOneAndAQuarter + SK_Scalar1 / 20;
devBounds->outset(kOutset, kOutset);
return true;
@@ -937,8 +936,8 @@
GrDrawState* drawState = target->drawState();
// Check devBounds
-// SkASSERT(check_bounds<LineVertex>(drawState, devBounds, arg.vertices(),
-// kVertsPerLineSeg * lineCnt));
+ SkASSERT(check_bounds<LineVertex>(drawState, devBounds, arg.vertices(),
+ kVertsPerLineSeg * lineCnt));
{
GrDrawState::AutoRestoreEffects are(drawState);
« 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