Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/gpu/GrDrawTarget.cpp

Issue 1121463002: Move bounds to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
170 // Batch bounds are tight, so for dev copies and clipping we outset;
171 SkRect bounds = batch->bounds();
172 bounds.outset(0.5f, 0.5f);
173
171 // Setup clip 174 // Setup clip
172 GrScissorState scissorState; 175 GrScissorState scissorState;
173 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; 176 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp;
174 GrPipelineBuilder::AutoRestoreStencil ars; 177 GrPipelineBuilder::AutoRestoreStencil ars;
175 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, devBounds) ) { 178 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, &bounds)) {
bsalomon 2015/04/30 18:53:23 did you try doing the outsetting after clipping? W
joshualitt 2015/05/01 13:49:58 Acknowledged.
176 return; 179 return;
177 } 180 }
178 181
179 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, batc h, devBounds, this); 182 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, batc h, &bounds, this);
bsalomon 2015/04/30 18:53:24 should the bounds be a required param now (non-ptr
joshualitt 2015/05/01 13:49:58 I can't do this until path is in batch
180 if (pipelineInfo.mustSkipDraw()) { 183 if (pipelineInfo.mustSkipDraw()) {
181 return; 184 return;
182 } 185 }
183 186
184 this->onDrawBatch(batch, pipelineInfo); 187 this->onDrawBatch(batch, pipelineInfo);
185 } 188 }
186 189
187 static const GrStencilSettings& winding_path_stencil_settings() { 190 static const GrStencilSettings& winding_path_stencil_settings() {
188 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, 191 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings,
189 kIncClamp_StencilOp, 192 kIncClamp_StencilOp,
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 GrPipelineBuilder::AutoRestoreFragmentProcessors* a rfp, 788 GrPipelineBuilder::AutoRestoreFragmentProcessors* a rfp,
786 GrPipelineBuilder::AutoRestoreStencil* ars, 789 GrPipelineBuilder::AutoRestoreStencil* ars,
787 GrScissorState* scissorState, 790 GrScissorState* scissorState,
788 const SkRect* devBounds) { 791 const SkRect* devBounds) {
789 return fClipMaskManager.setupClipping(pipelineBuilder, 792 return fClipMaskManager.setupClipping(pipelineBuilder,
790 arfp, 793 arfp,
791 ars, 794 ars,
792 scissorState, 795 scissorState,
793 devBounds); 796 devBounds);
794 } 797 }
OLDNEW
« src/gpu/GrBatch.h ('K') | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698