aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkRRectsGaussianEdgeMaskFilter.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-10-20 09:40:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-20 14:06:52 +0000
commita29a956d0e27819b97592404ae1ec6cc8e7b1045 (patch)
tree1e5d884a5d0f7f881a2e8fd5579672edd80fc2a9 /include/effects/SkRRectsGaussianEdgeMaskFilter.h
parente1d6ff172e219d3be61949b0e44091f4c85de2ad (diff)
Add SkRRectsGaussianEdgeMaskFilter
SkRRectsGaussianEdgeShader will be removed once the usage of the MaskFilter flavor has been propagated to Android I will complete the raster implementation in a follow up CL. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3632 Change-Id: I42470b17308582b040a5db1a7283c3d717405345 Reviewed-on: https://skia-review.googlesource.com/3632 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/effects/SkRRectsGaussianEdgeMaskFilter.h')
-rw-r--r--include/effects/SkRRectsGaussianEdgeMaskFilter.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/effects/SkRRectsGaussianEdgeMaskFilter.h b/include/effects/SkRRectsGaussianEdgeMaskFilter.h
new file mode 100644
index 0000000000..14e17b3deb
--- /dev/null
+++ b/include/effects/SkRRectsGaussianEdgeMaskFilter.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkRRectsGaussianEdgeMaskFilter_DEFINED
+#define SkRRectsGaussianEdgeMaskFilter_DEFINED
+
+#include "SkMaskFilter.h"
+
+class SkRRect;
+
+class SK_API SkRRectsGaussianEdgeMaskFilter {
+public:
+ /** Returns a mask filter that applies a Gaussian blur depending on distance to the edge
+ * of the intersection of two round rects.
+ * Currently this is only useable with round rects that have the same radii at
+ * all the corners and for which the x & y radii are equal.
+ *
+ * In order to minimize fill the coverage geometry that should be drawn should be no larger
+ * than the intersection of the bounding boxes of the two round rects. Ambitious users can
+ * omit the center area of the coverage geometry if it is known to be occluded.
+ */
+ static sk_sp<SkMaskFilter> Make(const SkRRect& first,
+ const SkRRect& second,
+ SkScalar radius);
+
+ SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
+
+private:
+ SkRRectsGaussianEdgeMaskFilter(); // can't be instantiated
+};
+
+#endif