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

Side by Side Diff: cc/tile_manager.h

Issue 11417111: cc: Add PictureLayerTilingSet to manage PictureLayerTiling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win_rel Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « cc/tile.h ('k') | cc/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_TILE_MANAGER_H_ 5 #ifndef CC_TILE_MANAGER_H_
6 #define CC_TILE_MANAGER_H_ 6 #define CC_TILE_MANAGER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "cc/layer_tree_host_impl.h" 11 #include "cc/layer_tree_host_impl.h"
12 #include "cc/tile_priority.h" 12 #include "cc/tile_priority.h"
13 13
14 namespace cc { 14 namespace cc {
15 15
16 class Tile; 16 class Tile;
17 class TileVersion; 17 class TileVersion;
18 class ResourceProvider; 18 class ResourceProvider;
19 19
20 class TileManagerClient { 20 class CC_EXPORT TileManagerClient {
21 public: 21 public:
22 virtual void ScheduleManageTiles() = 0; 22 virtual void ScheduleManageTiles() = 0;
23 23
24 protected: 24 protected:
25 virtual ~TileManagerClient() {} 25 virtual ~TileManagerClient() {}
26 }; 26 };
27 27
28 // Tile manager classifying tiles into a few basic 28 // Tile manager classifying tiles into a few basic
29 // bins: 29 // bins:
30 enum TileManagerBin { 30 enum TileManagerBin {
31 NOW_BIN = 0, // Needed ASAP. 31 NOW_BIN = 0, // Needed ASAP.
32 SOON_BIN = 1, // Impl-side version of prepainting. 32 SOON_BIN = 1, // Impl-side version of prepainting.
33 EVENTUALLY_BIN = 2, // Nice to have, if we've got memory and time. 33 EVENTUALLY_BIN = 2, // Nice to have, if we've got memory and time.
34 NEVER_BIN = 3, // Dont bother. 34 NEVER_BIN = 3, // Dont bother.
35 NUM_BINS = 4 35 NUM_BINS = 4
36 }; 36 };
37 37
38 // This is state that is specific to a tile that is 38 // This is state that is specific to a tile that is
39 // managed by the TileManager. 39 // managed by the TileManager.
40 class ManagedTileState { 40 class CC_EXPORT ManagedTileState {
41 public: 41 public:
42 ManagedTileState() 42 ManagedTileState()
43 : can_use_gpu_memory(false) 43 : can_use_gpu_memory(false)
44 , resource_id(0) 44 , resource_id(0)
45 , resource_id_can_be_freed(0) {} 45 , resource_id_can_be_freed(0) {}
46 46
47 // Persisted state: valid all the time. 47 // Persisted state: valid all the time.
48 bool can_use_gpu_memory; 48 bool can_use_gpu_memory;
49 ResourceProvider::ResourceId resource_id; 49 ResourceProvider::ResourceId resource_id;
50 bool resource_id_can_be_freed; 50 bool resource_id_can_be_freed;
51 51
52 // Ephemeral state, valid only during Manage. 52 // Ephemeral state, valid only during Manage.
53 TileManagerBin bin; 53 TileManagerBin bin;
54 TileResolution resolution; 54 TileResolution resolution;
55 float time_to_needed_in_seconds; 55 float time_to_needed_in_seconds;
56 }; 56 };
57 57
58 // This class manages tiles, deciding which should get rasterized and which 58 // This class manages tiles, deciding which should get rasterized and which
59 // should no longer have any memory assigned to them. Tile objects are "owned" 59 // should no longer have any memory assigned to them. Tile objects are "owned"
60 // by layers; they automatically register with the manager when they are 60 // by layers; they automatically register with the manager when they are
61 // created, and unregister from the manager when they are deleted. 61 // created, and unregister from the manager when they are deleted.
62 class TileManager { 62 class CC_EXPORT TileManager {
63 public: 63 public:
64 TileManager(TileManagerClient* client); 64 TileManager(TileManagerClient* client);
65 ~TileManager(); 65 ~TileManager();
66 66
67 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); 67 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state);
68 void ManageTiles(); 68 void ManageTiles();
69 69
70 protected: 70 protected:
71 // Methods called by Tile 71 // Methods called by Tile
72 friend class Tile; 72 friend class Tile;
(...skipping 12 matching lines...) Expand all
85 GlobalStateThatImpactsTilePriority global_state_; 85 GlobalStateThatImpactsTilePriority global_state_;
86 86
87 typedef std::vector<Tile*> TileVector; 87 typedef std::vector<Tile*> TileVector;
88 TileVector tiles_; 88 TileVector tiles_;
89 TileVector tiles_that_need_to_be_painted_; 89 TileVector tiles_that_need_to_be_painted_;
90 }; 90 };
91 91
92 } // namespace cc 92 } // namespace cc
93 93
94 #endif // CC_TILE_MANAGER_H_ 94 #endif // CC_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/tile.h ('k') | cc/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698