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

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 1456183002: Add more assertion to render_text_harfbuzz. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 8078612e36de4891b3a353dc9beeac420ff5a3e6..1e806c6d73093f2c19c5ef9643366c58eb1cabcb 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -1266,6 +1266,7 @@ void RenderTextHarfBuzz::ItemizeTextToRuns(
run->underline = style.style(UNDERLINE);
int32 script_item_break = 0;
bidi_iterator.GetLogicalRun(run_break, &script_item_break, &run->level);
+ CHECK_GT(static_cast<size_t>(script_item_break), run_break);
// Odd BiDi embedding levels correspond to RTL runs.
run->is_rtl = (run->level % 2) == 1;
// Find the length and script of this script run.
@@ -1276,7 +1277,7 @@ void RenderTextHarfBuzz::ItemizeTextToRuns(
const size_t new_run_break = std::min(
static_cast<size_t>(script_item_break),
TextIndexToGivenTextIndex(text, style.GetRange().end()));
- CHECK_NE(new_run_break, run_break)
+ CHECK_GT(new_run_break, run_break)
<< "It must proceed! " << text << " " << run_break;
run_break = new_run_break;
« 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