Changeset 141456 in webkit
- Timestamp:
- Jan 31, 2013 11:46:50 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r141449 r141456 1 2013-01-31 Dirk Schulze <krit@webkit.org> 2 3 [canvas] Implement currentPath to get and set the current path of the context 4 https://bugs.webkit.org/show_bug.cgi?id=108246 5 6 Reviewed by Dean Jackson. 7 8 Added tests for canvas.currentPath in various combinations of the context state. 9 10 * fast/canvas/canvas-currentPath-expected.txt: Added. 11 * fast/canvas/canvas-currentPath.html: Added. 12 * fast/canvas/script-tests/canvas-currentPath.js: Added. 13 (testPointCollection): 14 * platform/chromium/TestExpectations: Skip test until enabling CANVAS_PATH. 15 * platform/efl/TestExpectations: Ditto. 16 * platform/gtk/TestExpectations: Ditto. 17 * platform/mac/TestExpectations: Ditto. 18 * platform/qt/TestExpectations: Ditto. 19 1 20 2013-01-31 Tony Chang <tony@chromium.org> 2 21 -
trunk/LayoutTests/platform/chromium/TestExpectations
r141449 r141456 4254 4254 webkit.org/b/107508 platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-step.html [ ImageOnlyFailure Pass ] 4255 4255 webkit.org/b/107508 platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance.html [ ImageOnlyFailure Pass ] 4256 4256 4257 # Rebaseline after currentPath 4258 webkit.org/b/108246 fast/canvas/canvas-currentPath.html [ Failure ] 4259 webkit.org/b/108246 platform/chromium/virtual/gpu/fast/canvas/canvas-currentPath.html [ Failure ] 4260 4257 4261 # Broken by Skia flag changes in r139445 4258 4262 crbug.com/169550 [ Debug ] fast/lists/big-list-marker.html [ Crash ] -
trunk/LayoutTests/platform/efl/TestExpectations
r141439 r141456 1811 1811 inspector/editor/text-editor-ctrl-movements.html 1812 1812 1813 # Remove from list after enabling CANVAS_PATH 1814 webkit.org/b/108508 fast/canvas/canvas-currentPath.html [ Failure ] 1815 1813 1816 # Test fails on JSC platforms due to GC timing problems 1814 1817 webkit.org/b/106957 svg/dom/SVGViewSpec-invalid-ref-crash.html [ Failure ] -
trunk/LayoutTests/platform/gtk/TestExpectations
r141434 r141456 1370 1370 webkit.org/b/103740 editing/selection/caret-alignment-for-vertical-text.html [ Failure ] 1371 1371 1372 # Remove from list after enabling CANVAS_PATH 1373 webkit.org/b/108508 fast/canvas/canvas-currentPath.html [ Failure ] 1374 1372 1375 # volume is reset when mediaelement.src is modified 1373 1376 webkit.org/b/103893 media/video-volume.html [ Failure ] -
trunk/LayoutTests/platform/mac/TestExpectations
r141418 r141456 140 140 http/tests/security/cross-origin-worker-indexeddb-allowed.html 141 141 http/tests/security/cross-origin-worker-indexeddb.html 142 143 # Remove from list after enabling CANVAS_PATH 144 fast/canvas/canvas-currentPath.html 142 145 143 146 # This port doesn't support DeviceMotion or DeviceOrientation. -
trunk/LayoutTests/platform/qt/TestExpectations
r141423 r141456 90 90 # ENABLE_GAMEPAD not enabled. 91 91 gamepad/ 92 93 # Remove from list after enabling CANVAS_PATH 94 fast/canvas/canvas-currentPath.html 92 95 93 96 # ENABLE(INPUT_SPEECH) is disabled. -
trunk/LayoutTests/platform/win/TestExpectations
r141418 r141456 44 44 # Custom filters not yet supported on Windows 45 45 css3/filters/custom 46 47 # Remove from list after enabling CANVAS_PATH 48 fast/canvas/canvas-currentPath.html 46 49 47 50 # Needs rebaseline after bug 97217 is fixed -
trunk/Source/WebCore/ChangeLog
r141450 r141456 1 2013-01-31 Dirk Schulze <krit@webkit.org> 2 3 [canvas] Implement currentPath to get and set the current path of the context 4 https://bugs.webkit.org/show_bug.cgi?id=108246 5 6 Reviewed by Dean Jackson. 7 8 Add currentPath attribute to CanvasRenderingContext2d interface. This allows 9 setting the current context path by an existing Path object as well as getting 10 the current context path as new Path object. The returned and the set Paths 11 are not live. 12 13 This feature is behind the CANVAS_PATH compiler flag which is disabled by 14 default for now. 15 16 Test: fast/canvas/canvas-currentPath.html 17 18 * html/canvas/CanvasPathMethods.cpp: Rename transformIsInvertible to 19 isTransformInvertible for harmonizing naming schema. 20 (WebCore::CanvasPathMethods::moveTo): Ditto. 21 (WebCore::CanvasPathMethods::lineTo): Ditto. 22 (WebCore::CanvasPathMethods::quadraticCurveTo): Ditto. 23 (WebCore::CanvasPathMethods::bezierCurveTo): Ditto. 24 (WebCore::CanvasPathMethods::arcTo): Ditto. 25 (WebCore::CanvasPathMethods::arc): Ditto. 26 (WebCore::CanvasPathMethods::rect): Ditto. 27 * html/canvas/CanvasPathMethods.h: Ditto. 28 (CanvasPathMethods): 29 (WebCore::CanvasPathMethods::isTransformInvertible): 30 * html/canvas/CanvasRenderingContext2D.cpp: 31 (WebCore): 32 (WebCore::CanvasRenderingContext2D::currentPath): Getter for currentPath. 33 (WebCore::CanvasRenderingContext2D::setCurrentPath): Setter for currentPath. 34 * html/canvas/CanvasRenderingContext2D.h: 35 (WebCore): 36 (CanvasRenderingContext2D): 37 (WebCore::CanvasRenderingContext2D::isTransformInvertible): 38 * html/canvas/CanvasRenderingContext2D.idl: Add currentPath attribute. 39 * html/canvas/DOMPath.h: Add new constructor and getter for Path object. 40 (WebCore::DOMPath::create): New static function for new ctor. 41 (DOMPath): 42 (WebCore::DOMPath::path): Getter for Path object. 43 (WebCore::DOMPath::DOMPath): 44 1 45 2013-01-31 Alexandre Elias <aelias@chromium.org> 2 46 -
trunk/Source/WebCore/html/canvas/CanvasPathMethods.cpp
r140604 r141456 56 56 if (!isfinite(x) || !isfinite(y)) 57 57 return; 58 if (! transformIsInvertible())58 if (!isTransformInvertible()) 59 59 return; 60 60 m_path.moveTo(FloatPoint(x, y)); … … 65 65 if (!isfinite(x) || !isfinite(y)) 66 66 return; 67 if (! transformIsInvertible())67 if (!isTransformInvertible()) 68 68 return; 69 69 … … 79 79 if (!isfinite(cpx) || !isfinite(cpy) || !isfinite(x) || !isfinite(y)) 80 80 return; 81 if (! transformIsInvertible())81 if (!isTransformInvertible()) 82 82 return; 83 83 if (!m_path.hasCurrentPoint()) … … 93 93 if (!isfinite(cp1x) || !isfinite(cp1y) || !isfinite(cp2x) || !isfinite(cp2y) || !isfinite(x) || !isfinite(y)) 94 94 return; 95 if (! transformIsInvertible())95 if (!isTransformInvertible()) 96 96 return; 97 97 if (!m_path.hasCurrentPoint()) … … 114 114 } 115 115 116 if (! transformIsInvertible())116 if (!isTransformInvertible()) 117 117 return; 118 118 … … 145 145 } 146 146 147 if (! transformIsInvertible())147 if (!isTransformInvertible()) 148 148 return; 149 149 … … 163 163 void CanvasPathMethods::rect(float x, float y, float width, float height) 164 164 { 165 if (! transformIsInvertible())165 if (!isTransformInvertible()) 166 166 return; 167 167 -
trunk/Source/WebCore/html/canvas/CanvasPathMethods.h
r140604 r141456 52 52 void arc(float x, float y, float r, float sa, float ea, bool anticlockwise, ExceptionCode&); 53 53 void rect(float x, float y, float width, float height); 54 55 virtual bool transformIsInvertible(){ return true; }54 55 virtual bool isTransformInvertible() const { return true; } 56 56 57 57 protected: -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r141141 r141456 43 43 #include "CanvasStyle.h" 44 44 #include "Console.h" 45 #include "DOMPath.h" 45 46 #include "ExceptionCode.h" 46 47 #include "FloatConversion.h" … … 859 860 } 860 861 862 #if ENABLE(CANVAS_PATH) 863 PassRefPtr<DOMPath> CanvasRenderingContext2D::currentPath() 864 { 865 return DOMPath::create(m_path); 866 } 867 868 void CanvasRenderingContext2D::setCurrentPath(DOMPath* path) 869 { 870 m_path = path->path(); 871 } 872 #endif 873 861 874 static bool validateRectForCanvas(float& x, float& y, float& width, float& height) 862 875 { -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
r141141 r141456 50 50 class CanvasPattern; 51 51 class CanvasStyle; 52 #if ENABLE(CANVAS_PATH) 53 class DOMPath; 54 #endif 52 55 class FloatRect; 53 56 class GraphicsContext; … … 138 141 void beginPath(); 139 142 143 #if ENABLE(CANVAS_PATH) 144 PassRefPtr<DOMPath> currentPath(); 145 void setCurrentPath(DOMPath*); 146 #endif 140 147 void fill(const String& winding = "nonzero"); 141 148 void stroke(); … … 325 332 virtual bool isAccelerated() const OVERRIDE; 326 333 327 virtual bool transformIsInvertible(){ return state().m_invertibleCTM; }334 virtual bool isTransformInvertible() const { return state().m_invertibleCTM; } 328 335 329 336 #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
r141141 r141456 97 97 void beginPath(); 98 98 99 #if defined(ENABLE_CANVAS_PATH) && ENABLE_CANVAS_PATH 100 attribute DOMPath currentPath; 101 #endif 102 99 103 // FIXME: These methods should be shared with CanvasRenderingContext2D in the CanvasPathMethods interface. 100 104 void closePath(); -
trunk/Source/WebCore/html/canvas/DOMPath.h
r140604 r141456 40 40 public: 41 41 static PassRefPtr<DOMPath> create() { return adoptRef(new DOMPath); } 42 static PassRefPtr<DOMPath> create(const Path& path) { return adoptRef(new DOMPath(path)); } 43 44 const Path& path() const { return m_path; } 45 42 46 virtual ~DOMPath() { } 43 47 private: 44 48 DOMPath() : CanvasPathMethods() { } 49 DOMPath(const Path& path) 50 : CanvasPathMethods() 51 { 52 m_path = path; 53 } 45 54 }; 46 55 }
Note: See TracChangeset
for help on using the changeset viewer.