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

Unified Diff: include/core/SkShader.h

Issue 1782703002: sk_sp versions of newWithColorFilter and newWithLocalMatrix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « gm/perlinnoise.cpp ('k') | samplecode/SamplePatch.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 3e4093645cc2f6ddc301171fc1021f0978293b1a..0bcb98a07e98ebc58e3014911b60b00273bb975a 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -323,13 +323,13 @@ public:
* Return a shader that will apply the specified localMatrix to this shader.
* The specified matrix will be applied before any matrix associated with this shader.
*/
- SkShader* newWithLocalMatrix(const SkMatrix&) const;
+ sk_sp<SkShader> makeWithLocalMatrix(const SkMatrix&) const;
/**
* Create a new shader that produces the same colors as invoking this shader and then applying
* the colorfilter.
*/
- SkShader* newWithColorFilter(SkColorFilter*) const;
+ sk_sp<SkShader> makeWithColorFilter(SkColorFilter*) const;
//////////////////////////////////////////////////////////////////////////
// Factory methods for stock shaders
@@ -359,6 +359,13 @@ public:
static SkShader* CreateComposeShader(SkShader* dst, SkShader* src, SkXfermode* xfer);
static SkShader* CreatePictureShader(const SkPicture* src, TileMode tmx, TileMode tmy,
const SkMatrix* localMatrix, const SkRect* tile);
+
+ SkShader* newWithLocalMatrix(const SkMatrix& matrix) const {
+ return this->makeWithLocalMatrix(matrix).release();
+ }
+ SkShader* newWithColorFilter(SkColorFilter* filter) const {
+ return this->makeWithColorFilter(filter).release();
+ }
#endif
/**
« no previous file with comments | « gm/perlinnoise.cpp ('k') | samplecode/SamplePatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698