Trim the copy of the dst made for dst-reading effects using the clip and dev-bounds of draw.
Adds dev bounds to circles and rects drawn by GrDrawTarget base class (GrIODB already provides rect bounds).
Author: bsalomon@google.com
Reviewed By: robertphilips@google.com,jvanverth@google.com,robertphillips@google.com
Review URL: https://chromiumcodereview.appspot.com/13222004
git-svn-id: http://skia.googlecode.com/svn/trunk@8453 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 002c4ed..d16efa8 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -507,6 +507,18 @@
}
}
}
+
+ /**
+ * Checks whether any of the effects will read the dst pixel color.
+ */
+ bool willEffectReadDst() const {
+ for (int s = 0; s < kNumStages; ++s) {
+ if (this->isStageEnabled(s) && (*this->getStage(s).getEffect())->willReadDst()) {
+ return true;
+ }
+ }
+ return false;
+ }
/// @}