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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 if (GR_AA_CLIP && iter.get()->isAA()) { | 158 if (GR_AA_CLIP && iter.get()->isAA()) { |
159 if (rt->isMultisampled()) { | 159 if (rt->isMultisampled()) { |
160 // Coverage based AA clips don't place nicely with MSAA. | 160 // Coverage based AA clips don't place nicely with MSAA. |
161 failed = true; | 161 failed = true; |
162 break; | 162 break; |
163 } | 163 } |
164 edgeType = invert ? kInverseFillAA_GrEffectEdgeType : kFillAA_Gr
EffectEdgeType; | 164 edgeType = invert ? kInverseFillAA_GrEffectEdgeType : kFillAA_Gr
EffectEdgeType; |
165 } else { | 165 } else { |
166 edgeType = invert ? kInverseFillBW_GrEffectEdgeType : kFillBW_Gr
EffectEdgeType; | 166 edgeType = invert ? kInverseFillBW_GrEffectEdgeType : kFillBW_Gr
EffectEdgeType; |
167 } | 167 } |
168 SkAutoTUnref<GrEffectRef> effect; | 168 SkAutoTUnref<GrEffect> effect; |
169 switch (iter.get()->getType()) { | 169 switch (iter.get()->getType()) { |
170 case SkClipStack::Element::kPath_Type: | 170 case SkClipStack::Element::kPath_Type: |
171 effect.reset(GrConvexPolyEffect::Create(edgeType, iter.get()
->getPath(), | 171 effect.reset(GrConvexPolyEffect::Create(edgeType, iter.get()
->getPath(), |
172 &clipToRTOffset)); | 172 &clipToRTOffset)); |
173 break; | 173 break; |
174 case SkClipStack::Element::kRRect_Type: { | 174 case SkClipStack::Element::kRRect_Type: { |
175 SkRRect rrect = iter.get()->getRRect(); | 175 SkRRect rrect = iter.get()->getRRect(); |
176 rrect.offset(clipToRTOffset.fX, clipToRTOffset.fY); | 176 rrect.offset(clipToRTOffset.fX, clipToRTOffset.fY); |
177 effect.reset(GrRRectEffect::Create(edgeType, rrect)); | 177 effect.reset(GrRRectEffect::Create(edgeType, rrect)); |
178 break; | 178 break; |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 | 1139 |
1140 // TODO: dynamically attach a stencil buffer | 1140 // TODO: dynamically attach a stencil buffer |
1141 int stencilBits = 0; | 1141 int stencilBits = 0; |
1142 GrStencilBuffer* stencilBuffer = | 1142 GrStencilBuffer* stencilBuffer = |
1143 drawState.getRenderTarget()->getStencilBuffer(); | 1143 drawState.getRenderTarget()->getStencilBuffer(); |
1144 if (NULL != stencilBuffer) { | 1144 if (NULL != stencilBuffer) { |
1145 stencilBits = stencilBuffer->bits(); | 1145 stencilBits = stencilBuffer->bits(); |
1146 this->adjustStencilParams(settings, clipMode, stencilBits); | 1146 this->adjustStencilParams(settings, clipMode, stencilBits); |
1147 } | 1147 } |
1148 } | 1148 } |
OLD | NEW |