From d13291a5a3d2a79b5348ecc4a8e38ab1b6da85f0 Mon Sep 17 00:00:00 2001 From: mtklein Date: Thu, 21 Aug 2014 14:46:49 -0700 Subject: [PATCH] Ignore small text sizes in the text bounding assert. Seems we sometimes give back unduely large metrics for 0 text size. BUG=skia:2862 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/498503003 --- src/core/SkRecordDraw.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp index aa3e8de95a..db4e87fbce 100644 --- a/src/core/SkRecordDraw.cpp +++ b/src/core/SkRecordDraw.cpp @@ -326,7 +326,9 @@ private: correct.fTop += metrics.fTop; correct.fRight += metrics.fXMax; correct.fBottom += metrics.fBottom; - SkASSERTF(rect->contains(correct), "%f %f %f %f vs. %f %f %f %f\n", + // See skia:2862 for why we ignore small text sizes. + SkASSERTF(paint.getTextSize() < 0.001f || rect->contains(correct), + "%f %f %f %f vs. %f %f %f %f\n", -xPad, -yPad, +xPad, +yPad, metrics.fXMin, metrics.fTop, metrics.fXMax, metrics.fBottom); #endif