aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTargetOpList.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-04-20 11:52:43 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-20 16:30:15 +0000
commitdbdba60274515c4df02cb667d2f8e2738418855f (patch)
tree3e7b82b8898995531502f9ef585319dd81af92a7 /src/gpu/GrRenderTargetOpList.cpp
parentcb7b83113ba1f6add188d08e99181db46949bd18 (diff)
Add discard check when deciding if we should execute op list or not.
Bug: skia:7828 Change-Id: I339ba64b6312cd9444cd4faffd426d91852774e9 Reviewed-on: https://skia-review.googlesource.com/122784 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetOpList.cpp')
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 2d26d14281..47eb3a0789 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -133,7 +133,14 @@ static inline void finish_command_buffer(GrGpuRTCommandBuffer* buffer) {
// is at flush time). However, we need to store the RenderTargetProxy in the
// Ops and instantiate them here.
bool GrRenderTargetOpList::onExecute(GrOpFlushState* flushState) {
- if (0 == fRecordedOps.count() && GrLoadOp::kClear != fColorLoadOp) {
+ // TODO: Forcing the execution of the discard here isn't ideal since it will cause us to do a
+ // discard and then store the data back in memory so that the load op on future draws doesn't
+ // think the memory is unitialized. Ideally we would want a system where we are tracking whether
+ // the proxy itself has valid data or not, and then use that as a signal on whether we should be
+ // loading or discarding. In that world we wouldni;t need to worry about executing oplists with
+ // no ops just to do a discard.
+ if (0 == fRecordedOps.count() && GrLoadOp::kClear != fColorLoadOp &&
+ GrLoadOp::kDiscard != fColorLoadOp) {
return false;
}