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

Unified Diff: gm/dcshader.cpp

Issue 1316513002: Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (Closed) Base URL: https://skia.googlesource.com/skia.git@things
Patch Set: Address comments, fix roll(?) Created 5 years, 4 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 | « no previous file | gyp/gpu.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « no previous file | gyp/gpu.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698