| 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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 GrStencilBuffer* stencilBuffer = | 827 GrStencilBuffer* stencilBuffer = |
| 828 drawState.getRenderTarget()->getStencilBuffer(); | 828 drawState.getRenderTarget()->getStencilBuffer(); |
| 829 if (NULL != stencilBuffer) { | 829 if (NULL != stencilBuffer) { |
| 830 stencilBits = stencilBuffer->bits(); | 830 stencilBits = stencilBuffer->bits(); |
| 831 } | 831 } |
| 832 | 832 |
| 833 SkASSERT(fGpu->caps()->stencilWrapOpsSupport() || !settings.usesWrapOp()); | 833 SkASSERT(fGpu->caps()->stencilWrapOpsSupport() || !settings.usesWrapOp()); |
| 834 SkASSERT(fGpu->caps()->twoSidedStencilSupport() || !settings.isTwoSided()); | 834 SkASSERT(fGpu->caps()->twoSidedStencilSupport() || !settings.isTwoSided()); |
| 835 this->adjustStencilParams(&settings, clipMode, stencilBits); | 835 this->adjustStencilParams(&settings, clipMode, stencilBits); |
| 836 fGpu->setStencilSettings(settings); | 836 fGpu->setStencilSettings(settings); |
| 837 |
| 838 //TODO: this is probably never run due to the early return above. |
| 839 settings = drawState.getStencilPathSettings(); |
| 840 this->adjustStencilParams(&settings, clipMode, stencilBits); |
| 841 fGpu->setStencilPathSettings(settings); |
| 837 } | 842 } |
| 838 | 843 |
| 839 void GrClipMaskManager::adjustStencilParams(GrStencilSettings* settings, | 844 void GrClipMaskManager::adjustStencilParams(GrStencilSettings* settings, |
| 840 StencilClipMode mode, | 845 StencilClipMode mode, |
| 841 int stencilBitCnt) { | 846 int stencilBitCnt) { |
| 842 SkASSERT(stencilBitCnt > 0); | 847 SkASSERT(stencilBitCnt > 0); |
| 843 | 848 |
| 844 if (kModifyClip_StencilClipMode == mode) { | 849 if (kModifyClip_StencilClipMode == mode) { |
| 845 // We assume that this clip manager itself is drawing to the GrGpu and | 850 // We assume that this clip manager itself is drawing to the GrGpu and |
| 846 // has already setup the correct values. | 851 // has already setup the correct values. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 | 1010 |
| 1006 //////////////////////////////////////////////////////////////////////////////// | 1011 //////////////////////////////////////////////////////////////////////////////// |
| 1007 void GrClipMaskManager::releaseResources() { | 1012 void GrClipMaskManager::releaseResources() { |
| 1008 fAACache.releaseResources(); | 1013 fAACache.releaseResources(); |
| 1009 } | 1014 } |
| 1010 | 1015 |
| 1011 void GrClipMaskManager::setGpu(GrGpu* gpu) { | 1016 void GrClipMaskManager::setGpu(GrGpu* gpu) { |
| 1012 fGpu = gpu; | 1017 fGpu = gpu; |
| 1013 fAACache.setContext(gpu->getContext()); | 1018 fAACache.setContext(gpu->getContext()); |
| 1014 } | 1019 } |
| OLD | NEW |