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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 60683003: A number of paint optimizations to improve overall paint times. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove SetImageByResourceID and use BackedBySameObjectAs Created 7 years, 1 month 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/views/controls/image_view.cc ('k') | ui/views/widget/desktop_aura/desktop_root_window_host_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index bd0cfe14e9d836faf3a016216dc091d0e734b51e..ab4c01c7be75f1267a998d688b631b4b9e4b742b 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -290,6 +290,10 @@ void Textfield::SetFont(const gfx::Font& font) {
}
void Textfield::SetHorizontalMargins(int left, int right) {
+ if (horizontal_margins_were_set_ &&
+ left == margins_.left() && right == margins_.right()) {
+ return;
+ }
margins_.Set(margins_.top(), left, margins_.bottom(), right);
horizontal_margins_were_set_ = true;
if (native_wrapper_)
@@ -298,6 +302,10 @@ void Textfield::SetHorizontalMargins(int left, int right) {
}
void Textfield::SetVerticalMargins(int top, int bottom) {
+ if (vertical_margins_were_set_ &&
+ top == margins_.top() && bottom == margins_.bottom()) {
+ return;
+ }
margins_.Set(top, margins_.left(), bottom, margins_.right());
vertical_margins_were_set_ = true;
if (native_wrapper_)
« no previous file with comments | « ui/views/controls/image_view.cc ('k') | ui/views/widget/desktop_aura/desktop_root_window_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698