Example #1
0
void
PathBuilderCG::Arc(const Point &aOrigin, Float aRadius, Float aStartAngle,
                 Float aEndAngle, bool aAntiClockwise)
{
  if (!aOrigin.IsFinite() || !IsFinite(aRadius) ||
      !IsFinite(aStartAngle) || !IsFinite(aEndAngle)) {
    return;
  }

  // Disabled for now due to a CG bug when using CGPathAddArc with stroke
  // dashing and rotation transforms that are multiples of 90 degrees. See:
  // https://bugzilla.mozilla.org/show_bug.cgi?id=949661#c8
#if 0
  // Core Graphic's initial coordinate system is y-axis up, whereas Moz2D's is
  // y-axis down. Core Graphics therefore considers "clockwise" to mean "sweep
  // in the direction of decreasing angle" whereas Moz2D considers it to mean
  // "sweep in the direction of increasing angle". In other words if this
  // Moz2D method is instructed to sweep anti-clockwise we need to tell
  // CGPathAddArc to sweep clockwise, and vice versa. Hence why we pass the
  // value of aAntiClockwise directly to CGPathAddArc's "clockwise" bool
  // parameter.
  CGPathAddArc(mCGPath, nullptr,
               aOrigin.x, aOrigin.y,
               aRadius,
               aStartAngle,
               aEndAngle,
               aAntiClockwise);
#endif
  ArcToBezier(this, aOrigin, Size(aRadius, aRadius), aStartAngle, aEndAngle,
              aAntiClockwise);
}
Example #2
0
void
PathBuilderCairo::Arc(const Point &aOrigin, float aRadiusX, float aRadiusY, float aRotationAngle,
                     float aStartAngle, float aEndAngle, bool aAntiClockwise)
{
  ArcToBezier(this, aOrigin, Size(aRadiusX, aRadiusY), aStartAngle, aEndAngle, aAntiClockwise);
}
Example #3
0
void
FlattenedPath::Arc(const Point &aOrigin, float aRadius, float aStartAngle,
                   float aEndAngle, bool aAntiClockwise)
{
  ArcToBezier(this, aOrigin, Size(aRadius, aRadius), aStartAngle, aEndAngle, aAntiClockwise);
}
Example #4
0
void
PathBuilderSkia::Arc(const Point &aOrigin, float aRadius, float aStartAngle,
                     float aEndAngle, bool aAntiClockwise)
{
  ArcToBezier(this, aOrigin, aRadius, aStartAngle, aEndAngle, aAntiClockwise);
}