OLD | NEW |
---|---|
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 Loading... | |
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 surface_layer_ids_.push_back(surface_id); | |
jaydasika
2017/05/23 00:25:14
Will add a DCHECK for checking surface id is not a
| |
1097 } | |
1098 | |
1099 void LayerTreeHost::RemoveSurfaceLayerId(const SurfaceId& surface_id) { | |
1100 auto pos = std::find(surface_layer_ids_.begin(), surface_layer_ids_.end(), | |
1101 surface_id); | |
1102 if (pos != surface_layer_ids_.end()) | |
1103 surface_layer_ids_.erase(pos); | |
1104 } | |
1105 | |
1106 const std::vector<SurfaceId>& LayerTreeHost::SurfaceLayerIds() const { | |
1107 return surface_layer_ids_; | |
1108 } | |
1109 | |
1110 void LayerTreeHost::ClearSurfaceLayerIds() { | |
1111 surface_layer_ids_.clear(); | |
1112 } | |
1113 | |
1095 void LayerTreeHost::AddLayerShouldPushProperties(Layer* layer) { | 1114 void LayerTreeHost::AddLayerShouldPushProperties(Layer* layer) { |
1096 layers_that_should_push_properties_.insert(layer); | 1115 layers_that_should_push_properties_.insert(layer); |
1097 } | 1116 } |
1098 | 1117 |
1099 void LayerTreeHost::RemoveLayerShouldPushProperties(Layer* layer) { | 1118 void LayerTreeHost::RemoveLayerShouldPushProperties(Layer* layer) { |
1100 layers_that_should_push_properties_.erase(layer); | 1119 layers_that_should_push_properties_.erase(layer); |
1101 } | 1120 } |
1102 | 1121 |
1103 std::unordered_set<Layer*>& LayerTreeHost::LayersThatShouldPushProperties() { | 1122 std::unordered_set<Layer*>& LayerTreeHost::LayersThatShouldPushProperties() { |
1104 return layers_that_should_push_properties_; | 1123 return layers_that_should_push_properties_; |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1485 void LayerTreeHost::SetNeedsDisplayOnAllLayers() { | 1504 void LayerTreeHost::SetNeedsDisplayOnAllLayers() { |
1486 for (auto* layer : *this) | 1505 for (auto* layer : *this) |
1487 layer->SetNeedsDisplay(); | 1506 layer->SetNeedsDisplay(); |
1488 } | 1507 } |
1489 | 1508 |
1490 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) { | 1509 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) { |
1491 has_copy_request_ = has_copy_request; | 1510 has_copy_request_ = has_copy_request; |
1492 } | 1511 } |
1493 | 1512 |
1494 } // namespace cc | 1513 } // namespace cc |
OLD | NEW |