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

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 1752953003: Replace uses of SkFixed for HarfBuzz conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « ui/gfx/harfbuzz_font_skia.cc ('k') | ui/gfx/skia_util.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 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);
« no previous file with comments | « ui/gfx/harfbuzz_font_skia.cc ('k') | ui/gfx/skia_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698