OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrDrawTarget.h" | 8 #include "GrDrawTarget.h" |
9 | 9 |
10 #include "GrAuditTrail.h" | 10 #include "GrAuditTrail.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 arfps.set(&pipelineBuilder); | 248 arfps.set(&pipelineBuilder); |
249 arfps.addCoverageFragmentProcessor(appliedClip.clipCoverageFragmentProce ssor()); | 249 arfps.addCoverageFragmentProcessor(appliedClip.clipCoverageFragmentProce ssor()); |
250 } | 250 } |
251 | 251 |
252 GrPipeline::CreateArgs args; | 252 GrPipeline::CreateArgs args; |
253 args.fPipelineBuilder = &pipelineBuilder; | 253 args.fPipelineBuilder = &pipelineBuilder; |
254 args.fCaps = this->caps(); | 254 args.fCaps = this->caps(); |
255 args.fScissor = &appliedClip.scissorState(); | 255 args.fScissor = &appliedClip.scissorState(); |
256 args.fHasStencilClip = appliedClip.hasStencilClip(); | 256 args.fHasStencilClip = appliedClip.hasStencilClip(); |
257 if (pipelineBuilder.hasUserStencilSettings() || appliedClip.hasStencilClip() ) { | 257 if (pipelineBuilder.hasUserStencilSettings() || appliedClip.hasStencilClip() ) { |
258 fResourceProvider->attachStencilAttachment(pipelineBuilder.getRenderTarg et()); | 258 if (!fResourceProvider->attachStencilAttachment(pipelineBuilder.getRende rTarget())) { |
259 return; | |
Chris Dalton
2016/05/13 16:56:55
Do we want to fail silently or print a debug messa
bsalomon
2016/05/13 17:43:01
It's probably a good idea to print here for now. W
Chris Dalton
2016/05/13 18:03:08
Done.
| |
260 } | |
259 } | 261 } |
260 batch->getPipelineOptimizations(&args.fOpts); | 262 batch->getPipelineOptimizations(&args.fOpts); |
261 GrScissorState finalScissor; | 263 GrScissorState finalScissor; |
262 if (args.fOpts.fOverrides.fUsePLSDstRead || fClipBatchToBounds) { | 264 if (args.fOpts.fOverrides.fUsePLSDstRead || fClipBatchToBounds) { |
263 GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); | 265 GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); |
264 GrGLIRect viewport; | 266 GrGLIRect viewport; |
265 viewport.fLeft = 0; | 267 viewport.fLeft = 0; |
266 viewport.fBottom = 0; | 268 viewport.fBottom = 0; |
267 viewport.fWidth = rt->width(); | 269 viewport.fWidth = rt->width(); |
268 viewport.fHeight = rt->height(); | 270 viewport.fHeight = rt->height(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 // TODO: respect fClipBatchToBounds if we ever start computing bounds here. | 325 // TODO: respect fClipBatchToBounds if we ever start computing bounds here. |
324 | 326 |
325 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; | 327 GrPipelineBuilder::AutoRestoreFragmentProcessorState arfps; |
326 if (appliedClip.clipCoverageFragmentProcessor()) { | 328 if (appliedClip.clipCoverageFragmentProcessor()) { |
327 arfps.set(&pipelineBuilder); | 329 arfps.set(&pipelineBuilder); |
328 arfps.addCoverageFragmentProcessor(appliedClip.clipCoverageFragmentProce ssor()); | 330 arfps.addCoverageFragmentProcessor(appliedClip.clipCoverageFragmentProce ssor()); |
329 } | 331 } |
330 | 332 |
331 GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); | 333 GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); |
332 GrStencilAttachment* stencilAttachment = fResourceProvider->attachStencilAtt achment(rt); | 334 GrStencilAttachment* stencilAttachment = fResourceProvider->attachStencilAtt achment(rt); |
335 if (!stencilAttachment) { | |
336 return; | |
337 } | |
333 | 338 |
334 GrBatch* batch = GrStencilPathBatch::Create(viewMatrix, | 339 GrBatch* batch = GrStencilPathBatch::Create(viewMatrix, |
335 pipelineBuilder.isHWAntialias(), | 340 pipelineBuilder.isHWAntialias(), |
336 fill, | 341 fill, |
337 appliedClip.hasStencilClip(), | 342 appliedClip.hasStencilClip(), |
338 stencilAttachment->bits(), | 343 stencilAttachment->bits(), |
339 appliedClip.scissorState(), | 344 appliedClip.scissorState(), |
340 pipelineBuilder.getRenderTarget( ), | 345 pipelineBuilder.getRenderTarget( ), |
341 path); | 346 path); |
342 this->recordBatch(batch); | 347 this->recordBatch(batch); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 } | 521 } |
517 } | 522 } |
518 | 523 |
519 /////////////////////////////////////////////////////////////////////////////// | 524 /////////////////////////////////////////////////////////////////////////////// |
520 | 525 |
521 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) { | 526 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) { |
522 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 527 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
523 this->recordBatch(batch); | 528 this->recordBatch(batch); |
524 batch->unref(); | 529 batch->unref(); |
525 } | 530 } |
OLD | NEW |