| Index: src/gpu/GrDefaultPathRenderer.cpp
|
| ===================================================================
|
| --- src/gpu/GrDefaultPathRenderer.cpp (revision 11314)
|
| +++ src/gpu/GrDefaultPathRenderer.cpp (working copy)
|
| @@ -162,10 +162,9 @@
|
| }
|
|
|
| GrPathRenderer::StencilSupport GrDefaultPathRenderer::onGetStencilSupport(
|
| - const SkPath& path,
|
| const SkStrokeRec& stroke,
|
| const GrDrawTarget*) const {
|
| - if (single_pass_path(path, stroke)) {
|
| + if (single_pass_path(fPath, stroke)) {
|
| return GrPathRenderer::kNoRestriction_StencilSupport;
|
| } else {
|
| return GrPathRenderer::kStencilOnly_StencilSupport;
|
| @@ -324,20 +323,19 @@
|
| return true;
|
| }
|
|
|
| -bool GrDefaultPathRenderer::internalDrawPath(const SkPath& path,
|
| - const SkStrokeRec& stroke,
|
| +bool GrDefaultPathRenderer::internalDrawPath(const SkStrokeRec& stroke,
|
| GrDrawTarget* target,
|
| bool stencilOnly) {
|
|
|
| SkMatrix viewM = target->getDrawState().getViewMatrix();
|
| SkScalar tol = SK_Scalar1;
|
| - tol = GrPathUtils::scaleToleranceToSrc(tol, viewM, path.getBounds());
|
| + tol = GrPathUtils::scaleToleranceToSrc(tol, viewM, fPath.getBounds());
|
|
|
| int vertexCnt;
|
| int indexCnt;
|
| GrPrimitiveType primType;
|
| GrDrawTarget::AutoReleaseGeometry arg;
|
| - if (!this->createGeom(path,
|
| + if (!this->createGeom(fPath,
|
| stroke,
|
| tol,
|
| target,
|
| @@ -371,7 +369,7 @@
|
| lastPassIsBounds = false;
|
| drawFace[0] = GrDrawState::kBoth_DrawFace;
|
| } else {
|
| - if (single_pass_path(path, stroke)) {
|
| + if (single_pass_path(fPath, stroke)) {
|
| passCount = 1;
|
| if (stencilOnly) {
|
| passes[0] = &gDirectToStencil;
|
| @@ -381,7 +379,7 @@
|
| drawFace[0] = GrDrawState::kBoth_DrawFace;
|
| lastPassIsBounds = false;
|
| } else {
|
| - switch (path.getFillType()) {
|
| + switch (fPath.getFillType()) {
|
| case SkPath::kInverseEvenOdd_FillType:
|
| reverse = true;
|
| // fallthrough
|
| @@ -448,7 +446,7 @@
|
| }
|
|
|
| SkRect devBounds;
|
| - GetPathDevBounds(path, drawState->getRenderTarget(), viewM, &devBounds);
|
| + GetPathDevBounds(fPath, drawState->getRenderTarget(), viewM, &devBounds);
|
|
|
| for (int p = 0; p < passCount; ++p) {
|
| drawState->setDrawFace(drawFace[p]);
|
| @@ -475,7 +473,7 @@
|
| avmr.setIdentity(drawState);
|
| }
|
| } else {
|
| - bounds = path.getBounds();
|
| + bounds = fPath.getBounds();
|
| }
|
| GrDrawTarget::AutoGeometryAndStatePush agasp(target, GrDrawTarget::kPreserve_ASRInit);
|
| target->drawSimpleRect(bounds, NULL);
|
| @@ -494,28 +492,22 @@
|
| return true;
|
| }
|
|
|
| -bool GrDefaultPathRenderer::canDrawPath(const SkPath& path,
|
| - const SkStrokeRec& stroke,
|
| +bool GrDefaultPathRenderer::canDrawPath(const SkStrokeRec& stroke,
|
| const GrDrawTarget* target,
|
| bool antiAlias) const {
|
| // this class can draw any path with any fill but doesn't do any anti-aliasing.
|
| return (stroke.isFillStyle() || stroke.isHairlineStyle()) && !antiAlias;
|
| }
|
|
|
| -bool GrDefaultPathRenderer::onDrawPath(const SkPath& path,
|
| - const SkStrokeRec& stroke,
|
| +bool GrDefaultPathRenderer::onDrawPath(const SkStrokeRec& stroke,
|
| GrDrawTarget* target,
|
| bool antiAlias) {
|
| - return this->internalDrawPath(path,
|
| - stroke,
|
| - target,
|
| - false);
|
| + return this->internalDrawPath(stroke, target, false);
|
| }
|
|
|
| -void GrDefaultPathRenderer::onStencilPath(const SkPath& path,
|
| - const SkStrokeRec& stroke,
|
| +void GrDefaultPathRenderer::onStencilPath(const SkStrokeRec& stroke,
|
| GrDrawTarget* target) {
|
| - SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType());
|
| - SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType());
|
| - this->internalDrawPath(path, stroke, target, true);
|
| + SkASSERT(SkPath::kInverseEvenOdd_FillType != fPath.getFillType());
|
| + SkASSERT(SkPath::kInverseWinding_FillType != fPath.getFillType());
|
| + this->internalDrawPath(stroke, target, true);
|
| }
|
|
|