#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h"
#include <iterator>
#include <numeric>
#include "base/containers/adapters.h"
#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "third_party/blink/renderer/platform/fonts/font.h"
#include "third_party/blink/renderer/platform/fonts/shaping/glyph_bounds_accumulator.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h"
#include "ui/gfx/geometry/skia_conversions.h"
namespace blink {
ShapeResultView::RunInfoPart::RunInfoPart(const ShapeResult::RunInfo* run,
GlyphDataRange range,
unsigned start_index,
unsigned offset,
unsigned num_characters,
float width)
: … { … }
void ShapeResultView::RunInfoPart::Trace(Visitor* visitor) const { … }
unsigned ShapeResultView::RunInfoPart::PreviousSafeToBreakOffset(
unsigned offset) const { … }
GlyphDataRange ShapeResultView::RunInfoPart::FindGlyphDataRange(
unsigned start_character_index,
unsigned end_character_index) const { … }
unsigned ShapeResultView::CharacterIndexOffsetForGlyphData(
const RunInfoPart& part) const { … }
struct ShapeResultView::InitData { … };
ShapeResultView::ShapeResultView(const InitData& data)
: … { … }
ShapeResult* ShapeResultView::CreateShapeResult() const { … }
template <class ShapeResultType>
void ShapeResultView::PopulateRunInfoParts(const ShapeResultType& other,
const Segment& segment) { … }
void ShapeResultView::PopulateRunInfoParts(const Segment& segment) { … }
ShapeResultView* ShapeResultView::Create(base::span<const Segment> segments) { … }
ShapeResultView* ShapeResultView::Create(const ShapeResult* result,
unsigned start_index,
unsigned end_index) { … }
ShapeResultView* ShapeResultView::Create(const ShapeResultView* result,
unsigned start_index,
unsigned end_index) { … }
ShapeResultView* ShapeResultView::Create(const ShapeResult* result) { … }
unsigned ShapeResultView::PreviousSafeToBreakOffset(unsigned index) const { … }
void ShapeResultView::GetRunFontData(
HeapVector<ShapeResult::RunFontData>* font_data) const { … }
HeapHashSet<Member<const SimpleFontData>> ShapeResultView::UsedFonts() const { … }
template <bool has_non_zero_glyph_offsets>
float ShapeResultView::ForEachGlyphImpl(float initial_advance,
GlyphCallback glyph_callback,
void* context,
const RunInfoPart& part) const { … }
float ShapeResultView::ForEachGlyph(float initial_advance,
GlyphCallback glyph_callback,
void* context) const { … }
template <bool has_non_zero_glyph_offsets>
float ShapeResultView::ForEachGlyphImpl(float initial_advance,
unsigned from,
unsigned to,
unsigned index_offset,
GlyphCallback glyph_callback,
void* context,
const RunInfoPart& part) const { … }
float ShapeResultView::ForEachGlyph(float initial_advance,
unsigned from,
unsigned to,
unsigned index_offset,
GlyphCallback glyph_callback,
void* context) const { … }
float ShapeResultView::ForEachGraphemeClusters(const StringView& text,
float initial_advance,
unsigned from,
unsigned to,
unsigned index_offset,
GraphemeClusterCallback callback,
void* context) const { … }
template <bool is_horizontal_run, bool has_non_zero_glyph_offsets>
void ShapeResultView::ComputePartInkBounds(
const ShapeResultView::RunInfoPart& part,
float run_advance,
gfx::RectF* ink_bounds) const { … }
gfx::RectF ShapeResultView::ComputeInkBounds() const { … }
void ShapeResultView::ExpandRangeToIncludePartialGlyphs(unsigned* from,
unsigned* to) const { … }
}