Index: src/gpu/GrReorderCommandBuilder.cpp |
diff --git a/src/gpu/GrReorderCommandBuilder.cpp b/src/gpu/GrReorderCommandBuilder.cpp |
index 4dc2201325852ef2f415d7958caea161356ce4f1..cf784b0c2de9217a58ddb046b361fd571da377a0 100644 |
--- a/src/gpu/GrReorderCommandBuilder.cpp |
+++ b/src/gpu/GrReorderCommandBuilder.cpp |
@@ -32,11 +32,10 @@ GrTargetCommands::Cmd* GrReorderCommandBuilder::recordDrawBatch(State* state, Gr |
if (Cmd::kDrawBatch_CmdType == reverseIter->type()) { |
DrawBatch* previous = static_cast<DrawBatch*>(reverseIter.get()); |
- // We cannot continue to search backwards if the render target changes |
if (previous->fBatch->pipeline()->getRenderTarget() != rt) { |
break; |
} |
- |
+ // We cannot continue to search backwards if the render target changes |
if (previous->fBatch->combineIfPossible(batch)) { |
return NULL; |
} |
@@ -47,10 +46,11 @@ GrTargetCommands::Cmd* GrReorderCommandBuilder::recordDrawBatch(State* state, Gr |
} else if (Cmd::kClear_CmdType == reverseIter->type()) { |
Clear* previous = static_cast<Clear*>(reverseIter.get()); |
+ 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 || |
- previous->fCanIgnoreRect || |
intersect(batch->bounds(), previous->fRect)) { |
break; |
} |