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

Unified Diff: ui/gfx/render_text.cc

Issue 2660593002: Paint text cursor in LAYER_SOLID_COLOR (Closed)
Patch Set: comments Created 3 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.h ('k') | ui/views/controls/textfield/textfield.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.cc
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 41e7cf44cb6d6fc293974d3370eddee68110ac01..68aac576ad1cb6f392cfac6c36456a2266884809 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -864,9 +864,6 @@ void RenderText::Draw(Canvas* canvas) {
if (!text().empty() && focused())
DrawSelection(canvas);
- if (cursor_enabled() && cursor_visible() && focused())
- DrawCursor(canvas, selection_model_);
-
if (!text().empty()) {
internal::SkiaTextRenderer renderer(canvas);
if (halo_effect())
@@ -878,12 +875,6 @@ void RenderText::Draw(Canvas* canvas) {
canvas->Restore();
}
-void RenderText::DrawCursor(Canvas* canvas, const SelectionModel& position) {
- // Paint cursor. Replace cursor is drawn as rectangle for now.
- // TODO(msw): Draw a better cursor with a better indication of association.
- canvas->FillRect(GetCursorBounds(position, true), cursor_color_);
-}
-
bool RenderText::IsValidLogicalIndex(size_t index) const {
// Check that the index is at a valid code point (not mid-surrgate-pair) and
// that it's not truncated from the display text (its glyph may be shown).
@@ -1079,8 +1070,6 @@ RenderText::RenderText()
directionality_mode_(DIRECTIONALITY_FROM_TEXT),
text_direction_(base::i18n::UNKNOWN_DIRECTION),
cursor_enabled_(true),
- cursor_visible_(false),
- cursor_color_(kDefaultColor),
selection_color_(kDefaultColor),
selection_background_focused_color_(kDefaultSelectionBackgroundColor),
focused_(false),
« no previous file with comments | « ui/gfx/render_text.h ('k') | ui/views/controls/textfield/textfield.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698