OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_MANAGED_TILE_STATE_H_ | 5 #ifndef CC_RESOURCES_MANAGED_TILE_STATE_H_ |
6 #define CC_RESOURCES_MANAGED_TILE_STATE_H_ | 6 #define CC_RESOURCES_MANAGED_TILE_STATE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/resources/platform_color.h" | 9 #include "cc/resources/platform_color.h" |
10 #include "cc/resources/rasterizer.h" | 10 #include "cc/resources/rasterizer.h" |
11 #include "cc/resources/resource_pool.h" | 11 #include "cc/resources/resource_pool.h" |
12 #include "cc/resources/resource_provider.h" | 12 #include "cc/resources/resource_provider.h" |
13 #include "cc/resources/scoped_resource.h" | 13 #include "cc/resources/scoped_resource.h" |
14 #include "cc/resources/tile_priority.h" | 14 #include "cc/resources/tile_priority.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 | 17 |
18 class TileManager; | |
19 | |
20 // Tile manager classifying tiles into a few basic bins: | |
21 enum ManagedTileBin { | |
22 NOW_AND_READY_TO_DRAW_BIN = 0, // Ready to draw and within viewport. | |
23 NOW_BIN = 1, // Needed ASAP. | |
24 SOON_BIN = 2, // Impl-side version of prepainting. | |
25 EVENTUALLY_AND_ACTIVE_BIN = 3, // Nice to have, and has a task or resource. | |
26 EVENTUALLY_BIN = 4, // Nice to have, if we've got memory and time. | |
27 AT_LAST_AND_ACTIVE_BIN = 5, // Only do this after all other bins. | |
28 AT_LAST_BIN = 6, // Only do this after all other bins. | |
29 NEVER_BIN = 7, // Dont bother. | |
30 NUM_BINS = 8 | |
31 // NOTE: Be sure to update ManagedTileBinAsValue and kBinPolicyMap when adding | |
32 // or reordering fields. | |
33 }; | |
34 scoped_ptr<base::Value> ManagedTileBinAsValue(ManagedTileBin bin); | |
35 | |
36 // This is state that is specific to a tile that is | 18 // This is state that is specific to a tile that is |
37 // managed by the TileManager. | 19 // managed by the TileManager. |
38 class CC_EXPORT ManagedTileState { | 20 class CC_EXPORT ManagedTileState { |
39 public: | 21 public: |
40 // This class holds all the state relevant to drawing a tile. | 22 // This class holds all the state relevant to drawing a tile. |
41 class CC_EXPORT DrawInfo { | 23 class CC_EXPORT DrawInfo { |
42 public: | 24 public: |
43 enum Mode { RESOURCE_MODE, SOLID_COLOR_MODE, PICTURE_PILE_MODE }; | 25 enum Mode { RESOURCE_MODE, SOLID_COLOR_MODE, PICTURE_PILE_MODE }; |
44 | 26 |
45 DrawInfo(); | 27 DrawInfo(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 82 |
101 ManagedTileState(); | 83 ManagedTileState(); |
102 ~ManagedTileState(); | 84 ~ManagedTileState(); |
103 | 85 |
104 void AsValueInto(base::debug::TracedValue* dict) const; | 86 void AsValueInto(base::debug::TracedValue* dict) const; |
105 | 87 |
106 // Persisted state: valid all the time. | 88 // Persisted state: valid all the time. |
107 DrawInfo draw_info; | 89 DrawInfo draw_info; |
108 scoped_refptr<RasterTask> raster_task; | 90 scoped_refptr<RasterTask> raster_task; |
109 | 91 |
110 ManagedTileBin bin; | |
111 | |
112 TileResolution resolution; | 92 TileResolution resolution; |
113 bool required_for_activation; | |
114 TilePriority::PriorityBin priority_bin; | 93 TilePriority::PriorityBin priority_bin; |
115 float distance_to_visible; | |
116 bool visible_and_ready_to_draw; | |
117 | 94 |
118 // Priority for this state from the last time we assigned memory. | 95 // Priority for this state from the last time we assigned memory. |
119 unsigned scheduled_priority; | 96 unsigned scheduled_priority; |
120 }; | 97 }; |
121 | 98 |
122 } // namespace cc | 99 } // namespace cc |
123 | 100 |
124 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ | 101 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ |
OLD | NEW |