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

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

Issue 1333383002: Move some of the adding stencil attachment logic of Gpu and into Render Target. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: spelling Created 5 years, 3 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/GrDrawContext.cpp ('k') | src/gpu/GrGpu.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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; 208 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps;
209 GrPipelineBuilder::AutoRestoreStencil ars; 209 GrPipelineBuilder::AutoRestoreStencil ars;
210 210
211 if (!fClipMaskManager->setupClipping(pipelineBuilder, &arfps, &ars, &scissor State, nullptr)) { 211 if (!fClipMaskManager->setupClipping(pipelineBuilder, &arfps, &ars, &scissor State, nullptr)) {
212 return; 212 return;
213 } 213 }
214 214
215 // set stencil settings for path 215 // set stencil settings for path
216 GrStencilSettings stencilSettings; 216 GrStencilSettings stencilSettings;
217 GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); 217 GrRenderTarget* rt = pipelineBuilder.getRenderTarget();
218 GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment(); 218 GrStencilAttachment* sb = fResourceProvider->attachStencilAttachment(rt);
219 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings); 219 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings);
220 220
221 GrBatch* batch = GrStencilPathBatch::Create(viewMatrix, 221 GrBatch* batch = GrStencilPathBatch::Create(viewMatrix,
222 pipelineBuilder.isHWAntialias(), 222 pipelineBuilder.isHWAntialias(),
223 stencilSettings, scissorState, 223 stencilSettings, scissorState,
224 pipelineBuilder.getRenderTarget( ), 224 pipelineBuilder.getRenderTarget( ),
225 path); 225 path);
226 this->recordBatch(batch); 226 this->recordBatch(batch);
227 batch->unref(); 227 batch->unref();
228 } 228 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; 263 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps;
264 GrPipelineBuilder::AutoRestoreStencil ars; 264 GrPipelineBuilder::AutoRestoreStencil ars;
265 if (!fClipMaskManager->setupClipping(pipelineBuilder, &arfps, &ars, &scissor State, 265 if (!fClipMaskManager->setupClipping(pipelineBuilder, &arfps, &ars, &scissor State,
266 &batch->bounds())) { 266 &batch->bounds())) {
267 return; 267 return;
268 } 268 }
269 269
270 // Ensure the render target has a stencil buffer and get the stencil setting s. 270 // Ensure the render target has a stencil buffer and get the stencil setting s.
271 GrStencilSettings stencilSettings; 271 GrStencilSettings stencilSettings;
272 GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); 272 GrRenderTarget* rt = pipelineBuilder.getRenderTarget();
273 GrStencilAttachment* sb = rt->renderTargetPriv().attachStencilAttachment(); 273 GrStencilAttachment* sb = fResourceProvider->attachStencilAttachment(rt);
274 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings); 274 this->getPathStencilSettingsForFilltype(fill, sb, &stencilSettings);
275 batch->setStencilSettings(stencilSettings); 275 batch->setStencilSettings(stencilSettings);
276 276
277 GrPipeline::CreateArgs args; 277 GrPipeline::CreateArgs args;
278 if (!this->installPipelineInDrawBatch(&pipelineBuilder, &scissorState, batch )) { 278 if (!this->installPipelineInDrawBatch(&pipelineBuilder, &scissorState, batch )) {
279 return; 279 return;
280 } 280 }
281 281
282 this->recordBatch(batch); 282 this->recordBatch(batch);
283 } 283 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 458 }
459 459
460 return true; 460 return true;
461 } 461 }
462 462
463 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) { 463 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) {
464 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); 464 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt);
465 this->recordBatch(batch); 465 this->recordBatch(batch);
466 batch->unref(); 466 batch->unref();
467 } 467 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698