Index: gm/dcshader.cpp |
diff --git a/gm/dcshader.cpp b/gm/dcshader.cpp |
index 3eee43d1474cb058c336bdf770550cd870049cc7..976e2530ead69789edb0f6efe1161f3b4e0f1327 100644 |
--- a/gm/dcshader.cpp |
+++ b/gm/dcshader.cpp |
@@ -10,6 +10,7 @@ |
#if SK_SUPPORT_GPU |
#include "GrFragmentProcessor.h" |
#include "GrCoordTransform.h" |
+#include "effects/GrExtractAlphaFragmentProcessor.h" |
#include "gl/GrGLProcessor.h" |
#include "gl/builders/GrGLProgramBuilder.h" |
#include "Resources.h" |
@@ -33,9 +34,11 @@ public: |
buf.writeMatrix(fDeviceMatrix); |
} |
- bool asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMatrix& viewM, |
- const SkMatrix* localMatrix, GrColor* color, GrProcessorDataManager*, |
- GrFragmentProcessor** fp) const override; |
+ const GrFragmentProcessor* asFragmentProcessor(GrContext*, |
+ const SkMatrix& viewM, |
+ const SkMatrix* localMatrix, |
+ SkFilterQuality, |
+ GrProcessorDataManager*) const override; |
#ifndef SK_IGNORE_TO_STRING |
void toString(SkString* str) const override { |
@@ -94,13 +97,14 @@ private: |
GrCoordTransform fDeviceTransform; |
}; |
-bool DCShader::asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMatrix& viewM, |
- const SkMatrix* localMatrix, GrColor* color, |
- GrProcessorDataManager* procDataManager, |
- GrFragmentProcessor** fp) const { |
- *fp = new DCFP(procDataManager, fDeviceMatrix); |
- *color = GrColorPackA4(paint.getAlpha()); |
- return true; |
+const GrFragmentProcessor* DCShader::asFragmentProcessor( |
+ GrContext*, |
+ const SkMatrix& viewM, |
+ const SkMatrix* localMatrix, |
+ SkFilterQuality, |
+ GrProcessorDataManager* procDataManager) const { |
+ SkAutoTUnref<const GrFragmentProcessor> inner(new DCFP(procDataManager, fDeviceMatrix)); |
+ return GrExtractAlphaFragmentProcessor::Create(inner); |
} |
class DCShaderGM : public GM { |