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

Unified Diff: gm/dcshader.cpp

Issue 1313573005: Revert of Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (Closed) Base URL: https://skia.googlesource.com/skia.git@things
Patch Set: 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 28c811de222bfa285e41dcc3dea62a52fd056d47..3eee43d1474cb058c336bdf770550cd870049cc7 100644
--- a/gm/dcshader.cpp
+++ b/gm/dcshader.cpp
@@ -10,7 +10,6 @@
#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"
@@ -34,8 +33,9 @@
buf.writeMatrix(fDeviceMatrix);
}
- const GrFragmentProcessor* asFragmentProcessor(GrContext*, const SkMatrix& viewM,
- const SkMatrix* localMatrix, SkFilterQuality, GrProcessorDataManager*) const override;
+ bool asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMatrix& viewM,
+ const SkMatrix* localMatrix, GrColor* color, GrProcessorDataManager*,
+ GrFragmentProcessor** fp) const override;
#ifndef SK_IGNORE_TO_STRING
void toString(SkString* str) const override {
@@ -94,10 +94,13 @@
GrCoordTransform fDeviceTransform;
};
-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);
+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;
}
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