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

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

Issue 1230023003: Modify GrClipMaskManager to reflect logical constness (Closed) Base URL: https://skia.googlesource.com/skia.git@proctomemorypool
Patch Set: deal with warnings Created 5 years, 5 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
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrPipelineBuilder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 void GrDrawTarget::drawBatch(GrPipelineBuilder* pipelineBuilder, 129 void GrDrawTarget::drawBatch(GrPipelineBuilder* pipelineBuilder,
130 GrBatch* batch) { 130 GrBatch* batch) {
131 SkASSERT(pipelineBuilder); 131 SkASSERT(pipelineBuilder);
132 // TODO some kind of checkdraw, but not at this level 132 // TODO some kind of checkdraw, but not at this level
133 133
134 // Setup clip 134 // Setup clip
135 GrScissorState scissorState; 135 GrScissorState scissorState;
136 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; 136 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp;
137 GrPipelineBuilder::AutoRestoreStencil ars; 137 GrPipelineBuilder::AutoRestoreStencil ars;
138 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, &batch->bo unds())) { 138 GrPipelineBuilder::AutoRestoreProcessorDataManager arpdm;
139 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &arpdm, &scissorState, &b atch->bounds())) {
139 return; 140 return;
140 } 141 }
141 142
142 // Batch bounds are tight, so for dev copies 143 // Batch bounds are tight, so for dev copies
143 // TODO move this into setupDstReadIfNecessary when paths are in batch 144 // TODO move this into setupDstReadIfNecessary when paths are in batch
144 SkRect bounds = batch->bounds(); 145 SkRect bounds = batch->bounds();
145 bounds.outset(0.5f, 0.5f); 146 bounds.outset(0.5f, 0.5f);
146 147
147 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, batc h, &bounds, 148 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, batc h, &bounds,
148 this); 149 this);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 GrPathRendering::FillType fill) { 195 GrPathRendering::FillType fill) {
195 // TODO: extract portions of checkDraw that are relevant to path stenciling. 196 // TODO: extract portions of checkDraw that are relevant to path stenciling.
196 SkASSERT(path); 197 SkASSERT(path);
197 SkASSERT(this->caps()->shaderCaps()->pathRenderingSupport()); 198 SkASSERT(this->caps()->shaderCaps()->pathRenderingSupport());
198 SkASSERT(pipelineBuilder); 199 SkASSERT(pipelineBuilder);
199 200
200 // Setup clip 201 // Setup clip
201 GrScissorState scissorState; 202 GrScissorState scissorState;
202 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; 203 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp;
203 GrPipelineBuilder::AutoRestoreStencil ars; 204 GrPipelineBuilder::AutoRestoreStencil ars;
204 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, NULL)) { 205 GrPipelineBuilder::AutoRestoreProcessorDataManager arpdm;
206 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &arpdm, &scissorState, NU LL)) {
205 return; 207 return;
206 } 208 }
207 209
208 // set stencil settings for path 210 // set stencil settings for path
209 GrStencilSettings stencilSettings; 211 GrStencilSettings stencilSettings;
210 GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); 212 GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
211 GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment(); 213 GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment();
212 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings); 214 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings);
213 215
214 this->onStencilPath(*pipelineBuilder, pathProc, path, scissorState, stencilS ettings); 216 this->onStencilPath(*pipelineBuilder, pathProc, path, scissorState, stencilS ettings);
215 } 217 }
216 218
217 void GrDrawTarget::drawPath(GrPipelineBuilder* pipelineBuilder, 219 void GrDrawTarget::drawPath(GrPipelineBuilder* pipelineBuilder,
218 const GrPathProcessor* pathProc, 220 const GrPathProcessor* pathProc,
219 const GrPath* path, 221 const GrPath* path,
220 GrPathRendering::FillType fill) { 222 GrPathRendering::FillType fill) {
221 // TODO: extract portions of checkDraw that are relevant to path rendering. 223 // TODO: extract portions of checkDraw that are relevant to path rendering.
222 SkASSERT(path); 224 SkASSERT(path);
223 SkASSERT(this->caps()->shaderCaps()->pathRenderingSupport()); 225 SkASSERT(this->caps()->shaderCaps()->pathRenderingSupport());
224 SkASSERT(pipelineBuilder); 226 SkASSERT(pipelineBuilder);
225 227
226 SkRect devBounds = path->getBounds(); 228 SkRect devBounds = path->getBounds();
227 pathProc->viewMatrix().mapRect(&devBounds); 229 pathProc->viewMatrix().mapRect(&devBounds);
228 230
229 // Setup clip 231 // Setup clip
230 GrScissorState scissorState; 232 GrScissorState scissorState;
231 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; 233 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp;
232 GrPipelineBuilder::AutoRestoreStencil ars; 234 GrPipelineBuilder::AutoRestoreStencil ars;
233 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, &devBounds )) { 235 GrPipelineBuilder::AutoRestoreProcessorDataManager arpdm;
236 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &arpdm, &scissorState, &d evBounds)) {
234 return; 237 return;
235 } 238 }
236 239
237 // set stencil settings for path 240 // set stencil settings for path
238 GrStencilSettings stencilSettings; 241 GrStencilSettings stencilSettings;
239 GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); 242 GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
240 GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment(); 243 GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment();
241 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings); 244 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings);
242 245
243 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, path Proc, &devBounds, 246 GrDrawTarget::PipelineInfo pipelineInfo(pipelineBuilder, &scissorState, path Proc, &devBounds,
(...skipping 18 matching lines...) Expand all
262 SkASSERT(pathRange); 265 SkASSERT(pathRange);
263 SkASSERT(indices); 266 SkASSERT(indices);
264 SkASSERT(0 == reinterpret_cast<long>(indices) % GrPathRange::PathIndexSizeIn Bytes(indexType)); 267 SkASSERT(0 == reinterpret_cast<long>(indices) % GrPathRange::PathIndexSizeIn Bytes(indexType));
265 SkASSERT(transformValues); 268 SkASSERT(transformValues);
266 SkASSERT(pipelineBuilder); 269 SkASSERT(pipelineBuilder);
267 270
268 // Setup clip 271 // Setup clip
269 GrScissorState scissorState; 272 GrScissorState scissorState;
270 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp; 273 GrPipelineBuilder::AutoRestoreFragmentProcessors arfp;
271 GrPipelineBuilder::AutoRestoreStencil ars; 274 GrPipelineBuilder::AutoRestoreStencil ars;
272 275 GrPipelineBuilder::AutoRestoreProcessorDataManager arpdm;
273 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &scissorState, NULL)) { 276 if (!this->setupClip(pipelineBuilder, &arfp, &ars, &arpdm, &scissorState, NU LL)) {
274 return; 277 return;
275 } 278 }
276 279
277 // set stencil settings for path 280 // set stencil settings for path
278 GrStencilSettings stencilSettings; 281 GrStencilSettings stencilSettings;
279 GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); 282 GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
280 GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment(); 283 GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment();
281 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings); 284 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings);
282 285
283 // Don't compute a bounding box for dst copy texture, we'll opt 286 // Don't compute a bounding box for dst copy texture, we'll opt
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 GrClipTarget::GrClipTarget(GrContext* context) 500 GrClipTarget::GrClipTarget(GrContext* context)
498 : INHERITED(context->getGpu(), context->resourceProvider()) 501 : INHERITED(context->getGpu(), context->resourceProvider())
499 , fContext(context) { 502 , fContext(context) {
500 fClipMaskManager.reset(SkNEW_ARGS(GrClipMaskManager, (this))); 503 fClipMaskManager.reset(SkNEW_ARGS(GrClipMaskManager, (this)));
501 } 504 }
502 505
503 506
504 bool GrClipTarget::setupClip(GrPipelineBuilder* pipelineBuilder, 507 bool GrClipTarget::setupClip(GrPipelineBuilder* pipelineBuilder,
505 GrPipelineBuilder::AutoRestoreFragmentProcessors* a rfp, 508 GrPipelineBuilder::AutoRestoreFragmentProcessors* a rfp,
506 GrPipelineBuilder::AutoRestoreStencil* ars, 509 GrPipelineBuilder::AutoRestoreStencil* ars,
510 GrPipelineBuilder::AutoRestoreProcessorDataManager* arpdm,
507 GrScissorState* scissorState, 511 GrScissorState* scissorState,
508 const SkRect* devBounds) { 512 const SkRect* devBounds) {
509 return fClipMaskManager->setupClipping(pipelineBuilder, 513 return fClipMaskManager->setupClipping(*pipelineBuilder,
510 arfp, 514 arfp,
511 ars, 515 ars,
512 scissorState, 516 arpdm,
513 devBounds); 517 scissorState,
518 devBounds);
514 } 519 }
515 520
516 void GrClipTarget::purgeResources() { 521 void GrClipTarget::purgeResources() {
517 // The clip mask manager can rebuild all its clip masks so just 522 // The clip mask manager can rebuild all its clip masks so just
518 // get rid of them all. 523 // get rid of them all.
519 fClipMaskManager->purgeResources(); 524 fClipMaskManager->purgeResources();
520 }; 525 };
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrPipelineBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698