#include "third_party/blink/renderer/core/paint/styleable_marker_painter.h"
#include "build/build_config.h"
#include "third_party/blink/renderer/core/editing/markers/styleable_marker.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_rect.h"
#include "third_party/blink/renderer/core/paint/decoration_line_painter.h"
#include "third_party/blink/renderer/core/paint/line_relative_rect.h"
#include "third_party/blink/renderer/core/paint/paint_auto_dark_mode.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
#include "third_party/blink/renderer/platform/geometry/layout_unit.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context_state_saver.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_shader.h"
#include "third_party/blink/renderer/platform/graphics/styled_stroke_data.h"
#include "third_party/skia/include/core/SkPath.h"
namespace blink {
namespace {
#if !BUILDFLAG(IS_APPLE)
static const float kMarkerWidth = …;
static const float kMarkerHeight = …;
PaintRecord RecordMarker(Color blink_color) { … }
#else
static const float kMarkerWidth = 4;
static const float kMarkerHeight = 3;
static const float kMarkerSpacing = 1;
PaintRecord RecordMarker(Color blink_color) {
const SkColor color = blink_color.Rgb();
static const float kR = 1.5f;
cc::PaintFlags flags;
flags.setAntiAlias(true);
flags.setColor(color);
PaintRecorder recorder;
recorder.beginRecording();
recorder.getRecordingCanvas()->drawOval(SkRect::MakeWH(2 * kR, 2 * kR),
flags);
return recorder.finishRecordingAsPicture();
}
#endif
void DrawDocumentMarker(GraphicsContext& context,
const gfx::PointF& pt,
float width,
float zoom,
PaintRecord marker) { … }
}
bool StyleableMarkerPainter::ShouldPaintUnderline(
const StyleableMarker& marker) { … }
void StyleableMarkerPainter::PaintUnderline(const StyleableMarker& marker,
GraphicsContext& context,
const PhysicalOffset& box_origin,
const ComputedStyle& style,
const LineRelativeRect& marker_rect,
LayoutUnit logical_height,
bool in_dark_mode) { … }
}