diff options
author | robertphillips <robertphillips@google.com> | 2015-09-15 10:20:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-15 10:20:55 -0700 |
commit | 30c4cae7d3a26252e7e45adf6e5722b34adf6848 (patch) | |
tree | 51e48fb3326a2a4a76a762d932069357e3b7c56f /include/core/SkMaskFilter.h | |
parent | de5973b05be6ecc80309cded8541f9c305135d15 (diff) |
Add special case circle blur for Ganesh
This makes the blurcircles bench go from ~33us to ~8us on Windows desktop.
It will require layout test suppressions
Review URL: https://codereview.chromium.org/1311583005
Diffstat (limited to 'include/core/SkMaskFilter.h')
-rw-r--r-- | include/core/SkMaskFilter.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/include/core/SkMaskFilter.h b/include/core/SkMaskFilter.h index df9c4ac3fe..50a1e87e00 100644 --- a/include/core/SkMaskFilter.h +++ b/include/core/SkMaskFilter.h @@ -78,17 +78,31 @@ public: /** * If asFragmentProcessor() fails the filter may be implemented on the GPU by a subclass - * overriding filterMaskGPU (declared below). That code path requires constructing a src mask - * as input. Since that is a potentially expensive operation, the subclass must also override - * this function to indicate whether filterTextureMaskGPU would succeeed if the mask were to be - * created. + * overriding filterMaskGPU (declared below). That code path requires constructing a + * src mask as input. Since that is a potentially expensive operation, the subclass must also + * override this function to indicate whether filterTextureMaskGPU would succeeed if the mask + * were to be created. * * 'maskRect' returns the device space portion of the mask that the filter needs. The mask - * passed into 'filterMaskGPU' should have the same extent as 'maskRect' but be translated - * to the upper-left corner of the mask (i.e., (maskRect.fLeft, maskRect.fTop) appears at - * (0, 0) in the mask). + * passed into 'filterMaskGPU' should have the same extent as 'maskRect' but be + * translated to the upper-left corner of the mask (i.e., (maskRect.fLeft, maskRect.fTop) + * appears at (0, 0) in the mask). + * + * Logically, how this works is: + * canFilterMaskGPU is called + * if (it returns true) + * the returned mask rect is used for quick rejecting + * either directFilterMaskGPU or directFilterRRectMaskGPU is then called + * if (neither of them handle the blur) + * the mask rect is used to generate the mask + * filterMaskGPU is called to filter the mask + * + * TODO: this should work as: + * if (canFilterMaskGPU(devShape, ...)) // rect, rrect, drrect, path + * filterMaskGPU(devShape, ...) + * this would hide the RRect special case and the mask generation */ - virtual bool canFilterMaskGPU(const SkRect& devBounds, + virtual bool canFilterMaskGPU(const SkRRect& devRRect, const SkIRect& clipBounds, const SkMatrix& ctm, SkRect* maskRect) const; |