aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkShader.h
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2016-10-24 11:36:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-24 16:40:01 +0000
commita8834bb323302bc18f373ad18214d9d96e7af4c9 (patch)
tree12fe68a37dfb625f36acd31fb99acfbec69c169d /include/core/SkShader.h
parenta3f79c0b42d4b3d761694976665f44939ea86014 (diff)
SkShader* refAs... to sk_sp<SkShader> makeAs...
There appear to be no existing overriders of the refAs.. method outside Skia. Change-Id: Iab174e83023093b4d7fc0bd8907666b66ddb1eea Reviewed-on: https://skia-review.googlesource.com/3746 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'include/core/SkShader.h')
-rw-r--r--include/core/SkShader.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 161e6081dd..c31ce73f75 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -469,6 +469,7 @@ public:
static sk_sp<SkShader> MakePictureShader(sk_sp<SkPicture> src, TileMode tmx, TileMode tmy,
const SkMatrix* localMatrix, const SkRect* tile);
+#ifdef SK_SUPPORT_LEGACY_SHADER_ASALOCALMATRIXSHADER
/**
* If this shader can be represented by another shader + a localMatrix, return that shader
* and, if not NULL, the localMatrix. If not, return NULL and ignore the localMatrix parameter.
@@ -476,7 +477,15 @@ public:
* Note: the returned shader (if not NULL) will have been ref'd, and it is the responsibility
* of the caller to balance that with unref() when they are done.
*/
- virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const;
+ SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const {
+ return this->makeAsALocalMatrixShader(localMatrix).release();
+ }
+#endif
+ /**
+ * If this shader can be represented by another shader + a localMatrix, return that shader and
+ * the localMatrix. If not, return nullptr and ignore the localMatrix parameter.
+ */
+ virtual sk_sp<SkShader> makeAsALocalMatrixShader(SkMatrix* localMatrix) const;
SK_TO_STRING_VIRT()
SK_DEFINE_FLATTENABLE_TYPE(SkShader)