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

Side by Side Diff: cc/tiles/picture_layer_tiling.h

Issue 2825853002: Improvements to uses of base::SmallMap (Closed)
Patch Set: Review comments Created 3 years, 8 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/scheduler/begin_frame_source.cc ('k') | cc/tiles/picture_layer_tiling.cc » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #ifndef CC_TILES_PICTURE_LAYER_TILING_H_ 5 #ifndef CC_TILES_PICTURE_LAYER_TILING_H_
6 #define CC_TILES_PICTURE_LAYER_TILING_H_ 6 #define CC_TILES_PICTURE_LAYER_TILING_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 }; 56 };
57 57
58 struct TileMapKey { 58 struct TileMapKey {
59 TileMapKey(int x, int y) : index_x(x), index_y(y) {} 59 TileMapKey(int x, int y) : index_x(x), index_y(y) {}
60 explicit TileMapKey(const std::pair<int, int>& index) 60 explicit TileMapKey(const std::pair<int, int>& index)
61 : index_x(index.first), index_y(index.second) {} 61 : index_x(index.first), index_y(index.second) {}
62 62
63 bool operator==(const TileMapKey& other) const { 63 bool operator==(const TileMapKey& other) const {
64 return index_x == other.index_x && index_y == other.index_y; 64 return index_x == other.index_x && index_y == other.index_y;
65 } 65 }
66 bool operator<(const TileMapKey& other) const {
67 return std::tie(index_x, index_y) < std::tie(other.index_x, other.index_y);
68 }
66 69
67 int index_x; 70 int index_x;
68 int index_y; 71 int index_y;
69 }; 72 };
70 73
71 struct TileMapKeyHash { 74 struct TileMapKeyHash {
72 size_t operator()(const TileMapKey& key) const { 75 size_t operator()(const TileMapKey& key) const {
73 uint16_t value1 = static_cast<uint16_t>(key.index_x); 76 uint16_t value1 = static_cast<uint16_t>(key.index_x);
74 uint16_t value2 = static_cast<uint16_t>(key.index_y); 77 uint16_t value2 = static_cast<uint16_t>(key.index_y);
75 uint32_t value1_32 = value1; 78 uint32_t value1_32 = value1;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 bool has_eventually_rect_tiles_ = false; 384 bool has_eventually_rect_tiles_ = false;
382 bool all_tiles_done_ = true; 385 bool all_tiles_done_ = true;
383 386
384 private: 387 private:
385 DISALLOW_COPY_AND_ASSIGN(PictureLayerTiling); 388 DISALLOW_COPY_AND_ASSIGN(PictureLayerTiling);
386 }; 389 };
387 390
388 } // namespace cc 391 } // namespace cc
389 392
390 #endif // CC_TILES_PICTURE_LAYER_TILING_H_ 393 #endif // CC_TILES_PICTURE_LAYER_TILING_H_
OLDNEW
« no previous file with comments | « cc/scheduler/begin_frame_source.cc ('k') | cc/tiles/picture_layer_tiling.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698