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 "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
10 #include "GrAAHairLinePathRenderer.h" | 10 #include "GrAAHairLinePathRenderer.h" |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 rt); | 686 rt); |
687 | 687 |
688 // walk through each clip element and perform its set op | 688 // walk through each clip element and perform its set op |
689 // with the existing clip. | 689 // with the existing clip. |
690 for (GrReducedClip::ElementList::Iter iter(elements.headIter()); iter.ge
t(); iter.next()) { | 690 for (GrReducedClip::ElementList::Iter iter(elements.headIter()); iter.ge
t(); iter.next()) { |
691 const Element* element = iter.get(); | 691 const Element* element = iter.get(); |
692 | 692 |
693 GrDrawState drawState(matrix); | 693 GrDrawState drawState(matrix); |
694 drawState.setRenderTarget(rt); | 694 drawState.setRenderTarget(rt); |
695 drawState.enableState(GrDrawState::kClip_StateBit); | 695 drawState.enableState(GrDrawState::kClip_StateBit); |
696 drawState.enableState(GrDrawState::kNoColorWrites_StateBit); | 696 |
| 697 drawState.setDisableColorXPFactory(); |
697 | 698 |
698 // if the target is MSAA then we want MSAA enabled when the clip is
soft | 699 // if the target is MSAA then we want MSAA enabled when the clip is
soft |
699 if (rt->isMultisampled()) { | 700 if (rt->isMultisampled()) { |
700 drawState.setState(GrDrawState::kHWAntialias_StateBit, element->
isAA()); | 701 drawState.setState(GrDrawState::kHWAntialias_StateBit, element->
isAA()); |
701 } | 702 } |
702 | 703 |
703 bool fillInverted = false; | 704 bool fillInverted = false; |
704 // enabled at bottom of loop | 705 // enabled at bottom of loop |
705 fClipMode = kIgnoreClip_StencilClipMode; | 706 fClipMode = kIgnoreClip_StencilClipMode; |
706 | 707 |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 } | 1059 } |
1059 | 1060 |
1060 void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBu
ffer, | 1061 void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBu
ffer, |
1061 GrStencilSettings* settings) { | 1062 GrStencilSettings* settings) { |
1062 // TODO: dynamically attach a stencil buffer | 1063 // TODO: dynamically attach a stencil buffer |
1063 if (stencilBuffer) { | 1064 if (stencilBuffer) { |
1064 int stencilBits = stencilBuffer->bits(); | 1065 int stencilBits = stencilBuffer->bits(); |
1065 this->adjustStencilParams(settings, fClipMode, stencilBits); | 1066 this->adjustStencilParams(settings, fClipMode, stencilBits); |
1066 } | 1067 } |
1067 } | 1068 } |
OLD | NEW |