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/resources/tile_manager.h

Issue 793573006: Refactoring for merging ManagedTileState into Tile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix a nit Created 6 years 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/resources/tile_draw_info.cc ('k') | cc/resources/tile_manager.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_RESOURCES_TILE_MANAGER_H_ 5 #ifndef CC_RESOURCES_TILE_MANAGER_H_
6 #define CC_RESOURCES_TILE_MANAGER_H_ 6 #define CC_RESOURCES_TILE_MANAGER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/containers/hash_tables.h" 14 #include "base/containers/hash_tables.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "cc/base/ref_counted_managed.h" 17 #include "cc/base/ref_counted_managed.h"
18 #include "cc/base/unique_notifier.h" 18 #include "cc/base/unique_notifier.h"
19 #include "cc/resources/eviction_tile_priority_queue.h" 19 #include "cc/resources/eviction_tile_priority_queue.h"
20 #include "cc/resources/managed_tile_state.h"
21 #include "cc/resources/memory_history.h" 20 #include "cc/resources/memory_history.h"
22 #include "cc/resources/raster_source.h" 21 #include "cc/resources/raster_source.h"
23 #include "cc/resources/raster_tile_priority_queue.h" 22 #include "cc/resources/raster_tile_priority_queue.h"
24 #include "cc/resources/resource_pool.h" 23 #include "cc/resources/resource_pool.h"
25 #include "cc/resources/tile.h" 24 #include "cc/resources/tile.h"
25 #include "cc/resources/tile_draw_info.h"
26 #include "cc/resources/tile_task_runner.h" 26 #include "cc/resources/tile_task_runner.h"
27 27
28 namespace base { 28 namespace base {
29 namespace debug { 29 namespace debug {
30 class ConvertableToTraceFormat; 30 class ConvertableToTraceFormat;
31 class TracedValue; 31 class TracedValue;
32 } 32 }
33 } 33 }
34 34
35 namespace cc { 35 namespace cc {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 scoped_refptr<base::debug::ConvertableToTraceFormat> BasicStateAsValue() 124 scoped_refptr<base::debug::ConvertableToTraceFormat> BasicStateAsValue()
125 const; 125 const;
126 void BasicStateAsValueInto(base::debug::TracedValue* dict) const; 126 void BasicStateAsValueInto(base::debug::TracedValue* dict) const;
127 const MemoryHistory::Entry& memory_stats_from_last_assign() const { 127 const MemoryHistory::Entry& memory_stats_from_last_assign() const {
128 return memory_stats_from_last_assign_; 128 return memory_stats_from_last_assign_;
129 } 129 }
130 130
131 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { 131 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) {
132 for (size_t i = 0; i < tiles.size(); ++i) { 132 for (size_t i = 0; i < tiles.size(); ++i) {
133 ManagedTileState& mts = tiles[i]->managed_state(); 133 TileDrawInfo& draw_info = tiles[i]->draw_info();
134 134 draw_info.resource_ = resource_pool_->AcquireResource(tiles[i]->size());
135 mts.draw_info.resource_ =
136 resource_pool_->AcquireResource(tiles[i]->size());
137 } 135 }
138 } 136 }
139 137
140 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { 138 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) {
141 for (size_t i = 0; i < tiles.size(); ++i) { 139 for (size_t i = 0; i < tiles.size(); ++i) {
142 Tile* tile = tiles[i]; 140 Tile* tile = tiles[i];
143 FreeResourcesForTile(tile); 141 FreeResourcesForTile(tile);
144 } 142 }
145 } 143 }
146 144
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 286
289 bool did_notify_ready_to_activate_; 287 bool did_notify_ready_to_activate_;
290 bool did_notify_ready_to_draw_; 288 bool did_notify_ready_to_draw_;
291 289
292 DISALLOW_COPY_AND_ASSIGN(TileManager); 290 DISALLOW_COPY_AND_ASSIGN(TileManager);
293 }; 291 };
294 292
295 } // namespace cc 293 } // namespace cc
296 294
297 #endif // CC_RESOURCES_TILE_MANAGER_H_ 295 #endif // CC_RESOURCES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/resources/tile_draw_info.cc ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698