aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkBlurMaskFilter.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-08-16 09:30:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-16 09:30:03 -0700
commitc4d2f907311fca08303c254b2488bd7990fa2f32 (patch)
tree8b2a684a908b6760e729969b02de844a4dc67f3c /include/effects/SkBlurMaskFilter.h
parent2f4114a246e4753ef5dab63a4b40caf0cf7950ac (diff)
Update ComputeBlurredRRectParams to compute all the parameters needed for occluded blurred rrect ninepatch draws
This is split out of: https://codereview.chromium.org/2245653002/ (Start using vertex attributes for nine-patch blurred rrect draws) GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2248533002 Review-Url: https://codereview.chromium.org/2248533002
Diffstat (limited to 'include/effects/SkBlurMaskFilter.h')
-rw-r--r--include/effects/SkBlurMaskFilter.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/include/effects/SkBlurMaskFilter.h b/include/effects/SkBlurMaskFilter.h
index 12eec6052f..dfbae6b689 100644
--- a/include/effects/SkBlurMaskFilter.h
+++ b/include/effects/SkBlurMaskFilter.h
@@ -73,15 +73,27 @@ public:
SkScalar blurRadius);
#endif
- static bool ComputeBlurredRRectParams(const SkRRect& rrect,
- SkScalar sigma,
+ static const int kMaxDivisions = 6;
+
+ // This method computes all the parameters for drawing a partially occluded nine-patched
+ // blurred rrect mask:
+ // rrectToDraw - the integerized rrect to draw in the mask
+ // widthHeight - how large to make the mask (rrectToDraw will be centered in this coord sys)
+ // rectXs, rectYs - the x & y coordinates of the covering geometry lattice
+ // texXs, texYs - the texture coordinate at each point in rectXs & rectYs
+ // numXs, numYs - number of coordinates in the x & y directions
+ // skipMask - bit mask that contains a 1-bit whenever one of the cells is occluded
+ // It returns true if 'devRRect' is nine-patchable
+ static bool ComputeBlurredRRectParams(const SkRRect& srcRRect, const SkRRect& devRRect,
+ const SkRect& occluder,
+ SkScalar sigma, SkScalar xformedSigma,
SkRRect* rrectToDraw,
SkISize* widthHeight,
- SkScalar xs[4],
- int* numXs,
- SkScalar ys[4],
- int* numYs);
-
+ SkScalar rectXs[kMaxDivisions],
+ SkScalar rectYs[kMaxDivisions],
+ SkScalar texXs[kMaxDivisions],
+ SkScalar texYs[kMaxDivisions],
+ int* numXs, int* numYs, uint32_t* skipMask);
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()