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

Unified Diff: ui/gfx/render_text.cc

Issue 177683005: Clip Views textfield drag images to selected text. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clamp canvas size; remove static keyword. Created 6 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.cc » ('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 0e5bfd2c5b015a76fe40519dd49b19d9d996db91..ca87aa4938682651885422d42fe8a4e9b99ab94c 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -718,29 +718,6 @@ void RenderText::DrawCursor(Canvas* canvas, const SelectionModel& position) {
canvas->FillRect(GetCursorBounds(position, true), cursor_color_);
}
-void RenderText::DrawSelectedTextForDrag(Canvas* canvas) {
- EnsureLayout();
- const std::vector<Rect> sel = GetSubstringBounds(selection());
-
- // Override the selection color with black, and force the background to be
- // transparent so that it's rendered without subpixel antialiasing.
- const bool saved_background_is_transparent = background_is_transparent();
- const SkColor saved_selection_color = selection_color();
- set_background_is_transparent(true);
- set_selection_color(SK_ColorBLACK);
-
- for (size_t i = 0; i < sel.size(); ++i) {
- canvas->Save();
- canvas->ClipRect(sel[i]);
- DrawVisualText(canvas);
- canvas->Restore();
- }
-
- // Restore saved transparency and selection color.
- set_selection_color(saved_selection_color);
- set_background_is_transparent(saved_background_is_transparent);
-}
-
Rect RenderText::GetCursorBounds(const SelectionModel& caret,
bool insert_mode) {
// TODO(ckocagil): Support multiline. This function should return the height
« no previous file with comments | « ui/gfx/render_text.h ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698