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

Unified Diff: include/core/SkShader.h

Issue 272593002: add localmatrix-shader (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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 | samplecode/SamplePatch.cpp » ('j') | src/core/SkShader.cpp » ('J')
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 dc93b84749dcc3341174875d5ed07d4f30d655e6..460f9254768a5432f5589b162a66639de264fdce 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -401,6 +401,23 @@ public:
static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy,
const SkMatrix* localMatrix = NULL);
+ /**
+ * Return a shader that will apply the specified localMatrix to the proxy shader.
+ * The specified matrix will be applied before any matrix associated with the proxy.
+ *
+ * Note: onwership of the proxy is not transferred (though a ref is taken).
+ */
+ static SkShader* CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& localMatrix);
+
+ /**
+ * 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.
+ *
+ * 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;
+
SK_TO_STRING_VIRT()
SK_DEFINE_FLATTENABLE_TYPE(SkShader)
« no previous file with comments | « no previous file | samplecode/SamplePatch.cpp » ('j') | src/core/SkShader.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698