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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 | 1051 |
1052 // The mask texture may be larger than necessary. We round out the clip spac
e bounds and pin | 1052 // The mask texture may be larger than necessary. We round out the clip spac
e bounds and pin |
1053 // the top left corner of the resulting rect to the top left of the texture. | 1053 // the top left corner of the resulting rect to the top left of the texture. |
1054 SkIRect maskSpaceIBounds = SkIRect::MakeWH(clipSpaceIBounds.width(), clipSpa
ceIBounds.height()); | 1054 SkIRect maskSpaceIBounds = SkIRect::MakeWH(clipSpaceIBounds.width(), clipSpa
ceIBounds.height()); |
1055 | 1055 |
1056 GrSWMaskHelper helper(this->getContext()); | 1056 GrSWMaskHelper helper(this->getContext()); |
1057 | 1057 |
1058 SkMatrix matrix; | 1058 SkMatrix matrix; |
1059 matrix.setTranslate(SkIntToScalar(-clipSpaceIBounds.fLeft), | 1059 matrix.setTranslate(SkIntToScalar(-clipSpaceIBounds.fLeft), |
1060 SkIntToScalar(-clipSpaceIBounds.fTop)); | 1060 SkIntToScalar(-clipSpaceIBounds.fTop)); |
1061 helper.init(maskSpaceIBounds, &matrix); | 1061 helper.init(maskSpaceIBounds, &matrix, false); |
1062 | 1062 |
1063 helper.clear(kAllIn_InitialState == initialState ? 0xFF : 0x00); | 1063 helper.clear(kAllIn_InitialState == initialState ? 0xFF : 0x00); |
1064 | 1064 |
1065 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 1065 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); |
1066 | 1066 |
1067 for (ElementList::Iter iter(elements.headIter()) ; NULL != iter.get(); iter.
next()) { | 1067 for (ElementList::Iter iter(elements.headIter()) ; NULL != iter.get(); iter.
next()) { |
1068 | 1068 |
1069 const Element* element = iter.get(); | 1069 const Element* element = iter.get(); |
1070 SkRegion::Op op = element->getOp(); | 1070 SkRegion::Op op = element->getOp(); |
1071 | 1071 |
(...skipping 66 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 |