Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1224)

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 326103002: Use vertex attributes for dash effect in gpu (Closed) Base URL: https://skia.googlesource.com/skia.git@dashPlumb2
Patch Set: Remove commented lines Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/effects/GrDashingEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 288ea5ae6d13f61e3cffc54f0ea54856b66dbca7..cbc40006c5c7ac90141c78a5416432d3430040ac 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -386,9 +386,16 @@ void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode,
}
if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mode) {
- if (GrDashingEffect::DrawDashLine(pts, paint, this->context())) {
- return;
- }
+ SkPaint p(paint);
+ p.setStyle(SkPaint::kStroke_Style);
+ GrStrokeInfo strokeInfo(p);
bsalomon 2014/06/11 21:43:37 Do we need to construct this from a paint if we kn
egdaniel 2014/06/12 12:13:11 Added an optional parameter to ctor of strokeInfo
+ GrPaint grPaint;
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
+ SkPath path;
+ path.moveTo(pts[0]);
+ path.lineTo(pts[1]);
+ fContext->drawPath(grPaint, path, strokeInfo);
+ return;
}
// we only handle hairlines and paints without path effects or mask filters,
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/effects/GrDashingEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698