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

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 876873003: Add float version of gfx::Range (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed 2 Created 5 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/render_text_harfbuzz.h ('k') | ui/gfx/render_text_unittest.cc » ('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 e4469a6fdfa2500f117317a0b22e84bfac6deb4c..1e3f57999b7af9a5c2c2d397649e1b5c49c3deee 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -18,13 +18,13 @@
#include "ui/gfx/font_fallback.h"
#include "ui/gfx/font_render_params.h"
#include "ui/gfx/harfbuzz_font_skia.h"
+#include "ui/gfx/range/range_f.h"
#include "ui/gfx/utf16_indexing.h"
#if defined(OS_WIN)
#include "ui/gfx/font_fallback_win.h"
#endif
-using gfx::internal::RangeF;
using gfx::internal::RoundRangeF;
namespace gfx {
@@ -461,8 +461,8 @@ class HarfBuzzLineBreaker {
namespace internal {
Range RoundRangeF(const RangeF& range_f) {
- return Range(std::floor(range_f.first + 0.5f),
- std::floor(range_f.second + 0.5f));
+ return Range(std::floor(range_f.start() + 0.5f),
+ std::floor(range_f.end() + 0.5f));
}
TextRunHarfBuzz::TextRunHarfBuzz()
@@ -659,9 +659,9 @@ Range RenderTextHarfBuzz::GetGlyphBounds(size_t index) {
// position since clients expect them to be contiguous.
if (cursor_enabled() && run_index == runs_.size() - 1 &&
index == (run->is_rtl ? run->range.start() : run->range.end() - 1))
- bounds.second = std::ceil(bounds.second);
+ bounds.set_end(std::ceil(bounds.end()));
return RoundRangeF(run->is_rtl ?
- RangeF(bounds.second, bounds.first) : bounds);
+ RangeF(bounds.end(), bounds.start()) : bounds);
}
int RenderTextHarfBuzz::GetLayoutTextBaseline() {
« no previous file with comments | « ui/gfx/render_text_harfbuzz.h ('k') | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698