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

Unified Diff: Source/platform/graphics/StrokeData.cpp

Issue 169283008: Maintain SkPaint in GraphicsContextState. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Ready for review. Created 6 years, 10 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
Index: Source/platform/graphics/StrokeData.cpp
diff --git a/Source/platform/graphics/StrokeData.cpp b/Source/platform/graphics/StrokeData.cpp
index 75fb7ca63141b19be25506d9d2d601b67ed6cb59..b74f90f338b9b071af78d7f31b0ed466460d0585 100644
--- a/Source/platform/graphics/StrokeData.cpp
+++ b/Source/platform/graphics/StrokeData.cpp
@@ -57,16 +57,20 @@ void StrokeData::setLineDash(const DashArray& dashes, float dashOffset)
m_dash = adoptRef(new SkDashPathEffect(intervals.get(), count, dashOffset));
}
-float StrokeData::setupPaint(SkPaint* paint, int length) const
+void StrokeData::setupPaint(SkPaint* paint, int length) const
{
- float width = m_thickness;
-
paint->setStyle(SkPaint::kStroke_Style);
- paint->setStrokeWidth(SkFloatToScalar(width));
+ paint->setStrokeWidth(SkFloatToScalar(m_thickness));
paint->setStrokeCap(m_lineCap);
paint->setStrokeJoin(m_lineJoin);
paint->setStrokeMiter(SkFloatToScalar(m_miterLimit));
+ setupPaintDashPathEffect(paint, length);
+}
+
+void StrokeData::setupPaintDashPathEffect(SkPaint* paint, int length) const
+{
+ float width = m_thickness;
if (m_dash) {
paint->setPathEffect(m_dash.get());
} else {
@@ -75,7 +79,7 @@ float StrokeData::setupPaint(SkPaint* paint, int length) const
case SolidStroke:
case DoubleStroke:
case WavyStroke: // FIXME: https://code.google.com/p/chromium/issues/detail?id=229574
- break;
+ return;
case DashedStroke:
width = dashRatio * width;
// Fall through.
@@ -104,8 +108,6 @@ float StrokeData::setupPaint(SkPaint* paint, int length) const
paint->setPathEffect(pathEffect.get());
}
}
-
- return width;
}
} // namespace
« Source/platform/graphics/GraphicsContextState.cpp ('K') | « Source/platform/graphics/StrokeData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698