diff options
author | Florin Malita <fmalita@chromium.org> | 2017-03-13 09:03:24 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-13 13:36:54 +0000 |
commit | 3a9a7a310c5cff72bc1c2388a496af1b82326355 (patch) | |
tree | 5d5d4aba58aff7461b4aa5782ecd6e5dc1cdd812 /include/core | |
parent | d69e1827b90e778a2240a469c3873e7f7fb0c768 (diff) |
Remove run count field from SkTextBlob.
We can flag the last run record instead. Run iteration is always
sequential, so no penalty.
As a side effect, we can no longer allow instantiation of zero-run text
blobs - but that seems like a good idea anyway.
Change-Id: I7ca80c4780623d5a188f92dfe6d6fe152f20f666
Reviewed-on: https://skia-review.googlesource.com/9149
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkPicture.h | 3 | ||||
-rw-r--r-- | include/core/SkTextBlob.h | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h index 8047858b16..133d3c92c0 100644 --- a/include/core/SkPicture.h +++ b/include/core/SkPicture.h @@ -199,10 +199,11 @@ private: // V49: Gradients serialized as SkColor4f + SkColorSpace // V50: SkXfermode -> SkBlendMode // V51: more SkXfermode -> SkBlendMode + // V52: Remove SkTextBlob::fRunCount // Only SKPs within the min/current picture version range (inclusive) can be read. static const uint32_t MIN_PICTURE_VERSION = 35; // Produced by Chrome M39. - static const uint32_t CURRENT_PICTURE_VERSION = 51; + static const uint32_t CURRENT_PICTURE_VERSION = 52; static_assert(MIN_PICTURE_VERSION <= 41, "Remove kFontFileName and related code from SkFontDescriptor.cpp."); diff --git a/include/core/SkTextBlob.h b/include/core/SkTextBlob.h index 8198f04a80..1d17f4dafe 100644 --- a/include/core/SkTextBlob.h +++ b/include/core/SkTextBlob.h @@ -60,7 +60,7 @@ private: friend class SkNVRefCnt<SkTextBlob>; class RunRecord; - SkTextBlob(int runCount, const SkRect& bounds); + explicit SkTextBlob(const SkRect& bounds); ~SkTextBlob(); @@ -78,8 +78,7 @@ private: friend class SkTextBlobBuilder; friend class SkTextBlobRunIterator; - const int fRunCount; - const SkRect fBounds; + const SkRect fBounds; const uint32_t fUniqueID; SkDEBUGCODE(size_t fStorageSize;) @@ -101,8 +100,10 @@ public: ~SkTextBlobBuilder(); /** - * Returns an immutable SkTextBlob for the current runs/glyphs. The builder is reset and - * can be reused. + * Returns an immutable SkTextBlob for the current runs/glyphs, + * or nullptr if no runs were allocated. + * + * The builder is reset and can be reused. */ sk_sp<SkTextBlob> make(); |