Bug 1288194 Part 1: Implement PathBuilderRecording::Arc correctly.
MozReview-Commit-ID: Iz7Io8IxHvR
--- a/gfx/2d/PathRecording.h
+++ b/gfx/2d/PathRecording.h
@@ -5,16 +5,18 @@
#ifndef MOZILLA_GFX_PATHRECORDING_H_
#define MOZILLA_GFX_PATHRECORDING_H_
#include "2D.h"
#include <vector>
#include <ostream>
+#include "PathHelpers.h"
+
namespace mozilla {
namespace gfx {
struct PathOp
{
enum OpType {
OP_MOVETO = 0,
OP_LINETO,
@@ -58,17 +60,21 @@ public:
virtual void QuadraticBezierTo(const Point &aCP1,
const Point &aCP2);
/* Close the current figure, this will essentially generate a line segment
* from the current point to the starting point for the current figure
*/
virtual void Close();
/* Add an arc to the current figure */
- virtual void Arc(const Point &, float, float, float, bool) { }
+ virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
+ float aEndAngle, bool aAntiClockwise) {
+ ArcToBezier(this, aOrigin, Size(aRadius, aRadius), aStartAngle, aEndAngle,
+ aAntiClockwise);
+ }
/* Point the current subpath is at - or where the next subpath will start
* if there is no active subpath.
*/
virtual Point CurrentPoint() const;
virtual already_AddRefed<Path> Finish();