Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: tests/TextBlobTest.cpp

Issue 1405463004: [SkTextBlob] Remove incorrect builder assert (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: win fix reloaded Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkTextBlob.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « src/core/SkTextBlob.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698