From: robertphillips Date: Mon, 26 Jan 2015 15:05:04 +0000 (-0800) Subject: Revert of Alter gpu veto (patchset #1 id:1 of https://codereview.chromium.org/875913002/) X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~3907 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=65327efb5bf42b5b9acaa8198e6c5252b07b0ada;p=platform%2Fupstream%2FlibSkiaSharp.git Revert of Alter gpu veto (patchset #1 id:1 of https://codereview.chromium.org/875913002/) Reason for revert: Failing tests Original issue's description: > Alter gpu veto > > This CL unifies the treatment of the dashed and concave paths. > > Before: > TP 28 FP 15 TN 8 FN 3 IND 3 > > After: > TP 28 FP 18 TN 7 FN 2 IND 2 > > One of the TrueNegatives that became a FalsePositive was the motivation use case (the Chromium busy spinner). > > Committed: https://skia.googlesource.com/skia/+/87a6a8e18c7d5bbc94f478b44c53dc0e0549f927 TBR=egdaniel@google.com,bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/879483003 --- diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp index c7e36e7..871a62e 100644 --- a/src/core/SkPicture.cpp +++ b/src/core/SkPicture.cpp @@ -239,22 +239,31 @@ SkPicture::Analysis::Analysis(const SkRecord& record) { bool SkPicture::Analysis::suitableForGpuRasterization(const char** reason, int sampleCount) const { // TODO: the heuristic used here needs to be refined - static const int kNumSlowPathsTol = 6; + static const int kNumPaintWithPathEffectsUsesTol = 1; + static const int kNumAAConcavePathsTol = 5; - int numSlowPathDashedPaths = fNumPaintWithPathEffectUses; - if (0 == sampleCount) { - // The fast dashing path only works when MSAA is disabled - numSlowPathDashedPaths -= fNumFastPathDashEffects; - } - - int numSlowPaths = fNumAAConcavePaths - - fNumAAHairlineConcavePaths - - fNumAADFEligibleConcavePaths; + int numNonDashedPathEffects = fNumPaintWithPathEffectUses - + fNumFastPathDashEffects; + bool suitableForDash = (0 == fNumPaintWithPathEffectUses) || + (numNonDashedPathEffects < kNumPaintWithPathEffectsUsesTol + && 0 == sampleCount); - bool ret = numSlowPathDashedPaths + numSlowPaths < kNumSlowPathsTol; + bool ret = suitableForDash && + (fNumAAConcavePaths - fNumAAHairlineConcavePaths - fNumAADFEligibleConcavePaths) + < kNumAAConcavePathsTol; if (!ret && reason) { - *reason = "Too many slow paths (either concave or dashed)."; + if (!suitableForDash) { + if (0 != sampleCount) { + *reason = "Can't use multisample on dash effect."; + } else { + *reason = "Too many non dashed path effects."; + } + } else if ((fNumAAConcavePaths - fNumAAHairlineConcavePaths - fNumAADFEligibleConcavePaths) + >= kNumAAConcavePathsTol) + *reason = "Too many anti-aliased concave paths."; + else + *reason = "Unknown reason for GPU unsuitability."; } return ret; }