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

Unified Diff: src/core/SkComposeShader.cpp

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 | « include/core/SkShader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkComposeShader.cpp
diff --git a/src/core/SkComposeShader.cpp b/src/core/SkComposeShader.cpp
index d433ff2d435077ced0a3bdff7ec851c62082e54e..c49d8a48ae261e202d523835fe1753d650824a64 100644
--- a/src/core/SkComposeShader.cpp
+++ b/src/core/SkComposeShader.cpp
@@ -252,3 +252,17 @@ void SkComposeShader::toString(SkString* str) const {
str->append(")");
}
#endif
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+SkShader* SkShader::CreateComposeShader(SkShader* dst, SkShader* src, SkXfermode* xfer) {
+ if (!dst || !src) {
+ return nullptr;
+ }
+ return new SkComposeShader(dst, src, xfer);
+}
+
+SkShader* SkShader::CreateComposeShader(SkShader* dst, SkShader* src, SkXfermode::Mode mode) {
+ SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(mode));
+ return CreateComposeShader(dst, src, xfer);
+}
« no previous file with comments | « include/core/SkShader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698