From d48897b576e9ee7df445606243d14bcb1d0b95df Mon Sep 17 00:00:00 2001 From: Herb Derby Date: Mon, 9 Jul 2018 13:24:13 -0400 Subject: Update SkSpan to match the standard more closely Change-Id: Iba5a9c24a34d5a08618b9182b476121bf6ce5ef9 Reviewed-on: https://skia-review.googlesource.com/139863 Reviewed-by: Mike Klein Commit-Queue: Herb Derby --- src/core/SkGlyphRun.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/SkGlyphRun.h b/src/core/SkGlyphRun.h index 739ad0bc38..fe9922b381 100644 --- a/src/core/SkGlyphRun.h +++ b/src/core/SkGlyphRun.h @@ -24,8 +24,9 @@ template class SkSpan { public: SkSpan() : fPtr{nullptr}, fSize{0} {} - SkSpan(T* ptr, size_t size) : fPtr{ptr}, fSize{size} {} - explicit SkSpan(std::vector& v) : fPtr{v.data()}, fSize{v.size()} {} + SkSpan(T* ptr, ptrdiff_t size) : fPtr{ptr}, fSize{size} { SkASSERT(size >= 0); } + explicit SkSpan(std::vector& v) : fPtr{v.data()}, fSize{SkTo(v.size())} {} + SkSpan(const SkSpan& o) = default; SkSpan& operator=( const SkSpan& other ) = default; T& operator [] (ptrdiff_t i) const { return fPtr[i]; } T* begin() const { return fPtr; } @@ -38,7 +39,7 @@ public: private: T* fPtr; - size_t fSize; + ptrdiff_t fSize; }; struct SkIndexedRunInfo { -- cgit v1.2.3