| 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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 GrBatch* candidate = fBatches.fromBack(i); | 453 GrBatch* candidate = fBatches.fromBack(i); |
| 454 // We cannot continue to search backwards if the render target chang
es | 454 // We cannot continue to search backwards if the render target chang
es |
| 455 if (candidate->renderTargetUniqueID() != batch->renderTargetUniqueID
()) { | 455 if (candidate->renderTargetUniqueID() != batch->renderTargetUniqueID
()) { |
| 456 GrBATCH_INFO("\t\tBreaking because of (%s, B%u) Rendertarget\n", | 456 GrBATCH_INFO("\t\tBreaking because of (%s, B%u) Rendertarget\n", |
| 457 candidate->name(), candidate->uniqueID()); | 457 candidate->name(), candidate->uniqueID()); |
| 458 break; | 458 break; |
| 459 } | 459 } |
| 460 if (candidate->combineIfPossible(batch, *this->caps())) { | 460 if (candidate->combineIfPossible(batch, *this->caps())) { |
| 461 GrBATCH_INFO("\t\tCombining with (%s, B%u)\n", candidate->name()
, | 461 GrBATCH_INFO("\t\tCombining with (%s, B%u)\n", candidate->name()
, |
| 462 candidate->uniqueID()); | 462 candidate->uniqueID()); |
| 463 GR_AUDIT_TRAIL_BATCHING_RESULT_COMBINED(fAuditTrail, candidate); |
| 463 return; | 464 return; |
| 464 } | 465 } |
| 465 // Stop going backwards if we would cause a painter's order violatio
n. | 466 // Stop going backwards if we would cause a painter's order violatio
n. |
| 466 // TODO: The bounds used here do not fully consider the clip. It may
be advantageous | 467 // TODO: The bounds used here do not fully consider the clip. It may
be advantageous |
| 467 // to clip each batch's bounds to the clip. | 468 // to clip each batch's bounds to the clip. |
| 468 if (intersect(candidate->bounds(), batch->bounds())) { | 469 if (intersect(candidate->bounds(), batch->bounds())) { |
| 469 GrBATCH_INFO("\t\tIntersects with (%s, B%u)\n", candidate->name(
), | 470 GrBATCH_INFO("\t\tIntersects with (%s, B%u)\n", candidate->name(
), |
| 470 candidate->uniqueID()); | 471 candidate->uniqueID()); |
| 471 break; | 472 break; |
| 472 } | 473 } |
| 473 ++i; | 474 ++i; |
| 474 if (i == maxCandidates) { | 475 if (i == maxCandidates) { |
| 475 GrBATCH_INFO("\t\tReached max lookback or beginning of batch arr
ay %d\n", i); | 476 GrBATCH_INFO("\t\tReached max lookback or beginning of batch arr
ay %d\n", i); |
| 476 break; | 477 break; |
| 477 } | 478 } |
| 478 } | 479 } |
| 479 } else { | 480 } else { |
| 480 GrBATCH_INFO("\t\tFirstBatch\n"); | 481 GrBATCH_INFO("\t\tFirstBatch\n"); |
| 481 } | 482 } |
| 483 GR_AUDIT_TRAIL_BATCHING_RESULT_NEW(fAuditTrail, batch); |
| 482 fBatches.push_back().reset(SkRef(batch)); | 484 fBatches.push_back().reset(SkRef(batch)); |
| 483 } | 485 } |
| 484 | 486 |
| 485 /////////////////////////////////////////////////////////////////////////////// | 487 /////////////////////////////////////////////////////////////////////////////// |
| 486 | 488 |
| 487 bool GrDrawTarget::installPipelineInDrawBatch(const GrPipelineBuilder* pipelineB
uilder, | 489 bool GrDrawTarget::installPipelineInDrawBatch(const GrPipelineBuilder* pipelineB
uilder, |
| 488 const GrScissorState* scissor, | 490 const GrScissorState* scissor, |
| 489 GrDrawBatch* batch) { | 491 GrDrawBatch* batch) { |
| 490 GrPipeline::CreateArgs args; | 492 GrPipeline::CreateArgs args; |
| 491 args.fPipelineBuilder = pipelineBuilder; | 493 args.fPipelineBuilder = pipelineBuilder; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 } | 534 } |
| 533 | 535 |
| 534 return true; | 536 return true; |
| 535 } | 537 } |
| 536 | 538 |
| 537 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 539 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
| 538 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 540 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
| 539 this->recordBatch(batch); | 541 this->recordBatch(batch); |
| 540 batch->unref(); | 542 batch->unref(); |
| 541 } | 543 } |
| OLD | NEW |