Index: ui/gfx/render_text_harfbuzz.cc |
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc |
index a9a05ef7d153ca44d72278555677de847ae2d403..590537ebe63c281f96724e670dc537190cdada03 100644 |
--- a/ui/gfx/render_text_harfbuzz.cc |
+++ b/ui/gfx/render_text_harfbuzz.cc |
@@ -28,6 +28,7 @@ |
#include "ui/gfx/geometry/safe_integer_conversions.h" |
#include "ui/gfx/harfbuzz_font_skia.h" |
#include "ui/gfx/range/range_f.h" |
+#include "ui/gfx/skia_util.h" |
#include "ui/gfx/text_utils.h" |
#include "ui/gfx/utf16_indexing.h" |
@@ -1503,12 +1504,14 @@ bool RenderTextHarfBuzz::ShapeRunWithFont(const base::string16& text, |
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); |
+ const SkScalar x_offset = |
+ HarfBuzzUnitsToSkiaScalar(hb_positions[i].x_offset); |
+ const SkScalar y_offset = |
+ HarfBuzzUnitsToSkiaScalar(hb_positions[i].y_offset); |
run->positions[i].set(run->width + x_offset, -y_offset); |
run->width += (glyph_width_for_test_ > 0) |
? glyph_width_for_test_ |
- : SkFixedToFloat(hb_positions[i].x_advance); |
+ : HarfBuzzUnitsToFloat(hb_positions[i].x_advance); |
// Round run widths if subpixel positioning is off to match native behavior. |
if (!run->render_params.subpixel_positioning) |
run->width = std::floor(run->width + 0.5f); |