diff options
Diffstat (limited to 'tests/PaintTest.cpp')
-rw-r--r-- | tests/PaintTest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp index ed790764ab..b08f22c082 100644 --- a/tests/PaintTest.cpp +++ b/tests/PaintTest.cpp @@ -97,12 +97,27 @@ static void regression_cubic(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, maxR.contains(strokeR)); } +// found and fixed for android: not initializing rect for string's of length 0 +static void regression_measureText(skiatest::Reporter* reporter) { + + SkPaint paint; + paint.setTextSize(SkFloatToScalar(12.0f)); + + SkRect r; + r.setLTRB(SK_ScalarNaN, SK_ScalarNaN, SK_ScalarNaN, SK_ScalarNaN); + + // test that the rect was reset + paint.measureText("", 0, &r, SkFloatToScalar(1.0f)); + REPORTER_ASSERT(reporter, r.isEmpty()); +} + static void TestPaint(skiatest::Reporter* reporter) { // TODO add general paint tests test_copy(reporter); // regression tests regression_cubic(reporter); + regression_measureText(reporter); } #include "TestClassDef.h" |