aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/TextBlobTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TextBlobTest.cpp')
-rw-r--r--tests/TextBlobTest.cpp17
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: