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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 937883002: cc: Change CallFunctionForSubtree to use lambdas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index f4780789394c447a1b3a56cfb5925ef325dec6a1..bd79762b43fba932b34fb262b5fa102d5dd8ae77 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -212,10 +212,6 @@ void LayerTreeHost::SetLayerTreeHostClientReady() {
proxy_->SetLayerTreeHostClientReady();
}
-static void LayerTreeHostOnOutputSurfaceCreatedCallback(Layer* layer) {
- layer->OnOutputSurfaceCreated();
-}
-
void LayerTreeHost::DeleteContentsTexturesOnImplThread(
ResourceProvider* resource_provider) {
DCHECK(proxy_->IsImplThread());
@@ -424,7 +420,7 @@ void LayerTreeHost::DidInitializeOutputSurface() {
if (root_layer()) {
LayerTreeHostCommon::CallFunctionForSubtree(
- root_layer(), base::Bind(&LayerTreeHostOnOutputSurfaceCreatedCallback));
+ root_layer(), [](Layer* layer) { layer->OnOutputSurfaceCreated(); });
}
client_->DidInitializeOutputSurface();
@@ -866,8 +862,7 @@ bool LayerTreeHost::UpdateLayers(Layer* root_layer,
kTotalFramesToUseForLCDTextMetrics) {
LayerTreeHostCommon::CallFunctionForSubtree(
root_layer,
- base::Bind(&LayerTreeHost::CalculateLCDTextMetricsCallback,
- base::Unretained(this)));
+ [this](Layer* layer) { CalculateLCDTextMetricsCallback(layer); });
total_frames_used_for_lcd_text_metrics_++;
}
@@ -912,17 +907,12 @@ void LayerTreeHost::TriggerPrepaint() {
SetNeedsCommit();
}
-static void LayerTreeHostReduceMemoryCallback(Layer* layer) {
- layer->ReduceMemoryUsage();
-}
-
void LayerTreeHost::ReduceMemoryUsage() {
if (!root_layer())
return;
LayerTreeHostCommon::CallFunctionForSubtree(
- root_layer(),
- base::Bind(&LayerTreeHostReduceMemoryCallback));
+ root_layer(), [](Layer* layer) { layer->ReduceMemoryUsage(); });
}
void LayerTreeHost::SetPrioritiesForSurfaces(size_t surface_memory_bytes) {

Powered by Google App Engine
This is Rietveld 408576698