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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 fAACache.reset(); | 1105 fAACache.reset(); |
1106 return NULL; | 1106 return NULL; |
1107 } | 1107 } |
1108 helper.toTexture(result); | 1108 helper.toTexture(result); |
1109 | 1109 |
1110 fCurrClipMaskType = kAlpha_ClipMaskType; | 1110 fCurrClipMaskType = kAlpha_ClipMaskType; |
1111 return result; | 1111 return result; |
1112 } | 1112 } |
1113 | 1113 |
1114 //////////////////////////////////////////////////////////////////////////////// | 1114 //////////////////////////////////////////////////////////////////////////////// |
1115 void GrClipMaskManager::purgeResources() { | 1115 void GrClipMaskManager::releaseResources() { |
1116 fAACache.purgeResources(); | 1116 fAACache.releaseResources(); |
1117 } | 1117 } |
1118 | 1118 |
1119 void GrClipMaskManager::setGpu(GrGpu* gpu) { | 1119 void GrClipMaskManager::setGpu(GrGpu* gpu) { |
1120 fGpu = gpu; | 1120 fGpu = gpu; |
1121 fAACache.setContext(gpu->getContext()); | 1121 fAACache.setContext(gpu->getContext()); |
1122 } | 1122 } |
1123 | 1123 |
1124 void GrClipMaskManager::adjustPathStencilParams(GrStencilSettings* settings) { | 1124 void GrClipMaskManager::adjustPathStencilParams(GrStencilSettings* settings) { |
1125 const GrDrawState& drawState = fGpu->getDrawState(); | 1125 const GrDrawState& drawState = fGpu->getDrawState(); |
1126 GrClipMaskManager::StencilClipMode clipMode; | 1126 GrClipMaskManager::StencilClipMode clipMode; |
(...skipping 11 matching lines...) Expand all 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 |