diff options
author | fmalita <fmalita@chromium.org> | 2015-10-13 08:59:23 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-13 08:59:23 -0700 |
commit | 9ae8fe1c601ecb7fef9962f9eb1adf11032378e4 (patch) | |
tree | 94b30174c895385a93279dee3ee6d66d928ddf55 /tests/TextBlobTest.cpp | |
parent | 598f3ff4b342fe0d57158ccea5059dfc981e8e3b (diff) |
[SkTextBlob] Remove incorrect builder assert
At the end of TightRunBounds, glyphPosX cannot exceed the start of the
next run. But glyphPosY is running ahead of glyphPosX (for
kFull_Positioning) => the glyphPosY assert is incorrect.
Since the two pointers advance in lock-step, there isn't much value in
the glyphPosY assert anyway - we might as well remove it.
BUG=chromium:542643
R=reed@google.com,bungeman@google.com
Review URL: https://codereview.chromium.org/1405463004
Diffstat (limited to 'tests/TextBlobTest.cpp')
-rw-r--r-- | tests/TextBlobTest.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/TextBlobTest.cpp b/tests/TextBlobTest.cpp index ec748e7744..2a74e5a2db 100644 --- a/tests/TextBlobTest.cpp +++ b/tests/TextBlobTest.cpp @@ -149,7 +149,22 @@ public: } // Implicit bounds - // FIXME: not supported yet. + + { + // Exercise the empty bounds path, and ensure that RunRecord-aligned pos buffers + // don't trigger asserts (http://crbug.com/542643). + SkPaint p; + p.setTextSize(0); + p.setTextEncoding(SkPaint::kGlyphID_TextEncoding); + + const char* txt = "BOOO"; + const size_t len = strlen(txt); + const SkTextBlobBuilder::RunBuffer& buffer = builder.allocRunPos(p, (int)len); + p.textToGlyphs(txt, len, buffer.glyphs); + memset(buffer.pos, 0, sizeof(SkScalar) * len * 2); + SkAutoTUnref<const SkTextBlob> blob(builder.build()); + REPORTER_ASSERT(reporter, blob->bounds().isEmpty()); + } } private: |