Index: src/gpu/effects/GrRRectEffect.cpp |
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp |
index eff4aa86496c93e360eca443ad6df39df333dd98..1e93eb1bdf583967dc2a2b59bb8431d606bfb061 100644 |
--- a/src/gpu/effects/GrRRectEffect.cpp |
+++ b/src/gpu/effects/GrRRectEffect.cpp |
@@ -10,6 +10,7 @@ |
#include "gl/GrGLEffect.h" |
#include "gl/GrGLSL.h" |
#include "GrConvexPolyEffect.h" |
+#include "GrOvalEffect.h" |
#include "GrTBackendEffectFactory.h" |
#include "SkRRect.h" |
@@ -77,7 +78,9 @@ private: |
GrEffectRef* CircularRRectEffect::Create(GrEffectEdgeType edgeType, |
uint32_t circularCornerFlags, |
const SkRRect& rrect) { |
- SkASSERT(kFillAA_GrEffectEdgeType == edgeType || kInverseFillAA_GrEffectEdgeType == edgeType); |
+ if (kFillAA_GrEffectEdgeType != edgeType && kInverseFillAA_GrEffectEdgeType != edgeType) { |
+ return NULL; |
+ } |
return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(CircularRRectEffect, |
(edgeType, circularCornerFlags, rrect)))); |
} |
@@ -410,7 +413,9 @@ private: |
}; |
GrEffectRef* EllipticalRRectEffect::Create(GrEffectEdgeType edgeType, const SkRRect& rrect) { |
- SkASSERT(kFillAA_GrEffectEdgeType == edgeType || kInverseFillAA_GrEffectEdgeType == edgeType); |
+ if (kFillAA_GrEffectEdgeType != edgeType && kInverseFillAA_GrEffectEdgeType != edgeType) { |
+ return NULL; |
+ } |
return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(EllipticalRRectEffect, (edgeType, rrect)))); |
} |
@@ -627,14 +632,14 @@ void GLEllipticalRRectEffect::setData(const GrGLUniformManager& uman, |
////////////////////////////////////////////////////////////////////////////// |
GrEffectRef* GrRRectEffect::Create(GrEffectEdgeType edgeType, const SkRRect& rrect) { |
- if (kFillAA_GrEffectEdgeType != edgeType && kInverseFillAA_GrEffectEdgeType != edgeType) { |
- return NULL; |
- } |
- |
if (rrect.isRect()) { |
return GrConvexPolyEffect::Create(edgeType, rrect.getBounds()); |
} |
+ if (rrect.isOval()) { |
+ return GrOvalEffect::Create(edgeType, rrect.getBounds()); |
+ } |
+ |
if (rrect.isSimple()) { |
if (rrect.getSimpleRadii().fX < kRadiusMin || rrect.getSimpleRadii().fY < kRadiusMin) { |
// In this case the corners are extremely close to rectangular and we collapse the |