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

Unified Diff: ui/app_list/views/app_list_item_view.cc

Issue 413823002: Cache gfx::RenderText instances in views::Label. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/app_list/views/app_list_item_view.h ('k') | ui/views/controls/button/label_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_item_view.cc
diff --git a/ui/app_list/views/app_list_item_view.cc b/ui/app_list/views/app_list_item_view.cc
index 671d299ba55656ae88d0dc09fbf389b72ec07d0c..da1be50390fa0474f3a47c0b581ad58bded634c8 100644
--- a/ui/app_list/views/app_list_item_view.cc
+++ b/ui/app_list/views/app_list_item_view.cc
@@ -187,6 +187,7 @@ void AppListItemView::SetUIState(UIState state) {
}
#endif // !OS_WIN
+ SetTitleSubpixelAA();
SchedulePaint();
}
@@ -211,10 +212,7 @@ void AppListItemView::SetTitleSubpixelAA() {
!apps_grid_view_->IsSelectedView(this) &&
!apps_grid_view_->IsAnimatingView(this);
- bool currently_enabled = title_->background() != NULL;
- if (currently_enabled == enable_aa)
- return;
-
+ title_->SetSubpixelRenderingEnabled(enable_aa);
if (enable_aa) {
title_->SetBackgroundColor(app_list::kContentsBackgroundColor);
title_->set_background(views::Background::CreateSolidBackground(
@@ -278,6 +276,7 @@ void AppListItemView::ItemNameChanged() {
void AppListItemView::ItemHighlightedChanged() {
apps_grid_view_->EnsureViewVisible(this);
+ SetTitleSubpixelAA();
SchedulePaint();
}
@@ -286,6 +285,7 @@ void AppListItemView::ItemIsInstallingChanged() {
apps_grid_view_->EnsureViewVisible(this);
title_->SetVisible(!item_->is_installing());
progress_bar_->SetVisible(item_->is_installing());
+ SetTitleSubpixelAA();
SchedulePaint();
}
@@ -318,6 +318,7 @@ void AppListItemView::Layout() {
title_size.height());
title_bounds.Intersect(rect);
title_->SetBoundsRect(title_bounds);
+ SetTitleSubpixelAA();
gfx::Rect progress_bar_bounds(progress_bar_->GetPreferredSize());
progress_bar_bounds.set_x(GetContentsBounds().x() +
@@ -326,11 +327,6 @@ void AppListItemView::Layout() {
progress_bar_->SetBoundsRect(progress_bar_bounds);
}
-void AppListItemView::SchedulePaintInRect(const gfx::Rect& r) {
- SetTitleSubpixelAA();
- views::CustomButton::SchedulePaintInRect(r);
-}
-
void AppListItemView::OnPaint(gfx::Canvas* canvas) {
if (apps_grid_view_->IsDraggedView(this))
return;
@@ -391,7 +387,7 @@ void AppListItemView::StateChanged() {
item_->SetHighlighted(false);
title_->SetEnabledColor(kGridTitleColor);
}
- title_->Invalidate();
+ SetTitleSubpixelAA();
}
bool AppListItemView::ShouldEnterPushedState(const ui::Event& event) {
« no previous file with comments | « ui/app_list/views/app_list_item_view.h ('k') | ui/views/controls/button/label_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698