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

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: fix cc_unittests after rebase Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 bool* content_is_suitable_for_gpu) { 1088 bool* content_is_suitable_for_gpu) {
1089 base::AutoReset<bool> painting(&in_paint_layer_contents_, true); 1089 base::AutoReset<bool> painting(&in_paint_layer_contents_, true);
1090 bool did_paint_content = false; 1090 bool did_paint_content = false;
1091 for (const auto& layer : update_layer_list) { 1091 for (const auto& layer : update_layer_list) {
1092 did_paint_content |= layer->Update(); 1092 did_paint_content |= layer->Update();
1093 *content_is_suitable_for_gpu &= layer->IsSuitableForGpuRasterization(); 1093 *content_is_suitable_for_gpu &= layer->IsSuitableForGpuRasterization();
1094 } 1094 }
1095 return did_paint_content; 1095 return did_paint_content;
1096 } 1096 }
1097 1097
1098 void LayerTreeHost::AddHiddenSurfaceLayerId(Layer* layer) {
1099 DCHECK(layer->is_hidden());
1100 const SurfaceId* surface_id = layer->GetSurfaceId();
1101 if (surface_id)
1102 hidden_surface_layer_ids_.push_back(surface_id);
1103 }
1104
1105 using SurfaceIdsList = std::vector<const SurfaceId*>;
1106 const SurfaceIdsList* LayerTreeHost::HiddenSurfaceLayerIds() const {
1107 return &hidden_surface_layer_ids_;
1108 }
1109
1110 void LayerTreeHost::ClearHiddenSurfaceLayerIds() {
1111 hidden_surface_layer_ids_.clear();
1112 }
1113
1098 void LayerTreeHost::AddLayerShouldPushProperties(Layer* layer) { 1114 void LayerTreeHost::AddLayerShouldPushProperties(Layer* layer) {
1099 layers_that_should_push_properties_.insert(layer); 1115 layers_that_should_push_properties_.insert(layer);
1100 } 1116 }
1101 1117
1102 void LayerTreeHost::RemoveLayerShouldPushProperties(Layer* layer) { 1118 void LayerTreeHost::RemoveLayerShouldPushProperties(Layer* layer) {
1103 layers_that_should_push_properties_.erase(layer); 1119 layers_that_should_push_properties_.erase(layer);
1104 } 1120 }
1105 1121
1106 std::unordered_set<Layer*>& LayerTreeHost::LayersThatShouldPushProperties() { 1122 std::unordered_set<Layer*>& LayerTreeHost::LayersThatShouldPushProperties() {
1107 return layers_that_should_push_properties_; 1123 return layers_that_should_push_properties_;
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 void LayerTreeHost::SetNeedsDisplayOnAllLayers() { 1500 void LayerTreeHost::SetNeedsDisplayOnAllLayers() {
1485 for (auto* layer : *this) 1501 for (auto* layer : *this)
1486 layer->SetNeedsDisplay(); 1502 layer->SetNeedsDisplay();
1487 } 1503 }
1488 1504
1489 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) { 1505 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) {
1490 has_copy_request_ = has_copy_request; 1506 has_copy_request_ = has_copy_request;
1491 } 1507 }
1492 1508
1493 } // namespace cc 1509 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698