Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: include/effects/SkRRectsGaussianEdgeShader.h

Issue 2321713004: Add shader-based GaussianEdgeShader for reveal case (Closed)
Patch Set: Address code review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/effects.gypi ('k') | src/effects/SkRRectsGaussianEdgeShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkRRectsGaussianEdgeShader.h
diff --git a/include/effects/SkRRectsGaussianEdgeShader.h b/include/effects/SkRRectsGaussianEdgeShader.h
new file mode 100644
index 0000000000000000000000000000000000000000..0bdb06b143171a7c04e607fbe64d8d43cf151943
--- /dev/null
+++ b/include/effects/SkRRectsGaussianEdgeShader.h
@@ -0,0 +1,37 @@
+/*
+ * 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 SkRRectsGaussianEdgeShader_DEFINED
+#define SkRRectsGaussianEdgeShader_DEFINED
+
+#include "SkShader.h"
+
+class SkRRect;
+
+class SK_API SkRRectsGaussianEdgeShader {
+public:
+ /** Returns a shader 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.
+ * Raster will draw nothing.
+ *
+ * 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<SkShader> Make(const SkRRect& first,
+ const SkRRect& second,
+ SkScalar radius, SkScalar pad);
+
+ SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
+
+private:
+ SkRRectsGaussianEdgeShader(); // can't be instantiated
+};
+
+#endif
« no previous file with comments | « gyp/effects.gypi ('k') | src/effects/SkRRectsGaussianEdgeShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698