From abf035357ff40825b4e49844c88c8f356ab1a6bd Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Wed, 5 May 2021 18:39:26 +0000 Subject: [PATCH] Revert "Disallow caching of non-ninepatchable blur mask filtered round rects" This reverts commit baa74dc154787c9e77518f787dc7f9ebe71e2844. Reason for revert: big perf regression on Mali400 and Tegra3 - we will try making the key more cache-friendly Original change's description: > Disallow caching of non-ninepatchable blur mask filtered round rects > > From our simulation of the Camera App's behavior we get: > > w/ caching (old): > Textures Created: 802 > Texture Uploads: 802 > > w/o caching (new): > Textures Created: 6 > Texture Uploads: 802 > > Bug: b/185828492, skia:11953 > Change-Id: I7975033bf9f7d24ede6f1add23fe95cda3ba5669 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404202 > Commit-Queue: Robert Phillips > Reviewed-by: Brian Salomon TBR=bsalomon@google.com,robertphillips@google.com Change-Id: If1f4065041b1a3800d35be7ba7c8c897211cc553 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: b/185828492 Bug: skia:11953 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404916 Reviewed-by: Robert Phillips Commit-Queue: Robert Phillips --- src/gpu/GrBlurUtils.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp index 2b0c50b7ee..ebf8b28758 100644 --- a/src/gpu/GrBlurUtils.cpp +++ b/src/gpu/GrBlurUtils.cpp @@ -288,13 +288,9 @@ static bool compute_key_and_clip_bounds(GrUniqueKey* maskKey, #ifndef SK_DISABLE_MASKFILTERED_MASK_CACHING // To prevent overloading the cache with entries during animations we limit the cache of masks - // to cases where the matrix preserves axis alignment. Additionally, caching blurred masks - // for non-nine-patchable blurred round rects can also quickly flood the cache. - bool useCache = !inverseFilled && - viewMatrix.preservesAxisAlignment() && - shape.hasUnstyledKey() && - as_MFB(maskFilter)->asABlur(nullptr) && - !shape.asRRect(nullptr, nullptr, nullptr, nullptr); + // to cases where the matrix preserves axis alignment. + bool useCache = !inverseFilled && viewMatrix.preservesAxisAlignment() && + shape.hasUnstyledKey() && as_MFB(maskFilter)->asABlur(nullptr); if (useCache) { SkIRect clippedMaskRect, unClippedMaskRect;