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

Unified Diff: src/gpu/GrXferProcessor.cpp

Issue 1125283005: Only discard for XP dstCopies if we have a coverage value. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 5 years, 7 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/effects/SkArithmeticMode_gpu.cpp ('k') | src/gpu/effects/GrCoverageSetOpXP.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrXferProcessor.cpp
diff --git a/src/gpu/GrXferProcessor.cpp b/src/gpu/GrXferProcessor.cpp
index 243b9feb3f32edd6cee2386aaf10d91fb135f89b..bc79b2dbe1a3ea71c895a33a2886d6b91b57c899 100644
--- a/src/gpu/GrXferProcessor.cpp
+++ b/src/gpu/GrXferProcessor.cpp
@@ -8,11 +8,13 @@
#include "GrXferProcessor.h"
#include "gl/GrGLCaps.h"
-GrXferProcessor::GrXferProcessor() : fWillReadDstColor(false), fDstCopyTextureOffset() {
+GrXferProcessor::GrXferProcessor()
+ : fWillReadDstColor(false), fReadsCoverage(true), fDstCopyTextureOffset() {
}
GrXferProcessor::GrXferProcessor(const GrDeviceCoordTexture* dstCopy, bool willReadDstColor)
: fWillReadDstColor(willReadDstColor)
+ , fReadsCoverage(true)
, fDstCopyTextureOffset() {
if (dstCopy && dstCopy->texture()) {
fDstCopy.reset(dstCopy->texture());
@@ -22,6 +24,23 @@ GrXferProcessor::GrXferProcessor(const GrDeviceCoordTexture* dstCopy, bool willR
}
}
+GrXferProcessor::OptFlags GrXferProcessor::getOptimizations(const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& coveragePOI,
+ bool doesStencilWrite,
+ GrColor* overrideColor,
+ const GrDrawTargetCaps& caps) {
+ GrXferProcessor::OptFlags flags = this->onGetOptimizations(colorPOI,
+ coveragePOI,
+ doesStencilWrite,
+ overrideColor,
+ caps);
+
+ if (flags & GrXferProcessor::kIgnoreCoverage_OptFlag) {
+ fReadsCoverage = false;
+ }
+ return flags;
+}
+
void GrXferProcessor::getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
uint32_t key = this->willReadDstColor() ? 0x1 : 0x0;
if (this->getDstCopyTexture() &&
« no previous file with comments | « src/effects/SkArithmeticMode_gpu.cpp ('k') | src/gpu/effects/GrCoverageSetOpXP.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698