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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 , fScissor(scissor) { | 533 , fScissor(scissor) { |
534 fColorPOI = fPipelineBuilder->colorProcInfo(batch); | 534 fColorPOI = fPipelineBuilder->colorProcInfo(batch); |
535 fCoveragePOI = fPipelineBuilder->coverageProcInfo(batch); | 535 fCoveragePOI = fPipelineBuilder->coverageProcInfo(batch); |
536 if (!target->setupDstReadIfNecessary(*fPipelineBuilder, fColorPOI, fCoverage
POI, | 536 if (!target->setupDstReadIfNecessary(*fPipelineBuilder, fColorPOI, fCoverage
POI, |
537 &fDstTexture, devBounds)) { | 537 &fDstTexture, devBounds)) { |
538 fPipelineBuilder = NULL; | 538 fPipelineBuilder = NULL; |
539 } | 539 } |
540 } | 540 } |
541 | 541 |
542 /////////////////////////////////////////////////////////////////////////////// | 542 /////////////////////////////////////////////////////////////////////////////// |
| 543 GrClipTarget::GrClipTarget(GrContext* context) : INHERITED(context) { |
| 544 fClipMaskManager.reset(SkNEW_ARGS(GrClipMaskManager, (this))); |
| 545 } |
| 546 |
543 | 547 |
544 bool GrClipTarget::setupClip(GrPipelineBuilder* pipelineBuilder, | 548 bool GrClipTarget::setupClip(GrPipelineBuilder* pipelineBuilder, |
545 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, | 549 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, |
546 GrPipelineBuilder::AutoRestoreStencil* ars, | 550 GrPipelineBuilder::AutoRestoreStencil* ars, |
547 GrScissorState* scissorState, | 551 GrScissorState* scissorState, |
548 const SkRect* devBounds) { | 552 const SkRect* devBounds) { |
549 return fClipMaskManager.setupClipping(pipelineBuilder, | 553 return fClipMaskManager->setupClipping(pipelineBuilder, |
550 arfp, | 554 arfp, |
551 ars, | 555 ars, |
552 scissorState, | 556 scissorState, |
553 devBounds); | 557 devBounds); |
554 } | 558 } |
| 559 |
| 560 void GrClipTarget::purgeResources() { |
| 561 // The clip mask manager can rebuild all its clip masks so just |
| 562 // get rid of them all. |
| 563 fClipMaskManager->purgeResources(); |
| 564 }; |
OLD | NEW |