aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/batches
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-05-11 05:53:07 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-11 05:53:07 -0700
commit70142347f7b4ef49745e828d93026fc153a72845 (patch)
tree16e1c14e8d9fec8eee5af8619545e0fb079f2f14 /src/gpu/batches
parente19aecdd13d83b2235faf3e2601100a2fd980b7b (diff)
Make distance field bounds calculation more accurate for strokes
Diffstat (limited to 'src/gpu/batches')
-rw-r--r--src/gpu/batches/GrAADistanceFieldPathRenderer.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
index ba52bf9213..d6ac346ba1 100644
--- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
@@ -101,23 +101,9 @@ bool GrAADistanceFieldPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c
// scaled to have bounds within 2.0f*kLargeMIP by 2.0f*kLargeMIP
// the goal is to accelerate rendering of lots of small paths that may be scaling
SkScalar maxScale = args.fViewMatrix->getMaxScale();
-#if 0 // This is more accurate but changes some GMs. TODO: Standalone change to enable this.
SkRect bounds;
args.fStyle->adjustBounds(&bounds, args.fPath->getBounds());
SkScalar maxDim = SkMaxScalar(bounds.width(), bounds.height());
-#else
- const SkRect& bounds = args.fPath->getBounds();
- SkScalar maxDim = SkMaxScalar(bounds.width(), bounds.height());
- const SkStrokeRec& stroke = args.fStyle->strokeRec();
- // Approximate stroked size by adding the maximum of the stroke width or 2x the miter limit
- if (!stroke.isFillStyle()) {
- SkScalar extraWidth = stroke.getWidth();
- if (SkPaint::kMiter_Join == stroke.getJoin()) {
- extraWidth = SkTMax(extraWidth, 2.0f*stroke.getMiter());
- }
- maxDim += extraWidth;
- }
-#endif
return maxDim <= kMediumMIP && maxDim * maxScale <= 2.0f*kLargeMIP;
}