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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 // The other ops (union, xor, diff) only affect pixels inside | 986 // The other ops (union, xor, diff) only affect pixels inside |
987 // the geometry so they can just be drawn normally | 987 // the geometry so they can just be drawn normally |
988 if (Element::kRect_Type == element->getType()) { | 988 if (Element::kRect_Type == element->getType()) { |
989 helper.draw(element->getRect(), op, element->isAA(), 0xFF); | 989 helper.draw(element->getRect(), op, element->isAA(), 0xFF); |
990 } else { | 990 } else { |
991 GrAssert(Element::kPath_Type == element->getType()); | 991 GrAssert(Element::kPath_Type == element->getType()); |
992 helper.draw(element->getPath(), stroke, op, element->isAA(), 0xFF); | 992 helper.draw(element->getPath(), stroke, op, element->isAA(), 0xFF); |
993 } | 993 } |
994 } | 994 } |
995 | 995 |
996 helper.toTexture(result, kAllIn_InitialState == initialState ? 0xFF : 0x00); | 996 helper.toTexture(result); |
997 | 997 |
998 fCurrClipMaskType = kAlpha_ClipMaskType; | 998 fCurrClipMaskType = kAlpha_ClipMaskType; |
999 return result; | 999 return result; |
1000 } | 1000 } |
1001 | 1001 |
1002 //////////////////////////////////////////////////////////////////////////////// | 1002 //////////////////////////////////////////////////////////////////////////////// |
1003 void GrClipMaskManager::releaseResources() { | 1003 void GrClipMaskManager::releaseResources() { |
1004 fAACache.releaseResources(); | 1004 fAACache.releaseResources(); |
1005 } | 1005 } |
1006 | 1006 |
1007 void GrClipMaskManager::setGpu(GrGpu* gpu) { | 1007 void GrClipMaskManager::setGpu(GrGpu* gpu) { |
1008 fGpu = gpu; | 1008 fGpu = gpu; |
1009 fAACache.setContext(gpu->getContext()); | 1009 fAACache.setContext(gpu->getContext()); |
1010 } | 1010 } |
OLD | NEW |