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

Unified Diff: ui/gfx/render_text.cc

Issue 867003002: Cache gfx::RenderText instances in views::Label. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed 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
Index: ui/gfx/render_text.cc
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index c4f841dfcf7898f4b590f31839f865e8afbdac74..66d3ba781d0f25481e63a873dc2d778722fda680 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -402,6 +402,7 @@ void ApplyRenderParams(const FontRenderParams& params,
RenderText::~RenderText() {
}
+// static
RenderText* RenderText::CreateInstance() {
#if defined(OS_MACOSX)
static const bool use_native =
@@ -413,6 +414,7 @@ RenderText* RenderText::CreateInstance() {
return new RenderTextHarfBuzz;
}
+// static
RenderText* RenderText::CreateInstanceForEditing() {
return new RenderTextHarfBuzz;
}
@@ -717,6 +719,10 @@ VisualCursorDirection RenderText::GetVisualDirectionOfLogicalEnd() {
CURSOR_RIGHT : CURSOR_LEFT;
}
+const base::string16& RenderText::GetAccessibleText() {
+ return layout_text_;
msw 2015/02/25 23:54:26 I think this should work as-is, since |layout_text
Jun Mukai 2015/02/26 01:40:24 This method was removed.
+}
+
SizeF RenderText::GetStringSizeF() {
return GetStringSize();
}
@@ -1093,7 +1099,7 @@ HorizontalAlignment RenderText::GetCurrentHorizontalAlignment() {
Vector2d RenderText::GetAlignmentOffset(size_t line_number) {
// TODO(ckocagil): Enable |lines_| usage on RenderTextMac.
- if (multiline_)
+ if (MultilineSupported() && multiline_)
DCHECK_LT(line_number, lines_.size());
Vector2d offset;
HorizontalAlignment horizontal_alignment = GetCurrentHorizontalAlignment();

Powered by Google App Engine
This is Rietveld 408576698