Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: src/gpu/GrReorderCommandBuilder.cpp

Issue 1274763008: Another small fix for reording (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrReorderCommandBuilder.h" 8 #include "GrReorderCommandBuilder.h"
9 9
10 template <class Left, class Right> 10 template <class Left, class Right>
(...skipping 29 matching lines...) Expand all
40 if (previous->fBatch->combineIfPossible(batch)) { 40 if (previous->fBatch->combineIfPossible(batch)) {
41 return NULL; 41 return NULL;
42 } 42 }
43 43
44 if (intersect(previous->fBatch->bounds(), batch->bounds())) { 44 if (intersect(previous->fBatch->bounds(), batch->bounds())) {
45 break; 45 break;
46 } 46 }
47 } else if (Cmd::kClear_CmdType == reverseIter->type()) { 47 } else if (Cmd::kClear_CmdType == reverseIter->type()) {
48 Clear* previous = static_cast<Clear*>(reverseIter.get()); 48 Clear* previous = static_cast<Clear*>(reverseIter.get());
49 49
50 // We cannot continue to search backwards if the render target c hanges
51 if (previous->renderTarget() != rt) {
52 break;
53 }
54
50 // We set the color to illegal if we are doing a discard. 55 // We set the color to illegal if we are doing a discard.
51 // If we can ignore the rect, then we do a full clear 56 // If we can ignore the rect, then we do a full clear
52 if (previous->fColor == GrColor_ILLEGAL || 57 if (previous->fColor == GrColor_ILLEGAL ||
53 previous->fCanIgnoreRect || 58 previous->fCanIgnoreRect ||
54 intersect(batch->bounds(), previous->fRect)) { 59 intersect(batch->bounds(), previous->fRect)) {
55 break; 60 break;
56 } 61 }
57 } else { 62 } else {
58 // TODO temporary until we can navigate the other types of comma nds 63 // TODO temporary until we can navigate the other types of comma nds
59 break; 64 break;
60 } 65 }
61 } while (reverseIter.previous() && ++i < kMaxLookback); 66 } while (reverseIter.previous() && ++i < kMaxLookback);
62 } 67 }
63 68
64 return GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), DrawBatch, (state, batch , 69 return GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), DrawBatch, (state, batch ,
65 this->batchT arget())); 70 this->batchT arget()));
66 } 71 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698