Index: tests/TextBlobTest.cpp |
diff --git a/tests/TextBlobTest.cpp b/tests/TextBlobTest.cpp |
index ec748e77441128662c4bab120865766d7204173c..2a74e5a2dbbd8b24076215f367b5df9faef6a98b 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: |