8#ifndef SkGlyphRun_DEFINED
9#define SkGlyphRun_DEFINED
47 size_t runSize()
const {
return fSource.size(); }
88 bool canCache()
const {
return fOriginalTextBlob !=
nullptr; }
91 size_t glyphCount = 0;
93 glyphCount +=
run.runSize();
107 if (!
run.scaledRotations().empty()) {
return true; }
121 auto end() ->
decltype(fGlyphRuns.
end()) {
return fGlyphRuns.
end(); }
122 auto begin() const -> decltype(
std::cbegin(fGlyphRuns)) {
return std::cbegin(fGlyphRuns); }
123 auto end() const -> decltype(
std::cend(fGlyphRuns)) {
return std::cend(fGlyphRuns); }
124 auto size() const -> decltype(fGlyphRuns.
size()) {
return fGlyphRuns.
size(); }
126 auto operator [] (
size_t i)
const ->
decltype(fGlyphRuns[
i]) {
return fGlyphRuns[
i]; }
133 const SkPoint fOrigin = {0, 0};
134 GlyphRunBuilder*
const fBuilder;
150 bool empty()
const {
return fGlyphRunListStorage.empty(); }
154 void prepareBuffers(
int positionCount,
int RSXFormCount);
170 int fMaxTotalRunSize{0};
172 int fMaxScaledRotations{0};
175 std::vector<GlyphRun> fGlyphRunListStorage;
176 std::optional<GlyphRunList> fGlyphRunList;
180 std::vector<SkGlyphID> fScratchGlyphIDs;
@ kUTF8
uses bytes to represent UTF-8 or ASCII
constexpr T * begin() const
constexpr T * end() const
constexpr bool empty() const
constexpr size_t size() const
std::tuple< SkSpan< const SkPoint >, SkSpan< const SkVector > > convertRSXForm(SkSpan< const SkRSXform > xforms)
GlyphRunList makeGlyphRunList(const GlyphRun &run, const SkPaint &paint, SkPoint origin)
const GlyphRunList & blobToGlyphRunList(const SkTextBlob &blob, SkPoint origin)
const GlyphRunList & textToGlyphRunList(const SkFont &font, const SkPaint &paint, const void *bytes, size_t byteLength, SkPoint origin, SkTextEncoding encoding=SkTextEncoding::kUTF8)
auto end() -> decltype(fGlyphRuns.end())
uint64_t uniqueID() const
SkRect sourceBounds() const
const SkTextBlob * blob() const
size_t maxGlyphRunSize() const
auto empty() const -> decltype(fGlyphRuns.empty())
SkRect sourceBoundsWithOrigin() const
auto begin() -> decltype(fGlyphRuns.begin())
auto end() const -> decltype(std::cend(fGlyphRuns))
auto size() const -> decltype(fGlyphRuns.size())
sk_sp< SkTextBlob > makeBlob() const
size_t totalGlyphCount() const
void temporaryShuntBlobNotifyAddedToCache(uint32_t cacheID, SkTextBlob::PurgeDelegate) const
auto operator[](size_t i) const -> decltype(fGlyphRuns[i])
GlyphRunBuilder * builder() const
GlyphRunList(const SkTextBlob *blob, SkRect bounds, SkPoint origin, SkSpan< const GlyphRun > glyphRunList, GlyphRunBuilder *builder)
auto begin() const -> decltype(std::cbegin(fGlyphRuns))
SkSpan< const SkVector > scaledRotations() const
SkSpan< const char > text() const
const SkFont & font() const
SkZip< const SkGlyphID, const SkPoint > source() const
SkSpan< const uint32_t > clusters() const
SkSpan< const SkGlyphID > glyphsIDs() const
SkSpan< const SkPoint > positions() const
GlyphRun(const SkFont &font, SkSpan< const SkPoint > positions, SkSpan< const SkGlyphID > glyphIDs, SkSpan< const char > text, SkSpan< const uint32_t > clusters, SkSpan< const SkVector > scaledRotations)
static float max(float r, float g, float b)
Optional< SkRect > bounds
PODArray< SkRSXform > xforms
font
Font Metadata and Metrics.
static constexpr SkRect MakeEmpty()
constexpr SkRect makeOffset(float dx, float dy) const