diff options
author | Herb Derby <herb@google.com> | 2018-07-11 16:07:01 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-12 20:59:19 +0000 |
commit | c434ade20eba4a62c450b7ce33a89966fac9df62 (patch) | |
tree | 99430be42012ee0c664974bb9f4ba564392e80fc /src/core/SkGlyphRun.h | |
parent | 04aa393045c6172f78d96f9f5a02c6f1cc0da445 (diff) |
Move to using pointers in simplifyDraw*
Move to using pointers into buffers. This will allow
multiple runs from blobs to share buffers.
Change-Id: I6ebed2e490c5fe71077ddc921ead145ce17c5ebd
Reviewed-on: https://skia-review.googlesource.com/141049
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/core/SkGlyphRun.h')
-rw-r--r-- | src/core/SkGlyphRun.h | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/src/core/SkGlyphRun.h b/src/core/SkGlyphRun.h index affc044f76..a1124fd58e 100644 --- a/src/core/SkGlyphRun.h +++ b/src/core/SkGlyphRun.h @@ -95,14 +95,15 @@ private: class SkGlyphRunBuilder { public: - SkGlyphRunBuilder() = default; - void prepareDrawText( - const SkPaint& paint, const void* bytes, size_t byteLength, SkPoint origin); - void prepareDrawPosTextH( + void drawText( + const SkPaint& paint, const void* bytes, size_t byteLength, + SkPoint origin); + void drawPosTextH( + const SkPaint& paint, const void* bytes, size_t byteLength, + const SkScalar* xpos, SkScalar constY); + void drawPosText( const SkPaint& paint, const void* bytes, size_t byteLength, - const SkScalar xpos[], SkScalar constY); - void prepareDrawPosText( - const SkPaint& paint, const void* bytes, size_t byteLength, const SkPoint pos[]); + const SkPoint* pos); SkGlyphRun* useGlyphRun(); @@ -114,7 +115,9 @@ private: // Returns the span of unique glyph IDs. SkSpan<const SkGlyphID> addDenseAndUnique( const SkPaint& paint, - SkSpan<const SkGlyphID> glyphIDs); + SkSpan<const SkGlyphID> glyphIDs, + uint16_t* uniqueGlyphIDIndices, + SkGlyphID* uniqueGlyphIDs); void makeGlyphRun( const SkPaint& runPaint, @@ -125,16 +128,22 @@ private: SkSpan<const char> text, SkSpan<const uint32_t> clusters); - void drawText( + void simplifyDrawText( const SkPaint& paint, SkSpan<const SkGlyphID> glyphIDs, SkPoint origin, - SkSpan<const char> text, SkSpan<const uint32_t> clusters); - void drawPosTextH( + uint16_t* uniqueGlyphIDIndices, SkGlyphID* uniqueGlyphIDs, SkPoint* positions, + SkSpan<const char> text = SkSpan<const char>{}, + SkSpan<const uint32_t> clusters = SkSpan<const uint32_t>{}); + void simplifyDrawPosTextH( const SkPaint& paint, SkSpan<const SkGlyphID> glyphIDs, const SkScalar* xpos, SkScalar constY, - SkSpan<const char> text, SkSpan<const uint32_t> clusters); - void drawPosText( + uint16_t* uniqueGlyphIDIndices, SkGlyphID* uniqueGlyphIDs, SkPoint* positions, + SkSpan<const char> text = SkSpan<const char>{}, + SkSpan<const uint32_t> clusters = SkSpan<const uint32_t>{}); + void simplifyDrawPosText( const SkPaint& paint, SkSpan<const SkGlyphID> glyphIDs, const SkPoint* pos, - SkSpan<const char> text, SkSpan<const uint32_t> clusters); + uint16_t* uniqueGlyphIDIndices, SkGlyphID* uniqueGlyphIDs, + SkSpan<const char> text = SkSpan<const char>{}, + SkSpan<const uint32_t> clusters = SkSpan<const uint32_t>{}); uint64_t fUniqueID{0}; |