OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights reserv ed. | 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights reserv ed. |
3 * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved. | 3 * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 void lineTo(float x, float y); | 45 void lineTo(float x, float y); |
46 void quadraticCurveTo(float cpx, float cpy, float x, float y); | 46 void quadraticCurveTo(float cpx, float cpy, float x, float y); |
47 void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y); | 47 void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y); |
48 void arcTo(float x0, float y0, float x1, float y1, float radius, ExceptionSt ate&); | 48 void arcTo(float x0, float y0, float x1, float y1, float radius, ExceptionSt ate&); |
49 void arc(float x, float y, float radius, float startAngle, float endAngle, b ool anticlockwise, ExceptionState&); | 49 void arc(float x, float y, float radius, float startAngle, float endAngle, b ool anticlockwise, ExceptionState&); |
50 void ellipse(float x, float y, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise, ExceptionState&); | 50 void ellipse(float x, float y, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise, ExceptionState&); |
51 void rect(float x, float y, float width, float height); | 51 void rect(float x, float y, float width, float height); |
52 | 52 |
53 virtual bool isTransformInvertible() const { return true; } | 53 virtual bool isTransformInvertible() const { return true; } |
54 | 54 |
55 // CanvasPathMethods JS API. | |
56 static void closePath(CanvasPathMethods& object) | |
Justin Novosad
2014/03/10 18:15:38
How is adding this indirection better than what we
| |
57 { object.closePath(); } | |
58 static void moveTo(CanvasPathMethods& object, float x, float y) | |
59 { object.moveTo(x, y); } | |
60 static void lineTo(CanvasPathMethods& object, float x, float y) | |
61 { object.lineTo(x, y); } | |
62 static void quadraticCurveTo(CanvasPathMethods& object, float cpx, float cpy , float x, float y) | |
63 { object.quadraticCurveTo(cpx, cpy, x, y); } | |
64 static void bezierCurveTo(CanvasPathMethods& object, float cp1x, float cp1y, float cp2x, float cp2y, float x, float y) | |
65 { object.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); } | |
66 static void arcTo(CanvasPathMethods& object, float x0, float y0, float x1, f loat y1, float radius, ExceptionState& es) | |
67 { object.arcTo(x0, y0, x1, y1, radius, es); } | |
68 static void arc(CanvasPathMethods& object, float x, float y, float radius, f loat startAngle, float endAngle, bool anticlockwise, ExceptionState& es) | |
69 { object.arc(x, y, radius, startAngle, endAngle, anticlockwise, es); } | |
70 static void ellipse(CanvasPathMethods& object, float x, float y, float radiu sX, float radiusY, float rotation, float startAngle, float endAngle, bool anticl ockwise, ExceptionState& es) | |
71 { object.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise, es); } | |
72 static void rect(CanvasPathMethods& object, float x, float y, float width, f loat height) | |
73 { object.rect(x, y, width, height); } | |
74 | |
55 protected: | 75 protected: |
56 CanvasPathMethods() { } | 76 CanvasPathMethods() { } |
57 CanvasPathMethods(const Path& path) : m_path(path) { } | 77 CanvasPathMethods(const Path& path) : m_path(path) { } |
58 Path m_path; | 78 Path m_path; |
Justin Novosad
2014/03/10 18:15:38
I think is is something that should be refactored:
| |
59 }; | 79 }; |
60 } | 80 } |
61 | 81 |
62 #endif | 82 #endif |
OLD | NEW |