diff options
author | cdalton <cdalton@nvidia.com> | 2015-06-08 12:14:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-08 12:14:44 -0700 |
commit | edbb31f7ddea834b8e55ea66587ea8d33adc53fa (patch) | |
tree | 15ddac4ce23919b8b8f5c60b8dfe2e623ca35dac /src/gpu/gl/GrGLXferProcessor.h | |
parent | c31af44336f5eb4a50e83e76e51962d46c3ed458 (diff) |
Apply coverage in XP base class when using dst reads
Moves the coverage logic into GrGLXferProcessor for XPs that perform
dst reads. XPs that don't use a dst read are still responsible to
handle coverage on their own.
BUG=skia:
Review URL: https://codereview.chromium.org/1170553002
Diffstat (limited to 'src/gpu/gl/GrGLXferProcessor.h')
-rw-r--r-- | src/gpu/gl/GrGLXferProcessor.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLXferProcessor.h b/src/gpu/gl/GrGLXferProcessor.h index 6b05dcb37d..4b913d5a98 100644 --- a/src/gpu/gl/GrGLXferProcessor.h +++ b/src/gpu/gl/GrGLXferProcessor.h @@ -59,7 +59,24 @@ 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 emitOutputsForBlendState(const EmitArgs&) { + SkFAIL("emitOutputsForBlendState not implemented."); + } + + /** + * 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 emitBlendCodeForDstRead(GrGLXPBuilder*, const char* srcColor, const char* dstColor, + const char* outColor, const GrXferProcessor&) { + SkFAIL("emitBlendCodeForDstRead not implemented."); + } virtual void onSetData(const GrGLProgramDataManager&, const GrXferProcessor&) = 0; |