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

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 1945283003: Fix the DCHECK failure in render_text_harfbuzz.cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address msw@'s comment. Created 4 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_harfbuzz.cc
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index 39f00409700ab1cabd97b6a76e9bbd569bc78e9a..75feff99c9c84ba2b500c91b9b26edb3d762a493 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -404,9 +404,10 @@ class HarfBuzzLineBreaker {
// Merge segments that belong to the same run.
if (last_segment.run == segment.run) {
DCHECK_EQ(last_segment.char_range.end(), segment.char_range.start());
+ // Check there is less than a pixel between one run and the next.
DCHECK_LE(
std::abs(last_segment.x_range.end() - segment.x_range.start()),
- std::numeric_limits<float>::epsilon());
+ 1.0f);
last_segment.char_range.set_end(segment.char_range.end());
last_segment.x_range.set_end(SkScalarToFloat(text_x_) +
segment.width());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698