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

Unified Diff: src/core/SkPaint.cpp

Issue 12387092: Initialize bounds even if the text length is zero. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix test Created 7 years, 10 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 | « no previous file | tests/PaintTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 9510e75c75a88ad425bb8cbdd4aa017d2edb1f61..07d1c33bd47b747f3711be4fe75a988b0f98a08b 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1071,6 +1071,9 @@ SkScalar SkPaint::measureText(const void* textData, size_t length,
bounds->fBottom = SkScalarMul(bounds->fBottom, scale);
}
}
+ } else if (bounds) {
+ // ensure that even if we don't measure_text we still update the bounds
+ bounds->setEmpty();
}
return width;
}
« no previous file with comments | « no previous file | tests/PaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698