Chromium Code Reviews| Index: src/gpu/GrContext.cpp |
| =================================================================== |
| --- src/gpu/GrContext.cpp (revision 7952) |
| +++ src/gpu/GrContext.cpp (working copy) |
| @@ -12,6 +12,7 @@ |
| #include "effects/GrConvolutionEffect.h" |
| #include "effects/GrSingleTextureEffect.h" |
| #include "effects/GrConfigConversionEffect.h" |
| +#include "effects/GrEllipseEdgeEffect.h" |
| #include "GrBufferAllocPool.h" |
| #include "GrGpu.h" |
| @@ -1084,12 +1085,8 @@ |
| {kVec2f_GrVertexAttribType, 0}, |
| {kVec4f_GrVertexAttribType, sizeof(GrPoint)} |
| }; |
| - static const GrAttribBindings kAttributeBindings = GrDrawState::kEdge_AttribBindingsBit; |
| - |
| drawState->setVertexAttribs(kVertexAttribs, SK_ARRAY_COUNT(kVertexAttribs)); |
| drawState->setAttribIndex(GrDrawState::kPosition_AttribIndex, 0); |
| - drawState->setAttribIndex(GrDrawState::kEdge_AttribIndex, 1); |
| - drawState->setAttribBindings(kAttributeBindings); |
| GrAssert(sizeof(CircleVertex) == drawState->getVertexSize()); |
| GrDrawTarget::AutoReleaseGeometry geo(target, 4, 0); |
| @@ -1109,7 +1106,9 @@ |
| SkScalar B; |
| if (isCircle) { |
| + drawState->setAttribBindings(GrDrawState::kEdge_AttribBindingsBit); |
| drawState->setVertexEdgeType(GrDrawState::kCircle_EdgeType); |
| + drawState->setAttribIndex(GrDrawState::kEdge_AttribIndex, 1); |
| xRadius = vm.mapRadius(xRadius); |
| @@ -1141,8 +1140,18 @@ |
| T = -outerRadius; |
| B = +outerRadius; |
| } else { // is axis-aligned ellipse |
| - drawState->setVertexEdgeType(GrDrawState::kEllipse_EdgeType); |
| + drawState->setAttribBindings(GrDrawState::kDefault_AttribBindings); |
| + enum { |
| + // the edge effects share this stage with glyph rendering |
| + // (kGlyphMaskStage in GrTextContext) && SW path rendering |
| + // (kPathMaskStage in GrSWMaskHelper) |
| + kEdgeEffectStage = GrPaint::kTotalStages, |
| + }; |
| + GrEffectRef* effect = GrEllipseEdgeEffect::Create(); |
| + int edgeAttrIndex = 1; |
|
bsalomon
2013/03/07 15:59:13
static const?
jvanverth1
2013/03/07 22:00:44
Done.
|
| + drawState->setEffect(kEdgeEffectStage, effect, &edgeAttrIndex)->unref(); |
| + |
| SkRect xformedRect; |
| vm.mapRect(&xformedRect, oval); |