| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 this->onFlush(); | 157 this->onFlush(); |
| 158 | 158 |
| 159 this->getGpu()->restoreActiveTraceMarkers(); | 159 this->getGpu()->restoreActiveTraceMarkers(); |
| 160 | 160 |
| 161 fFlushing = false; | 161 fFlushing = false; |
| 162 this->reset(); | 162 this->reset(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void GrDrawTarget::drawBatch(GrPipelineBuilder* pipelineBuilder, | 165 void GrDrawTarget::drawBatch(GrPipelineBuilder* pipelineBuilder, |
| 166 GrBatch* batch, | 166 GrBatch* batch) { |
| 167 const SkRect* devBounds) { | |
| 168 SkASSERT(pipelineBuilder); | 167 SkASSERT(pipelineBuilder); |
| 169 // TODO some kind of checkdraw, but not at this level | 168 // TODO some kind of checkdraw, but not at this level |
| 170 | 169 |
| 171 // Setup clip | 170 // Setup clip |
| 172 GrScissorState scissorState; | 171 GrScissorState scissorState; |
| 173 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; | 172 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; |
| 174 GrPipelineBuilder::AutoRestoreStencil ars; | 173 GrPipelineBuilder::AutoRestoreStencil ars; |
| 175 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, devBounds)
) { | 174 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, &batch->bo
unds())) { |
| 176 return; | 175 return; |
| 177 } | 176 } |
| 178 | 177 |
| 179 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, batc
h, devBounds, this); | 178 // Batch bounds are tight, so for dev copies |
| 179 // TODO move this into setupDstReadIfNecessary when paths are in batch |
| 180 SkRect bounds = batch->bounds(); |
| 181 bounds.outset(0.5f, 0.5f); |
| 182 |
| 183 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, batc
h, &bounds, |
| 184 this); |
| 180 if (pipelineInfo.mustSkipDraw()) { | 185 if (pipelineInfo.mustSkipDraw()) { |
| 181 return; | 186 return; |
| 182 } | 187 } |
| 183 | 188 |
| 184 this->onDrawBatch(batch, pipelineInfo); | 189 this->onDrawBatch(batch, pipelineInfo); |
| 185 } | 190 } |
| 186 | 191 |
| 187 static const GrStencilSettings& winding_path_stencil_settings() { | 192 static const GrStencilSettings& winding_path_stencil_settings() { |
| 188 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, | 193 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, |
| 189 kIncClamp_StencilOp, | 194 kIncClamp_StencilOp, |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, | 790 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, |
| 786 GrPipelineBuilder::AutoRestoreStencil* ars, | 791 GrPipelineBuilder::AutoRestoreStencil* ars, |
| 787 GrScissorState* scissorState, | 792 GrScissorState* scissorState, |
| 788 const SkRect* devBounds) { | 793 const SkRect* devBounds) { |
| 789 return fClipMaskManager.setupClipping(pipelineBuilder, | 794 return fClipMaskManager.setupClipping(pipelineBuilder, |
| 790 arfp, | 795 arfp, |
| 791 ars, | 796 ars, |
| 792 scissorState, | 797 scissorState, |
| 793 devBounds); | 798 devBounds); |
| 794 } | 799 } |
| OLD | NEW |