#include "third_party/blink/renderer/core/paint/outline_painter.h"
#include <optional>
#include "build/build_config.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_rect.h"
#include "third_party/blink/renderer/core/paint/box_border_painter.h"
#include "third_party/blink/renderer/core/paint/paint_auto_dark_mode.h"
#include "third_party/blink/renderer/core/paint/paint_info.h"
#include "third_party/blink/renderer/core/paint/rounded_border_geometry.h"
#include "third_party/blink/renderer/core/style/border_edge.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/platform/graphics/color.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context_state_saver.h"
#include "third_party/blink/renderer/platform/graphics/paint/drawing_recorder.h"
#include "third_party/blink/renderer/platform/graphics/path.h"
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/graphics/stroke_data.h"
#include "third_party/blink/renderer/platform/graphics/styled_stroke_data.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/native_theme/native_theme.h"
namespace blink {
namespace {
float FocusRingStrokeWidth(const ComputedStyle& style) { … }
float FocusRingOuterStrokeWidth(const ComputedStyle& style) { … }
float FocusRingInnerStrokeWidth(const ComputedStyle& style) { … }
int FocusRingOffset(const ComputedStyle& style,
const LayoutObject::OutlineInfo& info) { … }
gfx::Outsets AdjustedOutlineOffset(const gfx::Rect& rect, int offset) { … }
bool ComputeRightAnglePath(SkPath& path,
const Vector<gfx::Rect>& rects,
int outline_offset,
int additional_outset) { … }
Line;
bool MergeLineIfPossible(Line& line1, const Line& line2) { … }
template <typename Action>
void IterateRightAnglePath(const SkPath& path, const Action& contour_action) { … }
SkPoint ShrinkCorner(const SkPoint& p1,
const SkPoint& p2,
const SkPoint& p3,
int inset) { … }
void ShrinkRightAnglePath(SkPath& path, int inset) { … }
FloatRoundedRect::Radii ComputeCornerRadii(
const ComputedStyle& style,
const PhysicalRect& reference_border_rect,
float offset) { … }
gfx::SizeF GetRadiiCorner(const FloatRoundedRect::Radii& convex_radii,
const FloatRoundedRect::Radii& concave_radii,
const SkPoint& p1,
const SkPoint& p2,
const SkPoint& p3) { … }
void AdjustLineBetweenCorners(Line& line,
const FloatRoundedRect::Radii& convex_radii,
const FloatRoundedRect::Radii& concave_radii,
const SkPoint& prev_point,
const SkPoint& next_point) { … }
constexpr float kCornerConicWeight = …;
void AddCornerRadiiToPath(SkPath& path,
const FloatRoundedRect::Radii& convex_radii,
const FloatRoundedRect::Radii& concave_radii) { … }
void ExtendLineAtEndpoint(SkPoint& point, const SkPoint& other, int offset) { … }
class RoundedEdgePathIterator { … };
class ComplexOutlinePainter { … };
float DefaultFocusRingCornerRadius(const ComputedStyle& style) { … }
FloatRoundedRect::Radii GetFocusRingCornerRadii(
const ComputedStyle& style,
const PhysicalRect& reference_border_rect,
const LayoutObject::OutlineInfo& info) { … }
void PaintSingleFocusRing(GraphicsContext& context,
const Vector<gfx::Rect>& rects,
float width,
int offset,
const FloatRoundedRect::Radii& corner_radii,
const Color& color,
const AutoDarkMode& auto_dark_mode) { … }
void PaintFocusRing(GraphicsContext& context,
const Vector<gfx::Rect>& rects,
const ComputedStyle& style,
const FloatRoundedRect::Radii& corner_radii,
const LayoutObject::OutlineInfo& info) { … }
}
void OutlinePainter::PaintOutlineRects(
const PaintInfo& paint_info,
const DisplayItemClient& client,
const Vector<PhysicalRect>& outline_rects,
const LayoutObject::OutlineInfo& info,
const ComputedStyle& style) { … }
void OutlinePainter::PaintFocusRingPath(GraphicsContext& context,
const Path& focus_ring_path,
const ComputedStyle& style) { … }
int OutlinePainter::OutlineOutsetExtent(const ComputedStyle& style,
const LayoutObject::OutlineInfo& info) { … }
void OutlinePainter::IterateRightAnglePathForTesting(
const SkPath& path,
const base::RepeatingCallback<void(const Vector<Line>&)>& contour_action) { … }
}