From 85d9667f59d4138438427bb2cdf67992d100e1a0 Mon Sep 17 00:00:00 2001 From: bsalomon Date: Tue, 10 May 2016 06:19:21 -0700 Subject: Revert of Replace GrStrokeInfo with GrStyle. (patchset #4 id:160001 of https://codereview.chromium.org/1957363002/ ) Reason for revert: Breaking some bots Original issue's description: > Replace GrStrokeInfo with GrStyle. > > A side effect is that arbitrary path effects can no be pushed deeper into the Ganesh flow for paths. They may be applied by path renderers. > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1957363002 > > Committed: https://skia.googlesource.com/skia/+/33595bdf4b64a745f6340338d307e806e96c587f TBR=egdaniel@google.com,robertphillips@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1967513002 --- src/gpu/SkGpuDevice.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/gpu/SkGpuDevice.cpp') diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index a0f81e7ed9..ba5848b4b1 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -15,7 +15,7 @@ #include "GrImageIDTextureAdjuster.h" #include "GrLayerHoister.h" #include "GrRecordReplaceDraw.h" -#include "GrStyle.h" +#include "GrStrokeInfo.h" #include "GrTracing.h" #include "SkCanvasPriv.h" #include "SkErrorInternals.h" @@ -454,7 +454,7 @@ void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, } if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mode) { - GrStyle style(paint, SkPaint::kStroke_Style); + GrStrokeInfo strokeInfo(paint, SkPaint::kStroke_Style); GrPaint grPaint; if (!SkPaintToGrPaint(this->context(), paint, *draw.fMatrix, this->surfaceProps().isGammaCorrect(), &grPaint)) { @@ -464,7 +464,7 @@ void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, path.setIsVolatile(true); path.moveTo(pts[0]); path.lineTo(pts[1]); - fDrawContext->drawPath(fClip, grPaint, *draw.fMatrix, path, style); + fDrawContext->drawPath(fClip, grPaint, *draw.fMatrix, path, strokeInfo); return; } @@ -535,8 +535,9 @@ void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect, const SkPaint return; } - GrStyle style(paint); - fDrawContext->drawRect(fClip, grPaint, *draw.fMatrix, rect, &style); + GrStrokeInfo strokeInfo(paint); + + fDrawContext->drawRect(fClip, grPaint, *draw.fMatrix, rect, &strokeInfo); } /////////////////////////////////////////////////////////////////////////////// @@ -553,7 +554,7 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect, return; } - GrStyle style(paint); + GrStrokeInfo strokeInfo(paint); if (paint.getMaskFilter()) { // try to hit the fast path for drawing filtered round rects @@ -576,7 +577,7 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect, &grPaint, fClip, *draw.fMatrix, - style.strokeRec(), + strokeInfo, devRRect)) { return; } @@ -586,7 +587,7 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect, } } - if (paint.getMaskFilter() || style.pathEffect()) { + if (paint.getMaskFilter() || paint.getPathEffect()) { // The only mask filter the native rrect drawing code could've handle was taken // care of above. // A path effect will presumably transform this rrect into something else. @@ -600,9 +601,9 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect, return; } - SkASSERT(!style.pathEffect()); + SkASSERT(!strokeInfo.isDashed()); - fDrawContext->drawRRect(fClip, grPaint, *draw.fMatrix, rect, style); + fDrawContext->drawRRect(fClip, grPaint, *draw.fMatrix, rect, strokeInfo); } @@ -674,7 +675,10 @@ void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval, const SkPaint return; } - fDrawContext->drawOval(fClip, grPaint, *draw.fMatrix, oval, GrStyle(paint)); + GrStrokeInfo strokeInfo(paint); + SkASSERT(!strokeInfo.isDashed()); + + fDrawContext->drawOval(fClip, grPaint, *draw.fMatrix, oval, strokeInfo); } #include "SkMaskFilter.h" -- cgit v1.2.3