Don't make dst copies when color stage requires dst but color writes are disabled.
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/15001035
git-svn-id: http://skia.googlecode.com/svn/trunk@9146 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 90188ea..591e157 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -163,6 +163,16 @@
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 {