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

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 1543183002: Switch to standard integer types in ui/gfx/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « ui/gfx/render_text_harfbuzz.h ('k') | ui/gfx/render_text_mac.h » ('j') | 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 1cac24fd7665c3065239059e5733dd7ddabad2fc..39fc88cb2c14c6deb78d57a5ffe5e39c2fad7ce4 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -10,10 +10,12 @@
#include "base/i18n/bidi_line_iterator.h"
#include "base/i18n/break_iterator.h"
#include "base/i18n/char_iterator.h"
+#include "base/macros.h"
#include "base/profiler/scoped_tracker.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
+#include "build/build_config.h"
#include "third_party/harfbuzz-ng/src/hb.h"
#include "third_party/icu/source/common/unicode/ubidi.h"
#include "third_party/icu/source/common/unicode/utf16.h"
@@ -132,7 +134,7 @@ bool AsciiBreak(UChar32 first_char, UChar32 current_char) {
size_t FindRunBreakingCharacter(const base::string16& text,
size_t run_start,
size_t run_break) {
- const int32 run_length = static_cast<int32>(run_break - run_start);
+ const int32_t run_length = static_cast<int32_t>(run_break - run_start);
base::i18n::UTF16CharIterator iter(text.c_str() + run_start, run_length);
const UChar32 first_char = iter.get();
// The newline character should form a single run so that the line breaker
@@ -1266,7 +1268,7 @@ void RenderTextHarfBuzz::ItemizeTextToRuns(
run->strike = style.style(STRIKE);
run->diagonal_strike = style.style(DIAGONAL_STRIKE);
run->underline = style.style(UNDERLINE);
- int32 script_item_break = 0;
+ int32_t 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.
@@ -1466,7 +1468,7 @@ bool RenderTextHarfBuzz::ShapeRunWithFont(const base::string16& text,
// buffer holds our text, run information to be used by the shaping engine,
// and the resulting glyph data.
hb_buffer_t* buffer = hb_buffer_create();
- hb_buffer_add_utf16(buffer, reinterpret_cast<const uint16*>(text.c_str()),
+ hb_buffer_add_utf16(buffer, reinterpret_cast<const uint16_t*>(text.c_str()),
text.length(), run->range.start(), run->range.length());
hb_buffer_set_script(buffer, ICUScriptToHBScript(run->script));
hb_buffer_set_direction(buffer,
@@ -1490,14 +1492,14 @@ bool RenderTextHarfBuzz::ShapeRunWithFont(const base::string16& text,
run->glyph_count = glyph_count;
hb_glyph_position_t* hb_positions =
hb_buffer_get_glyph_positions(buffer, NULL);
- run->glyphs.reset(new uint16[run->glyph_count]);
+ run->glyphs.reset(new uint16_t[run->glyph_count]);
run->glyph_to_char.resize(run->glyph_count);
run->positions.reset(new SkPoint[run->glyph_count]);
run->width = 0.0f;
for (size_t i = 0; i < run->glyph_count; ++i) {
- DCHECK_LE(infos[i].codepoint, std::numeric_limits<uint16>::max());
- run->glyphs[i] = static_cast<uint16>(infos[i].codepoint);
+ DCHECK_LE(infos[i].codepoint, std::numeric_limits<uint16_t>::max());
+ run->glyphs[i] = static_cast<uint16_t>(infos[i].codepoint);
run->glyph_to_char[i] = infos[i].cluster;
const SkScalar x_offset = SkFixedToScalar(hb_positions[i].x_offset);
const SkScalar y_offset = SkFixedToScalar(hb_positions[i].y_offset);
« no previous file with comments | « ui/gfx/render_text_harfbuzz.h ('k') | ui/gfx/render_text_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698