#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/modules/canvas/canvas2d/canvas_path.h"
#include <cmath>
#include <ostream>
#include <utility>
#include "base/check.h"
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/numerics/safe_conversions.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_dom_point_init.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_dompointinit_unrestricteddouble.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/modules/canvas/canvas2d/identifiability_study_helper.h"
#include "third_party/blink/renderer/platform/bindings/exception_code.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/geometry/float_rounded_rect.h"
#include "third_party/blink/renderer/platform/graphics/path.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
#include "third_party/blink/renderer/platform/heap/member.h"
#include "third_party/blink/renderer/platform/heap/visitor.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/transforms/affine_transform.h"
#include "third_party/blink/renderer/platform/wtf/math_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/string_operators.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/size_f.h"
namespace blink {
void CanvasPath::closePath() { … }
void CanvasPath::moveTo(double double_x, double double_y) { … }
void CanvasPath::lineTo(double double_x, double double_y) { … }
void CanvasPath::quadraticCurveTo(double double_cpx,
double double_cpy,
double double_x,
double double_y) { … }
void CanvasPath::bezierCurveTo(double double_cp1x,
double double_cp1y,
double double_cp2x,
double double_cp2y,
double double_x,
double double_y) { … }
void CanvasPath::arcTo(double double_x1,
double double_y1,
double double_x2,
double double_y2,
double double_r,
ExceptionState& exception_state) { … }
namespace {
float AdjustEndAngle(float start_angle, float end_angle, bool anticlockwise) { … }
inline void LineTo(CanvasPath* path, const gfx::PointF& p) { … }
inline gfx::PointF GetPointOnEllipse(float radius_x,
float radius_y,
float theta) { … }
void CanonicalizeAngle(float* start_angle, float* end_angle) { … }
void DegenerateEllipse(CanvasPath* path,
float x,
float y,
float radius_x,
float radius_y,
float rotation,
float start_angle,
float end_angle,
bool anticlockwise) { … }
}
void CanvasPath::arc(double double_x,
double double_y,
double double_radius,
double double_start_angle,
double double_end_angle,
bool anticlockwise,
ExceptionState& exception_state) { … }
void CanvasPath::ellipse(double double_x,
double double_y,
double double_radius_x,
double double_radius_y,
double double_rotation,
double double_start_angle,
double double_end_angle,
bool anticlockwise,
ExceptionState& exception_state) { … }
void CanvasPath::rect(double double_x,
double double_y,
double double_width,
double double_height) { … }
void CanvasPath::roundRect(
double double_x,
double double_y,
double double_width,
double double_height,
const HeapVector<Member<V8UnionDOMPointInitOrUnrestrictedDouble>>& radii,
ExceptionState& exception_state) { … }
void CanvasPath::roundRect(
double double_x,
double double_y,
double double_width,
double double_height,
const Member<V8UnionDOMPointInitOrUnrestrictedDouble>& radius,
ExceptionState& exception_state) { … }
gfx::RectF CanvasPath::BoundingRect() const { … }
void CanvasPath::Trace(Visitor* visitor) const { … }
ALWAYS_INLINE gfx::RectF CanvasPath::LineBuilder::BoundingRect() const { … }
ALWAYS_INLINE gfx::RectF CanvasPath::ArcBuilder::BoundingRect() const { … }
ALWAYS_INLINE void CanvasPath::ArcBuilder::UpdatePath(Path& path) const { … }
void CanvasPath::UpdatePathFromLineOrArcIfNecessary() const { … }
void CanvasPath::UpdatePathFromLineOrArcIfNecessaryForMutation() { … }
}