Chromium Code Reviews| 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); |
|
jvanverth1
2013/09/19 15:18:29
Why did this get removed? Is it unnecessary?
robertphillips
2013/09/19 16:03:45
devBounds is actually uninitialized at this point
|
| - |
| 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); |
| } |
|
jvanverth1
2013/09/19 16:26:53
It's unclear why it's sqrt(1.25) -- maybe expand t
robertphillips
2013/09/19 16:37:01
Done.
|
| - // 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 the sqrt(1.25) of the end points. |
| + // Add a little extra to account for vector normalization precision. |
| + static const SkScalar kSqrtOfOneAndAQuarter = SkFloatToScalar(1.118f); |
| + 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); |