OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrClipMaskManager.h" | 8 #include "GrClipMaskManager.h" |
9 #include "GrCaps.h" | 9 #include "GrCaps.h" |
10 #include "GrDrawingManager.h" | 10 #include "GrDrawingManager.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) { | 362 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) { |
363 out->fScissorState.set(scissorSpaceIBounds); | 363 out->fScissorState.set(scissorSpaceIBounds); |
364 } | 364 } |
365 this->setPipelineBuilderStencil(pipelineBuilder, ars); | 365 this->setPipelineBuilderStencil(pipelineBuilder, ars); |
366 out->fClipCoverageFP.reset(clipFP); | 366 out->fClipCoverageFP.reset(clipFP); |
367 return true; | 367 return true; |
368 } | 368 } |
369 } | 369 } |
370 | 370 |
371 // If MSAA is enabled we can do everything in the stencil buffer. | 371 // If MSAA is enabled we can do everything in the stencil buffer. |
372 if (0 == rt->numStencilSamples() && requiresAA) { | 372 if (0 == rt->numColorSamples() && requiresAA) { |
373 SkAutoTUnref<GrTexture> result; | 373 SkAutoTUnref<GrTexture> result; |
374 | 374 |
375 // The top-left of the mask corresponds to the top-left corner of the bo
unds. | 375 // The top-left of the mask corresponds to the top-left corner of the bo
unds. |
376 SkVector clipToMaskOffset = { | 376 SkVector clipToMaskOffset = { |
377 SkIntToScalar(-clipSpaceIBounds.fLeft), | 377 SkIntToScalar(-clipSpaceIBounds.fLeft), |
378 SkIntToScalar(-clipSpaceIBounds.fTop) | 378 SkIntToScalar(-clipSpaceIBounds.fTop) |
379 }; | 379 }; |
380 | 380 |
381 if (this->useSWOnlyPath(pipelineBuilder, rt, clipToMaskOffset, elements)
) { | 381 if (this->useSWOnlyPath(pipelineBuilder, rt, clipToMaskOffset, elements)
) { |
382 // The clip geometry is complex enough that it will be more efficien
t to create it | 382 // The clip geometry is complex enough that it will be more efficien
t to create it |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 for (GrReducedClip::ElementList::Iter iter(elements.headIter()); iter.ge
t(); iter.next()) { | 700 for (GrReducedClip::ElementList::Iter iter(elements.headIter()); iter.ge
t(); iter.next()) { |
701 const Element* element = iter.get(); | 701 const Element* element = iter.get(); |
702 | 702 |
703 GrPipelineBuilder pipelineBuilder; | 703 GrPipelineBuilder pipelineBuilder; |
704 pipelineBuilder.setClip(clip); | 704 pipelineBuilder.setClip(clip); |
705 pipelineBuilder.setRenderTarget(rt); | 705 pipelineBuilder.setRenderTarget(rt); |
706 | 706 |
707 pipelineBuilder.setDisableColorXPFactory(); | 707 pipelineBuilder.setDisableColorXPFactory(); |
708 | 708 |
709 // if the target is MSAA then we want MSAA enabled when the clip is
soft | 709 // if the target is MSAA then we want MSAA enabled when the clip is
soft |
710 if (rt->isStencilBufferMultisampled()) { | 710 if (rt->isUnifiedMultisampled()) { |
711 pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, e
lement->isAA()); | 711 pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, e
lement->isAA()); |
712 } | 712 } |
713 | 713 |
714 bool fillInverted = false; | 714 bool fillInverted = false; |
715 // enabled at bottom of loop | 715 // enabled at bottom of loop |
716 fClipMode = kIgnoreClip_StencilClipMode; | 716 fClipMode = kIgnoreClip_StencilClipMode; |
717 | 717 |
718 // This will be used to determine whether the clip shape can be rend
ered into the | 718 // This will be used to determine whether the clip shape can be rend
ered into the |
719 // stencil with arbitrary stencil settings. | 719 // stencil with arbitrary stencil settings. |
720 GrPathRenderer::StencilSupport stencilSupport; | 720 GrPathRenderer::StencilSupport stencilSupport; |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 | 1096 |
1097 //////////////////////////////////////////////////////////////////////////////// | 1097 //////////////////////////////////////////////////////////////////////////////// |
1098 | 1098 |
1099 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, | 1099 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, |
1100 GrStencilSettings* settings) { | 1100 GrStencilSettings* settings) { |
1101 if (stencilAttachment) { | 1101 if (stencilAttachment) { |
1102 int stencilBits = stencilAttachment->bits(); | 1102 int stencilBits = stencilAttachment->bits(); |
1103 this->adjustStencilParams(settings, fClipMode, stencilBits); | 1103 this->adjustStencilParams(settings, fClipMode, stencilBits); |
1104 } | 1104 } |
1105 } | 1105 } |
OLD | NEW |