aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-07 20:07:48 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-07 20:07:48 +0000
commita7830dc6d8c4427e09f09a5726a4782a54279d0f (patch)
tree75968405d53545edd97b19659e253abbcc30691c /src/gpu/GrContext.cpp
parent0e51577a14f903ffeafa117a75954baeb173ffb9 (diff)
Revert part of r7047 to check Xoom failures
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r--src/gpu/GrContext.cpp37
1 files changed, 15 insertions, 22 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 4e9f837867..30b75ad377 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1063,15 +1063,24 @@ void GrContext::drawPath(const GrPaint& paint, const SkPath& path, const SkStrok
return;
}
+ const SkPath* pathPtr = &path;
+ SkPath tmpPath;
+ SkStrokeRec strokeRec(stroke);
+ if (!strokeRec.isHairlineStyle()) {
+ if (strokeRec.applyToPath(&tmpPath, *pathPtr)) {
+ pathPtr = &tmpPath;
+ strokeRec.setFillStyle();
+ }
+ }
+
SkRect ovalRect;
- if ((stroke.isHairlineStyle() || stroke.isFillStyle()) && !path.isInverseFillType() &&
- path.isOval(&ovalRect)) {
- SkScalar width = stroke.isHairlineStyle() ? 0 : -SK_Scalar1;
+ if (!pathPtr->isInverseFillType() && pathPtr->isOval(&ovalRect)) {
+ SkScalar width = strokeRec.isHairlineStyle() ? 0 : -SK_Scalar1;
this->drawOval(paint, ovalRect, width);
return;
}
- this->internalDrawPath(paint, path, stroke);
+ this->internalDrawPath(paint, *pathPtr, strokeRec);
}
void GrContext::internalDrawPath(const GrPaint& paint, const SkPath& path, const SkStrokeRec& stroke) {
@@ -1100,23 +1109,7 @@ void GrContext::internalDrawPath(const GrPaint& paint, const SkPath& path, const
GrPathRendererChain::DrawType type = prAA ? GrPathRendererChain::kColorAntiAlias_DrawType :
GrPathRendererChain::kColor_DrawType;
- const SkPath* pathPtr = &path;
- SkPath tmpPath;
- SkStrokeRec strokeRec(stroke);
-
- // Try a 1st time without stroking the path and without allowing the SW renderer
- GrPathRenderer* pr = this->getPathRenderer(*pathPtr, strokeRec, target, false, type);
-
- if ((NULL == pr) && !strokeRec.isHairlineStyle()) {
- // It didn't work the 1st time, so try again with the stroked path
- if (strokeRec.applyToPath(&tmpPath, *pathPtr)) {
- pathPtr = &tmpPath;
- strokeRec.setFillStyle();
- }
- // This time, allow SW renderer
- pr = this->getPathRenderer(*pathPtr, strokeRec, target, true, type);
- }
-
+ GrPathRenderer* pr = this->getPathRenderer(path, stroke, target, true, type);
if (NULL == pr) {
#if GR_DEBUG
GrPrintf("Unable to find path renderer compatible with path.\n");
@@ -1124,7 +1117,7 @@ void GrContext::internalDrawPath(const GrPaint& paint, const SkPath& path, const
return;
}
- pr->drawPath(*pathPtr, strokeRec, target, prAA);
+ pr->drawPath(path, stroke, target, prAA);
}
////////////////////////////////////////////////////////////////////////////////