#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/layout/inline/inline_item_segment.h"
#include "third_party/blink/renderer/core/layout/inline/inline_item.h"
#include "third_party/blink/renderer/core/layout/layout_inline.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.h"
#include "third_party/blink/renderer/platform/fonts/shaping/run_segmenter.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h"
namespace blink {
namespace {
static constexpr unsigned kScriptBits = …;
static constexpr unsigned kFontFallbackPriorityBits = …;
static constexpr unsigned kRenderOrientationBits = …;
static constexpr unsigned kScriptMask = …;
static constexpr unsigned kFontFallbackPriorityMask = …;
static constexpr unsigned kRenderOrientationMask = …;
static_assert …;
unsigned SetRenderOrientation(
unsigned value,
OrientationIterator::RenderOrientation render_orientation) { … }
}
InlineItemSegment::InlineItemSegment(
const RunSegmenter::RunSegmenterRange& range)
: … { … }
InlineItemSegment::InlineItemSegment(unsigned end_offset,
const InlineItem& item)
: … { … }
unsigned InlineItemSegment::PackSegmentData(
const RunSegmenter::RunSegmenterRange& range) { … }
RunSegmenter::RunSegmenterRange InlineItemSegment::UnpackSegmentData(
unsigned start_offset,
unsigned end_offset,
unsigned value) { … }
RunSegmenter::RunSegmenterRange InlineItemSegment::ToRunSegmenterRange(
unsigned start_offset,
unsigned end_offset) const { … }
std::unique_ptr<InlineItemSegments> InlineItemSegments::Clone() const { … }
unsigned InlineItemSegments::OffsetForSegment(
const InlineItemSegment& segment) const { … }
#if DCHECK_IS_ON()
void InlineItemSegments::CheckOffset(unsigned offset,
const InlineItemSegment* segment) const { … }
#endif
void InlineItemSegments::ToRanges(RunSegmenterRanges& ranges) const { … }
InlineItemSegments::Iterator InlineItemSegments::Ranges(
unsigned start_offset,
unsigned end_offset,
unsigned item_index) const { … }
void InlineItemSegments::ComputeSegments(
RunSegmenter* segmenter,
RunSegmenter::RunSegmenterRange* range) { … }
unsigned InlineItemSegments::AppendMixedFontOrientation(
const String& text_content,
unsigned start_offset,
unsigned end_offset,
unsigned segment_index) { … }
unsigned InlineItemSegments::PopulateItemsFromFontOrientation(
unsigned start_offset,
unsigned end_offset,
OrientationIterator::RenderOrientation render_orientation,
unsigned segment_index) { … }
void InlineItemSegments::Split(unsigned index, unsigned offset) { … }
void InlineItemSegments::ComputeItemIndex(const HeapVector<InlineItem>& items) { … }
ShapeResult* InlineItemSegments::ShapeText(const HarfBuzzShaper* shaper,
const Font* font,
TextDirection direction,
unsigned start_offset,
unsigned end_offset,
unsigned item_index,
ShapeOptions options) const { … }
}