From 03c1c359b336ad20d23ab07004cdafafd14c90a5 Mon Sep 17 00:00:00 2001 From: "rileya@google.com" Date: Fri, 20 Jul 2012 20:02:43 +0000 Subject: 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 --- include/core/SkShader.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') 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 -- cgit v1.2.3