Bug 1288194 - Part 1: Implement PathBuilderRecording::Arc correctly. r=bas, a=ritu
authorBob Owen <bobowencode@gmail.com>
Mon, 08 Aug 2016 17:11:38 +0100
changeset 349884 45e8335e629e371a21f4c1effe65c012956e1c45
parent 349883 a1d6e5e2864b11d5224c4002b4f8b9b41d2992cc
child 349885 9d5109af8c1d562bbdf30e035a2021717453d16e
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, ritu
bugs1288194
milestone50.0a2
Bug 1288194 - Part 1: Implement PathBuilderRecording::Arc correctly. r=bas, a=ritu 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();