diff options
Diffstat (limited to 'include/minikin')
-rw-r--r-- | include/minikin/Layout.h | 9 | ||||
-rw-r--r-- | include/minikin/Range.h | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/include/minikin/Layout.h b/include/minikin/Layout.h index 4f22918..b3ce629 100644 --- a/include/minikin/Layout.h +++ b/include/minikin/Layout.h @@ -155,11 +155,10 @@ private: // Lay out a single bidi run // When layout is not null, layout info will be stored in the object. // When advances is not null, measurement results will be stored in the array. - static float doLayoutRunCached(const uint16_t* buf, size_t runStart, size_t runLength, - size_t bufSize, bool isRtl, LayoutContext* ctx, size_t dstStart, - StartHyphenEdit startHyphen, EndHyphenEdit endHyphen, - Layout* layout, float* advances, MinikinExtent* extents, - LayoutPieces* lpOut); + static float doLayoutRunCached(const U16StringPiece& textBuf, const Range& range, bool isRtl, + LayoutContext* ctx, size_t dstStart, StartHyphenEdit startHyphen, + EndHyphenEdit endHyphen, Layout* layout, float* advances, + MinikinExtent* extents, LayoutPieces* lpOut); // Lay out a single word static float doLayoutWord(const uint16_t* buf, size_t start, size_t count, size_t bufSize, diff --git a/include/minikin/Range.h b/include/minikin/Range.h index 2e94237..2efde7e 100644 --- a/include/minikin/Range.h +++ b/include/minikin/Range.h @@ -30,6 +30,7 @@ public: // start must be smaller than or equal to end otherwise the behavior is undefined. Range(uint32_t start, uint32_t end) : mStart(start), mEnd(end) {} + Range() : Range(NOWHERE, NOWHERE) {} Range(const Range&) = default; Range& operator=(const Range&) = default; @@ -79,6 +80,10 @@ public: return Range({std::min(left.mStart, right.mStart), std::max(left.mEnd, right.mEnd)}); } + inline bool operator==(const Range& o) const { return mStart == o.mStart && mEnd == o.mEnd; } + + inline bool operator!=(const Range& o) const { return !(*this == o); } + private: // Helper class for "for (uint32_t i : range)" style for-loop. class RangeIterator { |