Fix perf regression with SDF paths
BUG=skia:6113,chromium:677889
Change-Id: I13d012a92e4d0371138f5ed4b92c7850f9b773a5
Reviewed-on: https://skia-review.googlesource.com/6945
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
index 1736dbba..a4d166c 100644
--- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
@@ -35,7 +35,6 @@
#endif
// mip levels
-static const int kMinSize = 16;
static const int kSmallMIP = 32;
static const int kMediumMIP = 73;
static const int kLargeMIP = 162;
@@ -106,15 +105,12 @@
// Only support paths with bounds within kMediumMIP by kMediumMIP,
// scaled to have bounds within 2.0f*kLargeMIP by 2.0f*kLargeMIP.
- // For clarity, the original or scaled path should be at least kMinSize by kMinSize.
- // TODO: revisit this last criteria with Joel's patch.
// The goal is to accelerate rendering of lots of small paths that may be scaling.
SkScalar maxScale = args.fViewMatrix->getMaxScale();
SkRect bounds = args.fShape->styledBounds();
SkScalar maxDim = SkMaxScalar(bounds.width(), bounds.height());
- return maxDim <= kMediumMIP &&
- maxDim * maxScale >= kMinSize && maxDim * maxScale <= 2.0f*kLargeMIP;
+ return maxDim <= kMediumMIP && maxDim * maxScale <= 2.0f*kLargeMIP;
}
////////////////////////////////////////////////////////////////////////////////