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

Unified Diff: Source/core/platform/graphics/StrokeData.h

Issue 18551004: Miscellaneous cleanup to reduce number of includes in platform/graphics/ Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 | « Source/core/platform/graphics/RoundedRect.cpp ('k') | Source/core/platform/graphics/StrokeData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/StrokeData.h
diff --git a/Source/core/platform/graphics/StrokeData.h b/Source/core/platform/graphics/StrokeData.h
index 1cdb4bd77e0119d4ccc1323c0ef680cf9663800c..5dbad85391b799adb44b07f4655b301f3435faa5 100644
--- a/Source/core/platform/graphics/StrokeData.h
+++ b/Source/core/platform/graphics/StrokeData.h
@@ -29,51 +29,27 @@
#ifndef StrokeData_h
#define StrokeData_h
+#include "core/platform/graphics/Color.h"
#include "core/platform/graphics/DashArray.h"
-#include "core/platform/graphics/Gradient.h"
#include "core/platform/graphics/GraphicsTypes.h"
-#include "core/platform/graphics/Pattern.h"
+#include "third_party/skia/include/core/SkPaint.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
-#include "third_party/skia/include/core/SkColorPriv.h"
-#include "third_party/skia/include/effects/SkDashPathEffect.h"
-
-#include "wtf/PassOwnPtr.h"
+class SkDashPathEffect;
namespace WebCore {
+class Gradient;
+class Pattern;
+
// Encapsulates stroke painting information.
// It is pulled out of GraphicsContextState to enable other methods to use it.
class StrokeData {
public:
- 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(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()
- {
- SkSafeUnref(m_dash);
- }
+ StrokeData();
+ StrokeData(const StrokeData& other);
+ ~StrokeData();
StrokeStyle style() const { return m_style; }
void setStyle(const StrokeStyle style) { m_style = style; }
@@ -82,15 +58,13 @@ public:
void setThickness(const float thickness) { m_thickness = thickness; }
Color color() const { return m_color; }
- void setColor(const Color& color) { m_color = color; }
+ void setColor(const Color&);
Gradient* gradient() const { return m_gradient.get(); }
- void setGradient(const PassRefPtr<Gradient> gradient) { m_gradient = gradient; }
- void clearGradient() { m_gradient.clear(); }
+ void setGradient(PassRefPtr<Gradient>);
Pattern* pattern() const { return m_pattern.get(); }
- void setPattern(const PassRefPtr<Pattern> pattern) { m_pattern = pattern; }
- void clearPattern() { m_pattern.clear(); }
+ void setPattern(PassRefPtr<Pattern>);
LineCap lineCap() const { return (LineCap)m_lineCap; }
void setLineCap(const LineCap cap) { m_lineCap = (SkPaint::Cap)cap; }
« no previous file with comments | « Source/core/platform/graphics/RoundedRect.cpp ('k') | Source/core/platform/graphics/StrokeData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698