aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkTextBlob.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-03-13 09:03:24 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-13 13:36:54 +0000
commit3a9a7a310c5cff72bc1c2388a496af1b82326355 (patch)
tree5d5d4aba58aff7461b4aa5782ecd6e5dc1cdd812 /include/core/SkTextBlob.h
parentd69e1827b90e778a2240a469c3873e7f7fb0c768 (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/SkTextBlob.h')
-rw-r--r--include/core/SkTextBlob.h11
1 files changed, 6 insertions, 5 deletions
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();