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 /tests/TextBlobTest.cpp | |
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 'tests/TextBlobTest.cpp')
-rw-r--r-- | tests/TextBlobTest.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/TextBlobTest.cpp b/tests/TextBlobTest.cpp index 09389a4b52..38341163ac 100644 --- a/tests/TextBlobTest.cpp +++ b/tests/TextBlobTest.cpp @@ -105,7 +105,7 @@ public: // Explicit bounds. { sk_sp<SkTextBlob> blob(builder.make()); - REPORTER_ASSERT(reporter, blob->bounds().isEmpty()); + REPORTER_ASSERT(reporter, !blob); } { @@ -143,9 +143,8 @@ public: } { - // Verify empty blob bounds after building some non-empty blobs. sk_sp<SkTextBlob> blob(builder.make()); - REPORTER_ASSERT(reporter, blob->bounds().isEmpty()); + REPORTER_ASSERT(reporter, !blob); } // Implicit bounds @@ -273,6 +272,10 @@ private: } sk_sp<SkTextBlob> blob(builder.make()); + REPORTER_ASSERT(reporter, (inCount > 0) == SkToBool(blob)); + if (!blob) { + return; + } SkTextBlobRunIterator it(blob.get()); for (unsigned i = 0; i < outCount; ++i) { |