#include "third_party/blink/renderer/core/paint/text_decoration_info.h"
#include <math.h>
#include "build/build_config.h"
#include "third_party/blink/renderer/core/layout/text_decoration_offset.h"
#include "third_party/blink/renderer/core/paint/decoration_line_painter.h"
#include "third_party/blink/renderer/core/paint/inline_paint_context.h"
#include "third_party/blink/renderer/core/paint/text_paint_style.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/platform/geometry/length_functions.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/stroke_data.h"
#include "third_party/blink/renderer/platform/graphics/styled_stroke_data.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
namespace blink {
namespace {
inline float GetAscent(const ComputedStyle& style, const Font* font_override) { … }
static ResolvedUnderlinePosition ResolveUnderlinePosition(
const ComputedStyle& style) { … }
inline bool ShouldUseDecoratingBox(const ComputedStyle& style) { … }
static float ComputeDecorationThickness(
const TextDecorationThickness text_decoration_thickness,
float computed_font_size,
float minimum_thickness,
const SimpleFontData* font_data) { … }
static enum StrokeStyle TextDecorationStyleToStrokeStyle(
ETextDecorationStyle decoration_style) { … }
struct WavyParams { … };
float WavyControlPointDistance(const WavyParams& params) { … }
float WavyStep(const WavyParams& params) { … }
gfx::RectF ComputeWavyPatternRect(const WavyParams& params,
const Path& stroke_path) { … }
Path PrepareWavyStrokePath(const WavyParams& params) { … }
cc::PaintRecord PrepareWavyTileRecord(const WavyParams& params,
const Path& stroke_path,
const gfx::RectF& pattern_rect) { … }
}
TextDecorationInfo::TextDecorationInfo(
LineRelativeOffset local_origin,
LayoutUnit width,
const ComputedStyle& target_style,
const InlinePaintContext* inline_context,
const TextDecorationLine selection_decoration_line,
const Color selection_decoration_color,
const AppliedTextDecoration* decoration_override,
const Font* font_override,
MinimumThickness1 minimum_thickness1,
float scaling_factor)
: … { … }
wtf_size_t TextDecorationInfo::AppliedDecorationCount() const { … }
const AppliedTextDecoration& TextDecorationInfo::AppliedDecoration(
wtf_size_t index) const { … }
void TextDecorationInfo::SetDecorationIndex(int decoration_index) { … }
void TextDecorationInfo::UpdateForDecorationIndex() { … }
void TextDecorationInfo::SetLineData(TextDecorationLine line,
float line_offset) { … }
LayoutUnit TextDecorationInfo::OffsetFromDecoratingBox() const { … }
void TextDecorationInfo::SetUnderlineLineData(
const TextDecorationOffset& decoration_offset) { … }
void TextDecorationInfo::SetOverlineLineData(
const TextDecorationOffset& decoration_offset) { … }
void TextDecorationInfo::SetLineThroughLineData() { … }
void TextDecorationInfo::SetSpellingOrGrammarErrorLineData(
const TextDecorationOffset& decoration_offset) { … }
bool TextDecorationInfo::ShouldAntialias() const { … }
ETextDecorationStyle TextDecorationInfo::DecorationStyle() const { … }
Color TextDecorationInfo::LineColor() const { … }
gfx::PointF TextDecorationInfo::StartPoint() const { … }
float TextDecorationInfo::DoubleOffset() const { … }
enum StrokeStyle TextDecorationInfo::StrokeStyle() const { … }
float TextDecorationInfo::ComputeThickness() const { … }
float TextDecorationInfo::ComputeUnderlineThickness(
const TextDecorationThickness& applied_decoration_thickness,
const ComputedStyle* decorating_box_style) const { … }
void TextDecorationInfo::ComputeWavyLineData(
gfx::RectF& pattern_rect,
cc::PaintRecord& tile_record) const { … }
gfx::RectF TextDecorationInfo::Bounds() const { … }
gfx::RectF TextDecorationInfo::BoundsForDottedOrDashed() const { … }
gfx::RectF TextDecorationInfo::BoundsForWavy() const { … }
gfx::RectF TextDecorationInfo::WavyPaintRect() const { … }
gfx::RectF TextDecorationInfo::WavyTileRect() const { … }
cc::PaintRecord TextDecorationInfo::WavyTileRecord() const { … }
void TextDecorationInfo::SetHighlightOverrideColor(
const std::optional<Color>& color) { … }
Path TextDecorationInfo::PrepareDottedOrDashedStrokePath() const { … }
}