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

Unified Diff: ui/gfx/render_text_mac.cc

Issue 263833010: Revert of Fix Views inline autocomplete with multi-char graphemes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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_mac.h ('k') | ui/gfx/render_text_pango.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_mac.cc
diff --git a/ui/gfx/render_text_mac.cc b/ui/gfx/render_text_mac.cc
index 3ad484bcf4bd5c2c5edc9f22dd84674d46281353..af0be63e130493005f63e21c74a43f1debc31bc0 100644
--- a/ui/gfx/render_text_mac.cc
+++ b/ui/gfx/render_text_mac.cc
@@ -45,7 +45,7 @@
std::vector<RenderText::FontSpan> spans;
for (size_t i = 0; i < runs_.size(); ++i) {
- Font font(runs_[i].font_name, runs_[i].text_size);
+ gfx::Font font(runs_[i].font_name, runs_[i].text_size);
const CFRange cf_range = CTRunGetStringRange(runs_[i].ct_run);
const Range range(cf_range.location, cf_range.location + cf_range.length);
spans.push_back(RenderText::FontSpan(font, range));
@@ -93,9 +93,9 @@
return index;
}
-bool RenderTextMac::IsValidCursorIndex(size_t index) {
- // TODO(asvitkine): Implement this. http://crbug.com/131618
- return IsValidLogicalIndex(index);
+bool RenderTextMac::IsCursorablePosition(size_t position) {
+ // TODO(asvitkine): Implement this. http://crbug.com/131618
+ return true;
}
void RenderTextMac::ResetLayout() {
@@ -211,7 +211,7 @@
end = TextIndexToLayoutIndex(style.GetRange().end());
const CFRange range = CFRangeMake(i, end - i);
base::ScopedCFTypeRef<CGColorRef> foreground(
- CGColorCreateFromSkColor(style.color()));
+ gfx::CGColorCreateFromSkColor(style.color()));
CFAttributedStringSetAttribute(attr_string, range,
kCTForegroundColorAttributeName, foreground);
CFArrayAppendValue(attributes_, foreground);
@@ -254,9 +254,9 @@
// TODO(asvitkine): Don't use GetLineOffset() until draw time, since it may be
// updated based on alignment changes without resetting the layout.
- Vector2d text_offset = GetLineOffset(0);
+ gfx::Vector2d text_offset = GetLineOffset(0);
// Skia will draw glyphs with respect to the baseline.
- text_offset += Vector2d(0, common_baseline_);
+ text_offset += gfx::Vector2d(0, common_baseline_);
const SkScalar x = SkIntToScalar(text_offset.x());
const SkScalar y = SkIntToScalar(text_offset.y());
@@ -325,7 +325,7 @@
base::mac::GetValueFromDictionary<CGColorRef>(
attributes, kCTForegroundColorAttributeName);
if (foreground)
- run->foreground = CGColorRefToSkColor(foreground);
+ run->foreground = gfx::CGColorRefToSkColor(foreground);
const CFNumberRef underline =
base::mac::GetValueFromDictionary<CFNumberRef>(
« no previous file with comments | « ui/gfx/render_text_mac.h ('k') | ui/gfx/render_text_pango.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698