| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 "GrDrawTarget.h" | 8 #include "GrDrawTarget.h" |
| 9 | 9 |
| 10 #include "GrAuditTrail.h" | 10 #include "GrAuditTrail.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 } | 322 } |
| 323 | 323 |
| 324 void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, | 324 void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, |
| 325 GrDrawContext* drawContext, | 325 GrDrawContext* drawContext, |
| 326 const GrClip& clip, | 326 const GrClip& clip, |
| 327 GrDrawBatch* batch) { | 327 GrDrawBatch* batch) { |
| 328 // Setup clip | 328 // Setup clip |
| 329 GrAppliedClip appliedClip; | 329 GrAppliedClip appliedClip; |
| 330 SkRect bounds; | 330 SkRect bounds; |
| 331 batch_bounds(&bounds, batch); | 331 batch_bounds(&bounds, batch); |
| 332 if (!clip.apply(fContext, pipelineBuilder, drawContext, &bounds, &appliedCli
p)) { | 332 if (!clip.isWideOpen() && !clip.apply(fContext, pipelineBuilder, drawContext
, &bounds, &appliedClip)) { |
| 333 return; | 333 return; |
| 334 } | 334 } |
| 335 | 335 |
| 336 // TODO: this is the only remaining usage of the AutoRestoreFragmentProcesso
rState - remove it | 336 // TODO: this is the only remaining usage of the AutoRestoreFragmentProcesso
rState - remove it |
| 337 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; | 337 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; |
| 338 if (appliedClip.getClipCoverageFragmentProcessor()) { | 338 if (appliedClip.getClipCoverageFragmentProcessor()) { |
| 339 arfps.set(&pipelineBuilder); | 339 arfps.set(&pipelineBuilder); |
| 340 arfps.addCoverageFragmentProcessor(sk_ref_sp(appliedClip.getClipCoverage
FragmentProcessor())); | 340 arfps.addCoverageFragmentProcessor(sk_ref_sp(appliedClip.getClipCoverage
FragmentProcessor())); |
| 341 } | 341 } |
| 342 | 342 |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 } | 626 } |
| 627 } | 627 } |
| 628 | 628 |
| 629 /////////////////////////////////////////////////////////////////////////////// | 629 /////////////////////////////////////////////////////////////////////////////// |
| 630 | 630 |
| 631 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 631 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
| 632 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 632 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
| 633 this->recordBatch(batch, batch->bounds()); | 633 this->recordBatch(batch, batch->bounds()); |
| 634 batch->unref(); | 634 batch->unref(); |
| 635 } | 635 } |
| OLD | NEW |