OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. |
3 * 2006 Rob Buis <buis@kde.org> | 3 * 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007-2008 Torch Mobile, Inc. | 4 * Copyright (C) 2007-2008 Torch Mobile, Inc. |
5 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 typedef void (*PathApplierFunction)(void* info, const PathElement*); | 64 typedef void (*PathApplierFunction)(void* info, const PathElement*); |
65 | 65 |
66 class PLATFORM_EXPORT Path { | 66 class PLATFORM_EXPORT Path { |
67 USING_FAST_MALLOC(Path); | 67 USING_FAST_MALLOC(Path); |
68 public: | 68 public: |
69 Path(); | 69 Path(); |
70 ~Path(); | 70 ~Path(); |
71 | 71 |
72 Path(const Path&); | 72 Path(const Path&); |
| 73 Path(const SkPath&); |
73 Path& operator=(const Path&); | 74 Path& operator=(const Path&); |
74 Path& operator=(const SkPath&); | 75 Path& operator=(const SkPath&); |
75 bool operator==(const Path&) const; | 76 bool operator==(const Path&) const; |
76 | 77 |
77 bool contains(const FloatPoint&) const; | 78 bool contains(const FloatPoint&) const; |
78 bool contains(const FloatPoint&, WindRule) const; | 79 bool contains(const FloatPoint&, WindRule) const; |
79 bool strokeContains(const FloatPoint&, const StrokeData&) const; | 80 bool strokeContains(const FloatPoint&, const StrokeData&) const; |
80 FloatRect boundingRect() const; | 81 FloatRect boundingRect() const; |
81 FloatRect strokeBoundingRect(const StrokeData&) const; | 82 FloatRect strokeBoundingRect(const StrokeData&) const; |
82 | 83 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 144 |
144 void apply(void* info, PathApplierFunction) const; | 145 void apply(void* info, PathApplierFunction) const; |
145 void transform(const AffineTransform&); | 146 void transform(const AffineTransform&); |
146 | 147 |
147 void addPathForRoundedRect(const FloatRect&, const FloatSize& topLeftRadius,
const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const Float
Size& bottomRightRadius); | 148 void addPathForRoundedRect(const FloatRect&, const FloatSize& topLeftRadius,
const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const Float
Size& bottomRightRadius); |
148 | 149 |
149 bool subtractPath(const Path&); | 150 bool subtractPath(const Path&); |
150 | 151 |
151 // Updates the path to the union (inclusive-or) of itself with the given arg
ument. | 152 // Updates the path to the union (inclusive-or) of itself with the given arg
ument. |
152 bool unionPath(const Path& other); | 153 bool unionPath(const Path& other); |
| 154 bool intersectPath(const Path& other); |
153 | 155 |
154 private: | 156 private: |
155 void addEllipse(const FloatPoint&, float radiusX, float radiusY, float start
Angle, float endAngle, bool anticlockwise); | 157 void addEllipse(const FloatPoint&, float radiusX, float radiusY, float start
Angle, float endAngle, bool anticlockwise); |
156 SkPath strokePath(const StrokeData&) const; | 158 SkPath strokePath(const StrokeData&) const; |
157 | 159 |
158 SkPath m_path; | 160 SkPath m_path; |
159 }; | 161 }; |
160 | 162 |
161 #if ENABLE(ASSERT) | 163 #if ENABLE(ASSERT) |
162 PLATFORM_EXPORT bool ellipseIsRenderable(float startAngle, float endAngle); | 164 PLATFORM_EXPORT bool ellipseIsRenderable(float startAngle, float endAngle); |
163 #endif | 165 #endif |
164 | 166 |
165 } // namespace blink | 167 } // namespace blink |
166 | 168 |
167 #endif | 169 #endif |
OLD | NEW |