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

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

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: hide mask layer also 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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 bool* content_is_suitable_for_gpu) { 1087 bool* content_is_suitable_for_gpu) {
1088 base::AutoReset<bool> painting(&in_paint_layer_contents_, true); 1088 base::AutoReset<bool> painting(&in_paint_layer_contents_, true);
1089 bool did_paint_content = false; 1089 bool did_paint_content = false;
1090 for (const auto& layer : update_layer_list) { 1090 for (const auto& layer : update_layer_list) {
1091 did_paint_content |= layer->Update(); 1091 did_paint_content |= layer->Update();
1092 *content_is_suitable_for_gpu &= layer->IsSuitableForGpuRasterization(); 1092 *content_is_suitable_for_gpu &= layer->IsSuitableForGpuRasterization();
1093 } 1093 }
1094 return did_paint_content; 1094 return did_paint_content;
1095 } 1095 }
1096 1096
1097 void LayerTreeHost::AddHiddenSurfaceLayerId(Layer* layer) {
1098 DCHECK(layer->is_hidden());
1099 const SurfaceId* surface_id = layer->GetSurfaceId();
1100 if (surface_id)
1101 hidden_surface_layer_ids_.push_back(surface_id);
1102 }
1103
1104 using SurfaceIdsList = std::vector<const SurfaceId*>;
1105 const SurfaceIdsList* LayerTreeHost::HiddenSurfaceLayerIds() const {
1106 return &hidden_surface_layer_ids_;
1107 }
1108
1109 void LayerTreeHost::ClearHiddenSurfaceLayerIds() {
1110 hidden_surface_layer_ids_.clear();
1111 }
1112
1097 void LayerTreeHost::AddLayerShouldPushProperties(Layer* layer) { 1113 void LayerTreeHost::AddLayerShouldPushProperties(Layer* layer) {
1098 layers_that_should_push_properties_.insert(layer); 1114 layers_that_should_push_properties_.insert(layer);
1099 } 1115 }
1100 1116
1101 void LayerTreeHost::RemoveLayerShouldPushProperties(Layer* layer) { 1117 void LayerTreeHost::RemoveLayerShouldPushProperties(Layer* layer) {
1102 layers_that_should_push_properties_.erase(layer); 1118 layers_that_should_push_properties_.erase(layer);
1103 } 1119 }
1104 1120
1105 std::unordered_set<Layer*>& LayerTreeHost::LayersThatShouldPushProperties() { 1121 std::unordered_set<Layer*>& LayerTreeHost::LayersThatShouldPushProperties() {
1106 return layers_that_should_push_properties_; 1122 return layers_that_should_push_properties_;
(...skipping 377 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