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

Unified Diff: src/gpu/gl/GrGLXferProcessor.h

Issue 1170553002: Apply coverage in XP base class when using dst reads (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_reenablebea
Patch Set: Created 5 years, 6 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/GrPorterDuffXferProcessor.cpp ('k') | src/gpu/gl/GrGLXferProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLXferProcessor.h
diff --git a/src/gpu/gl/GrGLXferProcessor.h b/src/gpu/gl/GrGLXferProcessor.h
index 6b05dcb37d6b653c76144c5e9b2336bc404ae5fe..265eb9fe7e86b5880be25afe9c2f32bf0cac744e 100644
--- a/src/gpu/gl/GrGLXferProcessor.h
+++ b/src/gpu/gl/GrGLXferProcessor.h
@@ -59,7 +59,22 @@ public:
void setData(const GrGLProgramDataManager& pdm, const GrXferProcessor& xp);
private:
- virtual void onEmitCode(const EmitArgs&) = 0;
+ /**
+ * Called by emitCode() when the XP will not be performing a dst read. This method is
+ * responsible for both blending and coverage. A subclass only needs to implement this method if
+ * it can construct a GrXferProcessor that will not read the dst color.
+ */
+ virtual void onEmitCode(const EmitArgs&) { SkFAIL("onEmitCode not implemented."); }
egdaniel 2015/06/05 16:44:01 So some pretty unhelpful feed back here...but some
Chris Dalton 2015/06/05 17:41:36 I've thought about it some and have come up with s
+
+ /**
+ * Called by emitCode() when the XP will perform a dst read. This method only needs to supply
+ * the blending logic. The base class applies coverage. A subclass only needs to implement this
+ * method if it can construct a GrXferProcessor that reads the dst color.
+ */
+ virtual void onEmitShaderBlend(GrGLXPBuilder*, const char* srcColor, const char* dstColor,
+ const char* outColor, const GrXferProcessor&) {
+ SkFAIL("onEmitShaderBlend not implemented.");
+ }
virtual void onSetData(const GrGLProgramDataManager&, const GrXferProcessor&) = 0;
« no previous file with comments | « src/gpu/effects/GrPorterDuffXferProcessor.cpp ('k') | src/gpu/gl/GrGLXferProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698