aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-08-06 08:39:22 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-06 08:39:22 -0700
commitc8da81df6b7502bfd57eb34627efbc7cdda2afeb (patch)
tree289d7e4c01ac27933f838221c35a788ee9e1d08a
parentb6394746ff546a9c60d68e3be162cb38feffa803 (diff)
Another small fix for reordering
-rw-r--r--src/gpu/GrReorderCommandBuilder.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gpu/GrReorderCommandBuilder.cpp b/src/gpu/GrReorderCommandBuilder.cpp
index 4dc2201325..151b516dee 100644
--- a/src/gpu/GrReorderCommandBuilder.cpp
+++ b/src/gpu/GrReorderCommandBuilder.cpp
@@ -47,6 +47,11 @@ GrTargetCommands::Cmd* GrReorderCommandBuilder::recordDrawBatch(State* state, Gr
} else if (Cmd::kClear_CmdType == reverseIter->type()) {
Clear* previous = static_cast<Clear*>(reverseIter.get());
+ // We cannot continue to search backwards if the render target changes
+ if (previous->renderTarget() != rt) {
+ break;
+ }
+
// We set the color to illegal if we are doing a discard.
// If we can ignore the rect, then we do a full clear
if (previous->fColor == GrColor_ILLEGAL ||