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

Unified Diff: src/gpu/GrDrawState.cpp

Issue 15001035: Don't make dst copies when color stage requires dst but color writes are disabled. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: alignment Created 7 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/gpu/GrDrawState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.cpp
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 90188ea788fefd598adc1d1c7d6a02e94f68c2d7..591e157129af4aa7846cda18bf949ec4f8e04861 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -163,6 +163,16 @@ bool GrDrawState::validateVertexAttribs() const {
return true;
}
+bool GrDrawState::willEffectReadDstColor() const {
+ int startStage = this->isColorWriteDisabled() ? this->getFirstCoverageStage() : 0;
+ for (int s = startStage; s < kNumStages; ++s) {
+ if (this->isStageEnabled(s) && (*this->getStage(s).getEffect())->willReadDstColor()) {
+ return true;
+ }
+ }
+ return false;
+}
+
////////////////////////////////////////////////////////////////////////////////
bool GrDrawState::srcAlphaWillBeOne() const {
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698