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

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

Issue 1587283002: Switch cc to std::unordered_*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unordered-map
Patch Set: Fix MSVC build issue Created 4 years, 11 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
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
11 #include <stack> 11 #include <stack>
12 #include <string> 12 #include <string>
13 #include <unordered_map>
13 14
14 #include "base/atomic_sequence_num.h" 15 #include "base/atomic_sequence_num.h"
15 #include "base/auto_reset.h" 16 #include "base/auto_reset.h"
16 #include "base/bind.h" 17 #include "base/bind.h"
17 #include "base/command_line.h" 18 #include "base/command_line.h"
18 #include "base/location.h" 19 #include "base/location.h"
19 #include "base/metrics/histogram.h" 20 #include "base/metrics/histogram.h"
20 #include "base/single_thread_task_runner.h" 21 #include "base/single_thread_task_runner.h"
21 #include "base/stl_util.h" 22 #include "base/stl_util.h"
22 #include "base/strings/string_number_conversions.h" 23 #include "base/strings/string_number_conversions.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 58
58 namespace { 59 namespace {
59 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number; 60 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number;
60 } 61 }
61 62
62 namespace cc { 63 namespace cc {
63 namespace { 64 namespace {
64 65
65 Layer* UpdateAndGetLayer(Layer* current_layer, 66 Layer* UpdateAndGetLayer(Layer* current_layer,
66 int layer_id, 67 int layer_id,
67 const base::hash_map<int, Layer*>& layer_id_map) { 68 const std::unordered_map<int, Layer*>& layer_id_map) {
68 if (layer_id == Layer::INVALID_ID) { 69 if (layer_id == Layer::INVALID_ID) {
69 if (current_layer) 70 if (current_layer)
70 current_layer->SetLayerTreeHost(nullptr); 71 current_layer->SetLayerTreeHost(nullptr);
71 72
72 return nullptr; 73 return nullptr;
73 } 74 }
74 75
75 auto layer_it = layer_id_map.find(layer_id); 76 auto layer_it = layer_id_map.find(layer_id);
76 DCHECK(layer_it != layer_id_map.end()); 77 DCHECK(layer_it != layer_id_map.end());
77 if (current_layer && current_layer != layer_it->second) 78 if (current_layer && current_layer != layer_it->second)
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 LayerTreeHostCommon::CallFunctionForSubtree( 1448 LayerTreeHostCommon::CallFunctionForSubtree(
1448 root_layer(), [seq_num](Layer* layer) { 1449 root_layer(), [seq_num](Layer* layer) {
1449 layer->set_property_tree_sequence_number(seq_num); 1450 layer->set_property_tree_sequence_number(seq_num);
1450 }); 1451 });
1451 1452
1452 surface_id_namespace_ = proto.surface_id_namespace(); 1453 surface_id_namespace_ = proto.surface_id_namespace();
1453 next_surface_sequence_ = proto.next_surface_sequence(); 1454 next_surface_sequence_ = proto.next_surface_sequence();
1454 } 1455 }
1455 1456
1456 } // namespace cc 1457 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698