From c21b09eec91c9e263cb0b88467ea44e348ed4962 Mon Sep 17 00:00:00 2001 From: bsalomon Date: Fri, 28 Aug 2015 18:46:56 -0700 Subject: Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* Committed: https://skia.googlesource.com/skia/+/ecfdc251be71f3d634e76afdd6375bf55fc061aa Review URL: https://codereview.chromium.org/1316513002 --- include/core/SkShader.h | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'include/core/SkShader.h') diff --git a/include/core/SkShader.h b/include/core/SkShader.h index 47fdc9492f..76b86a6cfe 100644 --- a/include/core/SkShader.h +++ b/include/core/SkShader.h @@ -334,27 +334,20 @@ public: /** - * Returns true if the shader subclass succeeds in creating an effect or if none is required. - * False is returned if it fails or if there is not an implementation of this method in the - * shader subclass. + * Returns a GrFragmentProcessor that implements the shader for the GPU backend. NULL is + * returned if there is no GPU implementation. * - * On success an implementation of this method must inspect the SkPaint and set paintColor to - * the color the effect expects as its input color. If the SkShader wishes to emit a solid - * color then it should set paintColor to that color and not create an effect. Note that - * GrColor is always premul. The common patterns are to convert paint's SkColor to GrColor or - * to extract paint's alpha and replicate it to all channels in paintColor. Upon failure - * paintColor should not be modified. It is not recommended to specialize the effect to - * the paint's color as then many GPU shaders may be generated. + * The GPU device does not call SkShader::createContext(), instead we pass the view matrix, + * local matrix, and filter quality directly. * - * The GrContext may be used by the effect to create textures. The GPU device does not - * call createContext. Instead we pass the SkPaint here in case the shader needs paint info. - * - * A view matrix is always required to create the correct GrFragmentProcessor. Some shaders - * may also use the optional localMatrix to define a matrix relevant only for sampling. + * The GrContext may be used by the to create textures that are required by the returned + * processor. */ - virtual bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix& viewM, - const SkMatrix* localMatrix, GrColor*, - GrProcessorDataManager*, GrFragmentProcessor**) const; + virtual const GrFragmentProcessor* asFragmentProcessor(GrContext*, + const SkMatrix& viewMatrix, + const SkMatrix* localMatrix, + SkFilterQuality, + GrProcessorDataManager*) const; /** * If the shader can represent its "average" luminance in a single color, return true and -- cgit v1.2.3