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

Unified Diff: include/core/SkShader.h

Issue 282733005: Add functions for inspecting SkShader. (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 | « include/core/SkComposeShader.h ('k') | src/core/SkComposeShader.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 ce5f00387339158267df4f6ee3f90b6a32f95b5e..bc83c320cd2c9703659367ee88ae058a27a00b65 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -17,6 +17,7 @@
class SkPath;
class SkPicture;
+class SkXfermode;
class GrContext;
class GrEffectRef;
@@ -356,6 +357,20 @@ public:
virtual GradientType asAGradient(GradientInfo* info) const;
/**
+ * If the shader subclass is composed of two shaders, return true, and if rec is not NULL,
+ * fill it out with info about the shader.
reed1 2014/05/13 18:00:24 ? What is the ownership-rule for the returned poin
scroggo 2014/05/14 13:51:26 Uploaded https://codereview.chromium.org/288713002
+ */
+
+ struct ComposeRec {
+ const SkShader* fShaderA;
+ const SkShader* fShaderB;
+ const SkXfermode* fMode;
+ };
+
+ virtual bool asACompose(ComposeRec* rec) const { return false; }
+
+
+ /**
* If the shader subclass has a GrEffect implementation, this resturns the effect to install.
* The incoming color to the effect has r=g=b=a all extracted from the SkPaint's alpha.
* The output color should be the computed SkShader premul color modulated by the incoming
@@ -365,6 +380,14 @@ public:
virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint& paint,
const SkMatrix* localMatrixOrNull) const;
+#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+ /**
+ * If the shader is a custom shader which has data the caller might want, call this function
+ * to get that data.
+ */
+ virtual bool asACustomShader(void** customData) const { return false; }
+#endif
+
//////////////////////////////////////////////////////////////////////////
// Factory methods for stock shaders
« no previous file with comments | « include/core/SkComposeShader.h ('k') | src/core/SkComposeShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698