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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
214 fBatches[i]->draw(flushState); | 214 fBatches[i]->draw(flushState); |
215 } | 215 } |
216 | 216 |
217 fGpu->finishDrawTarget(); | 217 fGpu->finishDrawTarget(); |
218 } | 218 } |
219 | 219 |
220 void GrDrawTarget::reset() { | 220 void GrDrawTarget::reset() { |
221 fBatches.reset(); | 221 fBatches.reset(); |
222 } | 222 } |
223 | 223 |
224 void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, GrDrawBat ch* batch) { | 224 void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder, |
225 GrDrawBatch* batch, | |
226 const SkIRect* scissorRect) { | |
225 // Setup clip | 227 // Setup clip |
226 GrPipelineBuilder::AutoRestoreStencil ars; | 228 GrPipelineBuilder::AutoRestoreStencil ars; |
227 GrAppliedClip clip; | 229 GrAppliedClip clip; |
228 if (!fClipMaskManager->setupClipping(pipelineBuilder, &ars, &batch->bounds() , &clip)) { | 230 |
229 return; | 231 if (scissorRect) { |
232 SkASSERT(GrClip::kWideOpen_ClipType == pipelineBuilder.clip().clipType() ); | |
bsalomon
2016/03/01 17:38:55
Maybe this warrants a separate entry with clearer
robertphillips
2016/03/01 20:11:57
I would like to hold off on that until the drawBat
| |
233 if (!fClipMaskManager->setupScissorClip(pipelineBuilder, &ars, *scissorR ect, | |
234 &batch->bounds(), &clip)) { | |
235 return; | |
236 } | |
237 } else { | |
238 if (!fClipMaskManager->setupClipping(pipelineBuilder, &ars, &batch->boun ds(), &clip)) { | |
239 return; | |
240 } | |
230 } | 241 } |
242 | |
231 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; | 243 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; |
232 if (clip.clipCoverageFragmentProcessor()) { | 244 if (clip.clipCoverageFragmentProcessor()) { |
233 arfps.set(&pipelineBuilder); | 245 arfps.set(&pipelineBuilder); |
234 arfps.addCoverageFragmentProcessor(clip.clipCoverageFragmentProcessor()) ; | 246 arfps.addCoverageFragmentProcessor(clip.clipCoverageFragmentProcessor()) ; |
235 } | 247 } |
236 | 248 |
237 GrPipeline::CreateArgs args; | 249 GrPipeline::CreateArgs args; |
238 if (!this->installPipelineInDrawBatch(&pipelineBuilder, &clip.scissorState() , batch)) { | 250 if (!this->installPipelineInDrawBatch(&pipelineBuilder, &clip.scissorState() , batch)) { |
239 return; | 251 return; |
240 } | 252 } |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
534 } | 546 } |
535 | 547 |
536 return true; | 548 return true; |
537 } | 549 } |
538 | 550 |
539 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) { | 551 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) { |
540 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 552 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
541 this->recordBatch(batch); | 553 this->recordBatch(batch); |
542 batch->unref(); | 554 batch->unref(); |
543 } | 555 } |
OLD | NEW |