Another small fix for reordering
authorjoshualitt <joshualitt@chromium.org>
Thu, 6 Aug 2015 15:39:22 +0000 (08:39 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 6 Aug 2015 15:39:22 +0000 (08:39 -0700)
BUG=skia:

Review URL: https://codereview.chromium.org/1274763008

src/gpu/GrReorderCommandBuilder.cpp

index 4dc2201..151b516 100644 (file)
@@ -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 ||