From: Jim Van Verth Date: Thu, 12 Jan 2017 15:00:16 +0000 (-0500) Subject: Fix perf regression with SDF paths X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~55^2~874 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=062990bc7a8a667d6282ff73188589e57c7607ed;p=platform%2Fupstream%2FlibSkiaSharp.git 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 Commit-Queue: Jim Van Verth --- diff --git a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp index d025c94..891eab3 100644 --- a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp @@ -39,7 +39,6 @@ static int g_NumFreedShapes = 0; #endif // mip levels -static const int kMinSize = 16; static const int kSmallMIP = 32; static const int kMediumMIP = 73; static const int kLargeMIP = 162; @@ -110,15 +109,12 @@ bool GrAADistanceFieldPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c // 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; } ////////////////////////////////////////////////////////////////////////////////