| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| 11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
| 12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
| 13 * | 13 * |
| 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY |
| 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE | 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE |
| 18 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, | 18 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, |
| 19 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 19 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
| 23 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 23 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
| 24 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 24 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 25 * SUCH DAMAGE. | 25 * SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef DOMPath_h | 28 #ifndef DOMPath2D_h |
| 29 #define DOMPath_h | 29 #define DOMPath2D_h |
| 30 | 30 |
| 31 #include "bindings/v8/ScriptWrappable.h" | 31 #include "bindings/v8/ScriptWrappable.h" |
| 32 #include "core/html/canvas/CanvasPathMethods.h" | 32 #include "core/html/canvas/CanvasPathMethods.h" |
| 33 #include "core/svg/SVGPathUtilities.h" | 33 #include "core/svg/SVGPathUtilities.h" |
| 34 #include "wtf/PassRefPtr.h" | 34 #include "wtf/PassRefPtr.h" |
| 35 #include "wtf/RefCounted.h" | 35 #include "wtf/RefCounted.h" |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace WebCore { |
| 38 | 38 |
| 39 class DOMPath FINAL : public RefCounted<DOMPath>, public CanvasPathMethods, publ
ic ScriptWrappable { | 39 class DOMPath2D FINAL : public RefCounted<DOMPath2D>, public CanvasPathMethods,
public ScriptWrappable { |
| 40 WTF_MAKE_NONCOPYABLE(DOMPath); WTF_MAKE_FAST_ALLOCATED; | 40 WTF_MAKE_NONCOPYABLE(DOMPath2D); WTF_MAKE_FAST_ALLOCATED; |
| 41 public: | 41 public: |
| 42 static PassRefPtr<DOMPath> create() { return adoptRef(new DOMPath); } | 42 static PassRefPtr<DOMPath2D> create() { return adoptRef(new DOMPath2D); } |
| 43 static PassRefPtr<DOMPath> create(const String& pathData) { return adoptRef(
new DOMPath(pathData)); } | 43 static PassRefPtr<DOMPath2D> create(const String& pathData) { return adoptRe
f(new DOMPath2D(pathData)); } |
| 44 static PassRefPtr<DOMPath> create(DOMPath* path) { return adoptRef(new DOMPa
th(path)); } | 44 static PassRefPtr<DOMPath2D> create(DOMPath2D* path) { return adoptRef(new D
OMPath2D(path)); } |
| 45 | 45 |
| 46 static PassRefPtr<DOMPath> create(const Path& path) { return adoptRef(new DO
MPath(path)); } | 46 static PassRefPtr<DOMPath2D> create(const Path& path) { return adoptRef(new
DOMPath2D(path)); } |
| 47 | 47 |
| 48 const Path& path() const { return m_path; } | 48 const Path& path() const { return m_path; } |
| 49 | 49 |
| 50 virtual ~DOMPath() { } | 50 virtual ~DOMPath2D() { } |
| 51 private: | 51 private: |
| 52 DOMPath() : CanvasPathMethods() | 52 DOMPath2D() : CanvasPathMethods() |
| 53 { | 53 { |
| 54 ScriptWrappable::init(this); | 54 ScriptWrappable::init(this); |
| 55 } | 55 } |
| 56 | 56 |
| 57 DOMPath(const Path& path) | 57 DOMPath2D(const Path& path) |
| 58 : CanvasPathMethods() | 58 : CanvasPathMethods() |
| 59 { | 59 { |
| 60 ScriptWrappable::init(this); | 60 ScriptWrappable::init(this); |
| 61 m_path = path; | 61 m_path = path; |
| 62 } | 62 } |
| 63 | 63 |
| 64 DOMPath(DOMPath* path) | 64 DOMPath2D(DOMPath2D* path) |
| 65 : CanvasPathMethods() | 65 : CanvasPathMethods() |
| 66 { | 66 { |
| 67 ScriptWrappable::init(this); | 67 ScriptWrappable::init(this); |
| 68 m_path = path->path(); | 68 m_path = path->path(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 DOMPath(const String& pathData) | 71 DOMPath2D(const String& pathData) |
| 72 : CanvasPathMethods() | 72 : CanvasPathMethods() |
| 73 { | 73 { |
| 74 ScriptWrappable::init(this); | 74 ScriptWrappable::init(this); |
| 75 buildPathFromString(pathData, m_path); | 75 buildPathFromString(pathData, m_path); |
| 76 } | 76 } |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } | 79 } |
| 80 #endif | 80 #endif |
| OLD | NEW |