aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-05-10 06:19:21 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-10 06:19:21 -0700
commit85d9667f59d4138438427bb2cdf67992d100e1a0 (patch)
tree1d86fd1d78a1bdd36f6b250bf31dd285986db5ef /src/gpu/SkGpuDevice.cpp
parent00e9452791a80ed9fb824214b259ecb9af0c25c6 (diff)
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
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r--src/gpu/SkGpuDevice.cpp26
1 files changed, 15 insertions, 11 deletions
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"