aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar rileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-20 20:02:43 +0000
committerGravatar rileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-20 20:02:43 +0000
commit03c1c359b336ad20d23ab07004cdafafd14c90a5 (patch)
tree0c5f738849927653fe2daf88979fd2251c4a0e3f /include
parent2683a4166a1b2e0ba09f43edb008cbaf785c3dc6 (diff)
Added asNewCustomStage to SkShader and implemented it for all the gradient shaders.
Not actually hooked up yet, but it should be ready to replace asABitmap for a future CL. Review URL: https://codereview.appspot.com/6351113 git-svn-id: http://skia.googlecode.com/svn/trunk@4702 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkShader.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 7108c34e45..1ba1d671f3 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -17,6 +17,9 @@
#include "SkPaint.h"
class SkPath;
+class GrContext;
+class GrCustomStage;
+class GrSamplerState;
/** \class SkShader
*
@@ -299,6 +302,16 @@ public:
virtual GradientType asAGradient(GradientInfo* info) const;
+ /**
+ * If the shader subclass has a GrCustomStage implementation, this returns
+ * a new custom stage (the caller assumes ownership, and will need to
+ * unref it). A GrContext pointer is required since custom stages may
+ * need to create textures. The sampler parameter is necessary to set
+ * up matrix/tile modes/etc, and will eventually be removed.
+ */
+ virtual GrCustomStage* asNewCustomStage(GrContext* context,
+ GrSamplerState* sampler) const;
+
//////////////////////////////////////////////////////////////////////////
// Factory methods for stock shaders