| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 "GrClipMaskManager.h" | 9 #include "GrClipMaskManager.h" |
| 10 #include "GrAAConvexPathRenderer.h" | 10 #include "GrAAConvexPathRenderer.h" |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 drawState->enableState(GrDrawState::kClip_StateBit); | 732 drawState->enableState(GrDrawState::kClip_StateBit); |
| 733 | 733 |
| 734 #if !VISUALIZE_COMPLEX_CLIP | 734 #if !VISUALIZE_COMPLEX_CLIP |
| 735 drawState->enableState(GrDrawState::kNoColorWrites_StateBit); | 735 drawState->enableState(GrDrawState::kNoColorWrites_StateBit); |
| 736 #endif | 736 #endif |
| 737 | 737 |
| 738 int clipBit = stencilBuffer->bits(); | 738 int clipBit = stencilBuffer->bits(); |
| 739 SkASSERT((clipBit <= 16) && "Ganesh only handles 16b or smaller stencil
buffers"); | 739 SkASSERT((clipBit <= 16) && "Ganesh only handles 16b or smaller stencil
buffers"); |
| 740 clipBit = (1 << (clipBit-1)); | 740 clipBit = (1 << (clipBit-1)); |
| 741 | 741 |
| 742 fGpu->clearStencilClip(stencilSpaceIBounds, kAllIn_InitialState == initi
alState); | 742 fGpu->clearStencilClip(rt, stencilSpaceIBounds, kAllIn_InitialState == i
nitialState); |
| 743 | 743 |
| 744 // walk through each clip element and perform its set op | 744 // walk through each clip element and perform its set op |
| 745 // with the existing clip. | 745 // with the existing clip. |
| 746 for (ElementList::Iter iter(elements.headIter()); NULL != iter.get(); it
er.next()) { | 746 for (ElementList::Iter iter(elements.headIter()); NULL != iter.get(); it
er.next()) { |
| 747 const Element* element = iter.get(); | 747 const Element* element = iter.get(); |
| 748 bool fillInverted = false; | 748 bool fillInverted = false; |
| 749 // enabled at bottom of loop | 749 // enabled at bottom of loop |
| 750 drawState->disableState(GrGpu::kModifyStencilClip_StateBit); | 750 drawState->disableState(GrGpu::kModifyStencilClip_StateBit); |
| 751 // if the target is MSAA then we want MSAA enabled when the clip is
soft | 751 // if the target is MSAA then we want MSAA enabled when the clip is
soft |
| 752 if (rt->isMultisampled()) { | 752 if (rt->isMultisampled()) { |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 | 1138 |
| 1139 // TODO: dynamically attach a stencil buffer | 1139 // TODO: dynamically attach a stencil buffer |
| 1140 int stencilBits = 0; | 1140 int stencilBits = 0; |
| 1141 GrStencilBuffer* stencilBuffer = | 1141 GrStencilBuffer* stencilBuffer = |
| 1142 drawState.getRenderTarget()->getStencilBuffer(); | 1142 drawState.getRenderTarget()->getStencilBuffer(); |
| 1143 if (NULL != stencilBuffer) { | 1143 if (NULL != stencilBuffer) { |
| 1144 stencilBits = stencilBuffer->bits(); | 1144 stencilBits = stencilBuffer->bits(); |
| 1145 this->adjustStencilParams(settings, clipMode, stencilBits); | 1145 this->adjustStencilParams(settings, clipMode, stencilBits); |
| 1146 } | 1146 } |
| 1147 } | 1147 } |
| OLD | NEW |