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

Unified Diff: src/gpu/effects/GrCustomXfermode.cpp

Issue 900883002: Revert of Move DstCopy on gpu into the GrXferProcessor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 | « src/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrCustomXfermodePriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrCustomXfermode.cpp
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index b77bf2fad174771a22f24ae2c00db09a50fed260..9aa71531096c0db3418626ba2c5e4c1d0890aab2 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -499,6 +499,20 @@
GLCustomXP(const GrXferProcessor&) {}
~GLCustomXP() SK_OVERRIDE {}
+ void emitCode(const EmitArgs& args) SK_OVERRIDE {
+ SkXfermode::Mode mode = args.fXP.cast<GrCustomXP>().mode();
+ GrGLFPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ const char* dstColor = fsBuilder->dstColor();
+
+ emit_custom_xfermode_code(mode, fsBuilder, args.fOutputPrimary, args.fInputColor, dstColor);
+
+ fsBuilder->codeAppendf("%s = %s * %s + (vec4(1.0) - %s) * %s;",
+ args.fOutputPrimary, args.fOutputPrimary, args.fInputCoverage,
+ args.fInputCoverage, dstColor);
+ }
+
+ void setData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERRIDE {}
+
static void GenKey(const GrXferProcessor& proc, const GrGLCaps&, GrProcessorKeyBuilder* b) {
uint32_t key = proc.numTextures();
SkASSERT(key <= 1);
@@ -507,32 +521,18 @@
}
private:
- void onEmitCode(const EmitArgs& args) SK_OVERRIDE {
- SkXfermode::Mode mode = args.fXP.cast<GrCustomXP>().mode();
- GrGLFPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
- const char* dstColor = fsBuilder->dstColor();
-
- emit_custom_xfermode_code(mode, fsBuilder, args.fOutputPrimary, args.fInputColor, dstColor);
-
- fsBuilder->codeAppendf("%s = %s * %s + (vec4(1.0) - %s) * %s;",
- args.fOutputPrimary, args.fOutputPrimary, args.fInputCoverage,
- args.fInputCoverage, dstColor);
- }
-
- void onSetData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERRIDE {}
-
typedef GrGLFragmentProcessor INHERITED;
};
///////////////////////////////////////////////////////////////////////////////
-GrCustomXP::GrCustomXP(SkXfermode::Mode mode, const GrDeviceCoordTexture* dstCopy,
- bool willReadDstColor)
- : INHERITED(dstCopy, willReadDstColor), fMode(mode) {
+GrCustomXP::GrCustomXP(SkXfermode::Mode mode)
+ : fMode(mode) {
this->initClassID<GrCustomXP>();
-}
-
-void GrCustomXP::onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
+ this->setWillReadDstColor();
+}
+
+void GrCustomXP::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const {
GLCustomXP::GenKey(*this, caps, b);
}
« no previous file with comments | « src/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrCustomXfermodePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698