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

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

Issue 2905533002: cc : Store surface layer ids on LayerTreeHost and push them at commit (Closed)
Patch Set: 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 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 bool* content_is_suitable_for_gpu) { 1085 bool* content_is_suitable_for_gpu) {
1086 base::AutoReset<bool> painting(&in_paint_layer_contents_, true); 1086 base::AutoReset<bool> painting(&in_paint_layer_contents_, true);
1087 bool did_paint_content = false; 1087 bool did_paint_content = false;
1088 for (const auto& layer : update_layer_list) { 1088 for (const auto& layer : update_layer_list) {
1089 did_paint_content |= layer->Update(); 1089 did_paint_content |= layer->Update();
1090 *content_is_suitable_for_gpu &= layer->IsSuitableForGpuRasterization(); 1090 *content_is_suitable_for_gpu &= layer->IsSuitableForGpuRasterization();
1091 } 1091 }
1092 return did_paint_content; 1092 return did_paint_content;
1093 } 1093 }
1094 1094
1095 void LayerTreeHost::AddSurfaceLayerId(const SurfaceId& surface_id) {
1096 DCHECK(std::find(surface_layer_ids_.begin(), surface_layer_ids_.end(),
1097 surface_id) == surface_layer_ids_.end());
1098 surface_layer_ids_.push_back(surface_id);
1099 needs_surface_ids_sync_ = true;
1100 }
1101
1102 void LayerTreeHost::RemoveSurfaceLayerId(const SurfaceId& surface_id) {
1103 auto pos = std::find(surface_layer_ids_.begin(), surface_layer_ids_.end(),
1104 surface_id);
1105 if (pos != surface_layer_ids_.end()) {
1106 surface_layer_ids_.erase(pos);
1107 needs_surface_ids_sync_ = true;
1108 }
1109 }
1110
1111 const std::vector<SurfaceId>& LayerTreeHost::SurfaceLayerIds() const {
1112 return surface_layer_ids_;
1113 }
1114
1095 void LayerTreeHost::AddLayerShouldPushProperties(Layer* layer) { 1115 void LayerTreeHost::AddLayerShouldPushProperties(Layer* layer) {
1096 layers_that_should_push_properties_.insert(layer); 1116 layers_that_should_push_properties_.insert(layer);
1097 } 1117 }
1098 1118
1099 void LayerTreeHost::RemoveLayerShouldPushProperties(Layer* layer) { 1119 void LayerTreeHost::RemoveLayerShouldPushProperties(Layer* layer) {
1100 layers_that_should_push_properties_.erase(layer); 1120 layers_that_should_push_properties_.erase(layer);
1101 } 1121 }
1102 1122
1103 std::unordered_set<Layer*>& LayerTreeHost::LayersThatShouldPushProperties() { 1123 std::unordered_set<Layer*>& LayerTreeHost::LayersThatShouldPushProperties() {
1104 return layers_that_should_push_properties_; 1124 return layers_that_should_push_properties_;
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 void LayerTreeHost::SetNeedsDisplayOnAllLayers() { 1505 void LayerTreeHost::SetNeedsDisplayOnAllLayers() {
1486 for (auto* layer : *this) 1506 for (auto* layer : *this)
1487 layer->SetNeedsDisplay(); 1507 layer->SetNeedsDisplay();
1488 } 1508 }
1489 1509
1490 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) { 1510 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) {
1491 has_copy_request_ = has_copy_request; 1511 has_copy_request_ = has_copy_request;
1492 } 1512 }
1493 1513
1494 } // namespace cc 1514 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698