| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrDrawTarget.h" | 9 #include "GrDrawTarget.h" |
| 10 | 10 |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 GrBATCH_INFO("\t\tBreaking because of (%s, B%u) Rendertarget\n", | 501 GrBATCH_INFO("\t\tBreaking because of (%s, B%u) Rendertarget\n", |
| 502 candidate->name(), candidate->uniqueID()); | 502 candidate->name(), candidate->uniqueID()); |
| 503 break; | 503 break; |
| 504 } | 504 } |
| 505 if (candidate->combineIfPossible(batch, *this->caps())) { | 505 if (candidate->combineIfPossible(batch, *this->caps())) { |
| 506 GrBATCH_INFO("\t\tCombining with (%s, B%u)\n", candidate->name()
, | 506 GrBATCH_INFO("\t\tCombining with (%s, B%u)\n", candidate->name()
, |
| 507 candidate->uniqueID()); | 507 candidate->uniqueID()); |
| 508 return; | 508 return; |
| 509 } | 509 } |
| 510 // Stop going backwards if we would cause a painter's order violatio
n. | 510 // Stop going backwards if we would cause a painter's order violatio
n. |
| 511 // TODO: The bounds used here do not fully consider the clip. It may
be advantageous |
| 512 // to clip each batch's bounds to the clip. |
| 511 if (intersect(candidate->bounds(), batch->bounds())) { | 513 if (intersect(candidate->bounds(), batch->bounds())) { |
| 512 GrBATCH_INFO("\t\tIntersects with (%s, B%u)\n", candidate->name(
), | 514 GrBATCH_INFO("\t\tIntersects with (%s, B%u)\n", candidate->name(
), |
| 513 candidate->uniqueID()); | 515 candidate->uniqueID()); |
| 514 break; | 516 break; |
| 515 } | 517 } |
| 516 ++i; | 518 ++i; |
| 517 if (i == maxCandidates) { | 519 if (i == maxCandidates) { |
| 518 GrBATCH_INFO("\t\tReached max lookback or beginning of batch arr
ay %d\n", i); | 520 GrBATCH_INFO("\t\tReached max lookback or beginning of batch arr
ay %d\n", i); |
| 519 break; | 521 break; |
| 520 } | 522 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 547 } | 549 } |
| 548 | 550 |
| 549 return true; | 551 return true; |
| 550 } | 552 } |
| 551 | 553 |
| 552 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 554 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
| 553 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 555 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
| 554 this->recordBatch(batch); | 556 this->recordBatch(batch); |
| 555 batch->unref(); | 557 batch->unref(); |
| 556 } | 558 } |
| OLD | NEW |