| Index: Source/core/platform/graphics/StrokeData.cpp
|
| diff --git a/Source/core/platform/graphics/StrokeData.cpp b/Source/core/platform/graphics/StrokeData.cpp
|
| index 23e44243256e16bca9f39937378dc196c5e141e2..6522c8ef13bf14e15975d6a97f76525783b2af8f 100644
|
| --- a/Source/core/platform/graphics/StrokeData.cpp
|
| +++ b/Source/core/platform/graphics/StrokeData.cpp
|
| @@ -29,10 +29,64 @@
|
| #include "config.h"
|
| #include "core/platform/graphics/StrokeData.h"
|
|
|
| +#include "core/platform/graphics/Gradient.h"
|
| +#include "core/platform/graphics/Pattern.h"
|
| +#include "third_party/skia/include/core/SkRefCnt.h"
|
| +#include "third_party/skia/include/effects/SkDashPathEffect.h"
|
| +
|
| namespace WebCore {
|
|
|
| static const int dashRatio = 3; // Ratio of the length of a dash to its width.
|
|
|
| +StrokeData::StrokeData()
|
| + : m_style(SolidStroke)
|
| + , m_thickness(0)
|
| + , m_color(Color::black)
|
| + , m_lineCap(SkPaint::kDefault_Cap)
|
| + , m_lineJoin(SkPaint::kDefault_Join)
|
| + , m_miterLimit(4)
|
| + , m_dash(0)
|
| +{
|
| +}
|
| +
|
| +StrokeData::StrokeData(const StrokeData& other)
|
| + : m_style(other.m_style)
|
| + , m_thickness(other.m_thickness)
|
| + , m_color(other.m_color)
|
| + , m_gradient(other.m_gradient)
|
| + , m_pattern(other.m_pattern)
|
| + , m_lineCap(other.m_lineCap)
|
| + , m_lineJoin(other.m_lineJoin)
|
| + , m_miterLimit(other.m_miterLimit)
|
| + , m_dash(other.m_dash)
|
| +{
|
| + SkSafeRef(m_dash);
|
| +}
|
| +
|
| +StrokeData::~StrokeData()
|
| +{
|
| + SkSafeUnref(m_dash);
|
| +}
|
| +
|
| +void StrokeData::setColor(const Color& color)
|
| +{
|
| + m_color = color;
|
| + m_gradient.clear();
|
| + m_pattern.clear();
|
| +}
|
| +
|
| +void StrokeData::setGradient(PassRefPtr<Gradient> gradient)
|
| +{
|
| + m_gradient = gradient;
|
| + m_pattern.clear();
|
| +}
|
| +
|
| +void StrokeData::setPattern(PassRefPtr<Pattern> pattern)
|
| +{
|
| + m_pattern = pattern;
|
| + m_gradient.clear();
|
| +}
|
| +
|
| void StrokeData::setLineDash(const DashArray& dashes, float dashOffset)
|
| {
|
| // FIXME: This is lifted directly off SkiaSupport, lines 49-74
|
|
|