| Index: src/gpu/batches/GrMSAAPathRenderer.cpp
|
| diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp
|
| index a382c42054a0ab8e051c6be8b9bff312470e952e..a9ba06c5f4ad056b5b3d0f770fe21ff5e427a9ca 100644
|
| --- a/src/gpu/batches/GrMSAAPathRenderer.cpp
|
| +++ b/src/gpu/batches/GrMSAAPathRenderer.cpp
|
| @@ -29,7 +29,7 @@
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // Helpers for drawPath
|
|
|
| -static inline bool single_pass_path(const SkPath& path) {
|
| +static inline bool single_pass_path(const SkPath& path, const SkStrokeRec& stroke) {
|
| if (!path.isInverseFillType()) {
|
| return path.isConvex();
|
| }
|
| @@ -38,7 +38,7 @@
|
|
|
| GrPathRenderer::StencilSupport
|
| GrMSAAPathRenderer::onGetStencilSupport(const SkPath& path) const {
|
| - if (single_pass_path(path)) {
|
| + if (single_pass_path(path, SkStrokeRec(SkStrokeRec::kFill_InitStyle))) {
|
| return GrPathRenderer::kNoRestriction_StencilSupport;
|
| } else {
|
| return GrPathRenderer::kStencilOnly_StencilSupport;
|
| @@ -571,7 +571,9 @@
|
| GrColor color,
|
| const SkMatrix& viewMatrix,
|
| const SkPath& path,
|
| + const GrStrokeInfo& origStroke,
|
| bool stencilOnly) {
|
| + SkTCopyOnFirstWrite<GrStrokeInfo> stroke(origStroke);
|
|
|
| const GrXPFactory* xpFactory = pipelineBuilder->getXPFactory();
|
| SkAutoTUnref<const GrXPFactory> backupXPFactory(SkSafeRef(xpFactory));
|
| @@ -584,7 +586,7 @@
|
| bool reverse = false;
|
| bool lastPassIsBounds;
|
|
|
| - if (single_pass_path(path)) {
|
| + if (single_pass_path(path, *stroke)) {
|
| passCount = 1;
|
| if (stencilOnly) {
|
| passes[0] = &gDirectToStencil;
|
| @@ -701,35 +703,34 @@
|
| }
|
|
|
| bool GrMSAAPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
|
| - // This path renderer does not support hairlines. We defer on anything that could be handled
|
| - // as a hairline by another path renderer. Also, arbitrary path effects could produce
|
| - // a hairline result.
|
| - return !IsStrokeHairlineOrEquivalent(*args.fStyle, *args.fViewMatrix, nullptr) &&
|
| - !args.fStyle->hasNonDashPathEffect() && !args.fAntiAlias;
|
| + return !IsStrokeHairlineOrEquivalent(*args.fStroke, *args.fViewMatrix, nullptr) &&
|
| + !args.fAntiAlias;
|
| }
|
|
|
| bool GrMSAAPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
| GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), "GrMSAAPathRenderer::onDrawPath");
|
| - SkPath tmpPath;
|
| - const SkPath* path;
|
| - if (args.fStyle->applies()) {
|
| - SkStrokeRec::InitStyle fill;
|
| - SkScalar styleScale = GrStyle::MatrixToScaleFactor(*args.fViewMatrix);
|
| - if (!args.fStyle->applyToPath(&tmpPath, &fill, *args.fPath, styleScale)) {
|
| + SkPath path;
|
| + GrStrokeInfo stroke(*args.fStroke);
|
| + if (stroke.isDashed()) {
|
| + if (!stroke.applyDashToPath(&path, &stroke, *args.fPath)) {
|
| return false;
|
| }
|
| - // We don't accept styles that are hairlines or have path effects that could produce
|
| - // hairlines.
|
| - SkASSERT(SkStrokeRec::kFill_InitStyle == fill);
|
| - path = &tmpPath;
|
| } else {
|
| - path = args.fPath;
|
| + path = *args.fPath;
|
| + }
|
| + if (!stroke.isFillStyle()) {
|
| + stroke.setResScale(SkScalarAbs(args.fViewMatrix->getMaxScale()));
|
| + if (!stroke.applyToPath(&path, path)) {
|
| + return false;
|
| + }
|
| + stroke.setFillStyle();
|
| }
|
| return this->internalDrawPath(args.fTarget,
|
| args.fPipelineBuilder,
|
| args.fColor,
|
| *args.fViewMatrix,
|
| - *path,
|
| + path,
|
| + stroke,
|
| false);
|
| }
|
|
|
| @@ -738,7 +739,7 @@
|
| SkASSERT(SkPath::kInverseEvenOdd_FillType != args.fPath->getFillType());
|
| SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType());
|
| this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, *args.fViewMatrix,
|
| - *args.fPath, true);
|
| + *args.fPath, GrStrokeInfo::FillInfo(), true);
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|