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

Unified Diff: chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc

Issue 2293573002: Add tinted static UI resource cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use custom caching mechanism Created 4 years, 3 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: chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc
diff --git a/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc b/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc
index 913bd3142133268f799c7a968ed64f5722301c44..32c59fbda380eb2ffd8d8824807393652d659dd0 100644
--- a/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc
+++ b/chrome/browser/android/compositor/scene_layer/tab_list_scene_layer.cc
@@ -40,6 +40,8 @@ void TabListSceneLayer::BeginBuildingFrame(JNIEnv* env,
// matches PutTabLayer call order.
for (auto tab : tab_map_)
tab.second->layer()->RemoveFromParent();
+
+ used_tints_.clear();
}
void TabListSceneLayer::FinishBuildingFrame(JNIEnv* env,
@@ -53,6 +55,7 @@ void TabListSceneLayer::FinishBuildingFrame(JNIEnv* env,
++it;
}
visible_tabs_this_frame_.clear();
+ if (resource_manager_) resource_manager_->RemoveUnusedTints(used_tints_);
aelias_OOO_until_Jul13 2016/09/07 19:34:44 Is there a scenario where "if (resource_manager_)"
mdjones 2016/09/08 16:34:44 Done.
}
void TabListSceneLayer::UpdateLayer(
@@ -150,6 +153,11 @@ void TabListSceneLayer::PutTabLayer(
own_tree_->AddChild(layer->layer());
visible_tabs_this_frame_.insert(id);
+ // Add the tints for the border asset and close icon to the list that was
+ // used for this frame.
+ used_tints_.insert(toolbar_background_color);
+ used_tints_.insert(close_button_color);
+
DCHECK(layer);
if (layer) {
layer->SetProperties(
@@ -162,8 +170,8 @@ void TabListSceneLayer::PutTabLayer(
contour_alpha, shadow_alpha, close_alpha, border_scale, saturation,
brightness, close_btn_width, static_to_view_blend, content_width,
content_height, content_width, visible_content_height, show_toolbar,
- default_theme_color, toolbar_background_color, close_button_color,
- anonymize_toolbar, toolbar_textbox_resource_id,
+ default_theme_color, toolbar_background_color,
+ close_button_color, anonymize_toolbar, toolbar_textbox_resource_id,
toolbar_textbox_background_color, toolbar_textbox_alpha, toolbar_alpha,
toolbar_y_offset, side_border_scale, attach_content, inset_border);
}

Powered by Google App Engine
This is Rietveld 408576698