diff options
author | reed <reed@google.com> | 2016-02-10 08:53:15 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 08:53:15 -0800 |
commit | a2b340f8a8d5f219eb62f5f9b654cf19c988c578 (patch) | |
tree | 982eb398f86a11ce1b69231ad9c7555e463648c7 /include/core | |
parent | 2f2ee83a9c1ff05a94265b175e51c63fc424d554 (diff) |
move compose-shader into base-class as factory
next steps:
1. this lands
2. update android to call the new factory
3. move SkComposeShader.h into private
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1686803003
Review URL: https://codereview.chromium.org/1686803003
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkShader.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/core/SkShader.h b/include/core/SkShader.h index 297091d542..36256f6f09 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 |