OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 #include "GrDrawTarget.h" | 8 #include "GrDrawTarget.h" |
10 | 9 |
11 #include "GrAuditTrail.h" | 10 #include "GrAuditTrail.h" |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 // 2) intersect with something | 460 // 2) intersect with something |
462 // 3) find a 'blocker' | 461 // 3) find a 'blocker' |
463 GR_AUDIT_TRAIL_ADDBATCH(fAuditTrail, batch); | 462 GR_AUDIT_TRAIL_ADDBATCH(fAuditTrail, batch); |
464 GrBATCH_INFO("Re-Recording (%s, B%u)\n" | 463 GrBATCH_INFO("Re-Recording (%s, B%u)\n" |
465 "\tBounds LRTB (%f, %f, %f, %f)\n", | 464 "\tBounds LRTB (%f, %f, %f, %f)\n", |
466 batch->name(), | 465 batch->name(), |
467 batch->uniqueID(), | 466 batch->uniqueID(), |
468 batch->bounds().fLeft, batch->bounds().fRight, | 467 batch->bounds().fLeft, batch->bounds().fRight, |
469 batch->bounds().fTop, batch->bounds().fBottom); | 468 batch->bounds().fTop, batch->bounds().fBottom); |
470 GrBATCH_INFO(SkTabString(batch->dumpInfo(), 1).c_str()); | 469 GrBATCH_INFO(SkTabString(batch->dumpInfo(), 1).c_str()); |
471 GrBATCH_INFO("\tOutcome:\n"); | 470 GrBATCH_INFO("\tOutcome:\n"); |
472 int maxCandidates = SkTMin(fMaxBatchLookback, fBatches.count()); | 471 int maxCandidates = SkTMin(fMaxBatchLookback, fBatches.count()); |
473 if (maxCandidates) { | 472 if (maxCandidates) { |
474 int i = 0; | 473 int i = 0; |
475 while (true) { | 474 while (true) { |
476 GrBatch* candidate = fBatches.fromBack(i); | 475 GrBatch* candidate = fBatches.fromBack(i); |
477 // We cannot continue to search backwards if the render target chang
es | 476 // We cannot continue to search backwards if the render target chang
es |
478 if (candidate->renderTargetUniqueID() != batch->renderTargetUniqueID
()) { | 477 if (candidate->renderTargetUniqueID() != batch->renderTargetUniqueID
()) { |
479 GrBATCH_INFO("\t\tBreaking because of (%s, B%u) Rendertarget\n", | 478 GrBATCH_INFO("\t\tBreaking because of (%s, B%u) Rendertarget\n", |
480 candidate->name(), candidate->uniqueID()); | 479 candidate->name(), candidate->uniqueID()); |
481 break; | 480 break; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 batch->getPipelineOptimizations(&args.fOpts); | 560 batch->getPipelineOptimizations(&args.fOpts); |
562 GrScissorState finalScissor; | 561 GrScissorState finalScissor; |
563 if (args.fOpts.fOverrides.fUsePLSDstRead) { | 562 if (args.fOpts.fOverrides.fUsePLSDstRead) { |
564 GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); | 563 GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); |
565 GrGLIRect viewport; | 564 GrGLIRect viewport; |
566 viewport.fLeft = 0; | 565 viewport.fLeft = 0; |
567 viewport.fBottom = 0; | 566 viewport.fBottom = 0; |
568 viewport.fWidth = rt->width(); | 567 viewport.fWidth = rt->width(); |
569 viewport.fHeight = rt->height(); | 568 viewport.fHeight = rt->height(); |
570 SkIRect ibounds; | 569 SkIRect ibounds; |
571 ibounds.fLeft = SkTPin(SkScalarFloorToInt(batch->bounds().fLeft), viewpo
rt.fLeft, | 570 ibounds.fLeft = SkTPin(SkScalarFloorToInt(batch->bounds().fLeft), viewpo
rt.fLeft, |
572 viewport.fWidth); | 571 viewport.fWidth); |
573 ibounds.fTop = SkTPin(SkScalarFloorToInt(batch->bounds().fTop), viewport
.fBottom, | 572 ibounds.fTop = SkTPin(SkScalarFloorToInt(batch->bounds().fTop), viewport
.fBottom, |
574 viewport.fHeight); | 573 viewport.fHeight); |
575 ibounds.fRight = SkTPin(SkScalarCeilToInt(batch->bounds().fRight), viewp
ort.fLeft, | 574 ibounds.fRight = SkTPin(SkScalarCeilToInt(batch->bounds().fRight), viewp
ort.fLeft, |
576 viewport.fWidth); | 575 viewport.fWidth); |
577 ibounds.fBottom = SkTPin(SkScalarCeilToInt(batch->bounds().fBottom), vie
wport.fBottom, | 576 ibounds.fBottom = SkTPin(SkScalarCeilToInt(batch->bounds().fBottom), vie
wport.fBottom, |
578 viewport.fHeight); | 577 viewport.fHeight); |
579 if (scissor != nullptr && scissor->enabled()) { | 578 if (scissor != nullptr && scissor->enabled()) { |
580 if (!ibounds.intersect(scissor->rect())) { | 579 if (!ibounds.intersect(scissor->rect())) { |
581 ibounds = scissor->rect(); | 580 ibounds = scissor->rect(); |
582 } | 581 } |
583 } | 582 } |
584 finalScissor.set(ibounds); | 583 finalScissor.set(ibounds); |
585 args.fScissor = &finalScissor; | 584 args.fScissor = &finalScissor; |
586 } | 585 } |
587 args.fOpts.fColorPOI.completeCalculations(pipelineBuilder->fColorFragmentPro
cessors.begin(), | 586 args.fOpts.fColorPOI.completeCalculations(pipelineBuilder->fColorFragmentPro
cessors.begin(), |
(...skipping 11 matching lines...) Expand all Loading... |
599 } | 598 } |
600 | 599 |
601 return true; | 600 return true; |
602 } | 601 } |
603 | 602 |
604 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 603 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
605 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 604 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
606 this->recordBatch(batch); | 605 this->recordBatch(batch); |
607 batch->unref(); | 606 batch->unref(); |
608 } | 607 } |
OLD | NEW |