From 3a9a7a310c5cff72bc1c2388a496af1b82326355 Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Mon, 13 Mar 2017 09:03:24 -0400 Subject: 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 Reviewed-by: Mike Reed --- tests/TextBlobTest.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/TextBlobTest.cpp') 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 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 blob(builder.make()); - REPORTER_ASSERT(reporter, blob->bounds().isEmpty()); + REPORTER_ASSERT(reporter, !blob); } // Implicit bounds @@ -273,6 +272,10 @@ private: } sk_sp blob(builder.make()); + REPORTER_ASSERT(reporter, (inCount > 0) == SkToBool(blob)); + if (!blob) { + return; + } SkTextBlobRunIterator it(blob.get()); for (unsigned i = 0; i < outCount; ++i) { -- cgit v1.2.3