| 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 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 WTF_MAKE_NONCOPYABLE(Path2D); WTF_MAKE_FAST_ALLOCATED; | 42 WTF_MAKE_NONCOPYABLE(Path2D); WTF_MAKE_FAST_ALLOCATED; |
| 43 public: | 43 public: |
| 44 static PassRefPtr<Path2D> create() { return adoptRef(new Path2D); } | 44 static PassRefPtr<Path2D> create() { return adoptRef(new Path2D); } |
| 45 static PassRefPtr<Path2D> create(const String& pathData) { return adoptRef(n
ew Path2D(pathData)); } | 45 static PassRefPtr<Path2D> create(const String& pathData) { return adoptRef(n
ew Path2D(pathData)); } |
| 46 static PassRefPtr<Path2D> create(Path2D* path) { return adoptRef(new Path2D(
path)); } | 46 static PassRefPtr<Path2D> create(Path2D* path) { return adoptRef(new Path2D(
path)); } |
| 47 | 47 |
| 48 static PassRefPtr<Path2D> create(const Path& path) { return adoptRef(new Pat
h2D(path)); } | 48 static PassRefPtr<Path2D> create(const Path& path) { return adoptRef(new Pat
h2D(path)); } |
| 49 | 49 |
| 50 const Path& path() const { return m_path; } | 50 const Path& path() const { return m_path; } |
| 51 | 51 |
| 52 void addPath(Path2D* path, ExceptionState& exceptionState) | 52 void addPath(Path2D* path) |
| 53 { | 53 { |
| 54 addPath(path, 0, exceptionState); | 54 addPath(path, 0); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void addPath(Path2D* path, SVGMatrixTearOff* transform, ExceptionState& exce
ptionState) | 57 void addPath(Path2D* path, SVGMatrixTearOff* transform) |
| 58 { | 58 { |
| 59 if (!path) { | |
| 60 exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncor
rectType(1, "Path")); | |
| 61 return; | |
| 62 } | |
| 63 Path src = path->path(); | 59 Path src = path->path(); |
| 64 m_path.addPath(src, transform ? transform->value() : AffineTransform(1,
0, 0, 1, 0, 0)); | 60 m_path.addPath(src, transform ? transform->value() : AffineTransform(1,
0, 0, 1, 0, 0)); |
| 65 } | 61 } |
| 66 virtual ~Path2D() { } | 62 virtual ~Path2D() { } |
| 67 private: | 63 private: |
| 68 Path2D() : CanvasPathMethods() | 64 Path2D() : CanvasPathMethods() |
| 69 { | 65 { |
| 70 ScriptWrappable::init(this); | 66 ScriptWrappable::init(this); |
| 71 } | 67 } |
| 72 | 68 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 85 Path2D(const String& pathData) | 81 Path2D(const String& pathData) |
| 86 : CanvasPathMethods() | 82 : CanvasPathMethods() |
| 87 { | 83 { |
| 88 ScriptWrappable::init(this); | 84 ScriptWrappable::init(this); |
| 89 buildPathFromString(pathData, m_path); | 85 buildPathFromString(pathData, m_path); |
| 90 } | 86 } |
| 91 }; | 87 }; |
| 92 | 88 |
| 93 } | 89 } |
| 94 #endif | 90 #endif |
| OLD | NEW |