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

Unified Diff: include/core/SkShader.h

Issue 1686803003: move compose-shader into base-class as factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | src/core/SkComposeShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkShader.h
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 297091d54206fe64b427f5760c70bb8a07086d81..36256f6f09e4e73cc9d7e22d31982e6b1aecfc07 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -323,7 +323,7 @@ public:
* the colorfilter.
*/
SkShader* newWithColorFilter(SkColorFilter*) const;
-
+
//////////////////////////////////////////////////////////////////////////
// Factory methods for stock shaders
@@ -338,6 +338,18 @@ public:
*/
static SkShader* CreateColorShader(SkColor);
+ static SkShader* CreateComposeShader(SkShader* dst, SkShader* src, SkXfermode::Mode);
+
+ /**
+ * Create a new compose shader, given shaders dst, src, and a combining xfermode mode.
+ * The xfermode is called with the output of the two shaders, and its output is returned.
+ * If xfer is null, SkXfermode::kSrcOver_Mode is assumed.
+ *
+ * Ownership of the shaders, and the xfermode if not null, is not transfered, so the caller
+ * is still responsible for managing its reference-count for those objects.
+ */
+ static SkShader* CreateComposeShader(SkShader* dst, SkShader* src, SkXfermode* xfer);
+
/** Call this to create a new shader that will draw with the specified bitmap.
*
* If the bitmap cannot be used (e.g. has no pixels, or its dimensions
« no previous file with comments | « no previous file | src/core/SkComposeShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698