Bug 1288194 Part 1: Implement PathBuilderRecording::Arc correctly. draft
authorBob Owen <bobowencode@gmail.com>
Mon, 08 Aug 2016 17:11:38 +0100
changeset 397864 46c24ebdf1726036caa2ed02c6360ac30bd90299
parent 397822 e78975b53563d80c99ebfbdf8a9fbf6b829a8a48
child 397865 15b326c4ed3724c33bd17a8ee1c71ca8748db062
push id25434
push userbobowencode@gmail.com
push dateMon, 08 Aug 2016 16:44:16 +0000
bugs1288194
milestone51.0a1
Bug 1288194 Part 1: Implement PathBuilderRecording::Arc correctly. MozReview-Commit-ID: Iz7Io8IxHvR
gfx/2d/PathRecording.h
--- 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();