OLD | NEW |
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_PRIORTY_H_ | 5 #ifndef CC_TILE_PRIORITY_H_ |
6 #define CC_TILE_PRIORTY_H_ | 6 #define CC_TILE_PRIORITY_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "cc/picture_pile.h" | 9 #include "cc/picture_pile.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 struct TilePriority { | 15 struct TilePriority { |
16 // Set to true for tiles that should be favored during, for example, | 16 // Set to true for tiles that should be favored during, for example, |
(...skipping 22 matching lines...) Expand all Loading... |
39 ALLOW_ONLY_REQUIRED, // On primary tree, would be drawn. | 39 ALLOW_ONLY_REQUIRED, // On primary tree, would be drawn. |
40 | 40 |
41 // Use as little as possible. | 41 // Use as little as possible. |
42 ALLOW_NICE_TO_HAVE, // On either tree, nice to have | 42 ALLOW_NICE_TO_HAVE, // On either tree, nice to have |
43 | 43 |
44 // Use as much memory, up to memory size. | 44 // Use as much memory, up to memory size. |
45 ALLOW_ANYTHING, | 45 ALLOW_ANYTHING, |
46 }; | 46 }; |
47 | 47 |
48 class GlobalStateThatImpactsTilePriority { | 48 class GlobalStateThatImpactsTilePriority { |
49 public: | 49 public: |
50 GlobalStateThatImpactsTilePriority() | 50 GlobalStateThatImpactsTilePriority() |
51 : memory_limit_policy(ALLOW_NOTHING) | 51 : memory_limit_policy(ALLOW_NOTHING) |
52 , memory_limit_in_bytes(0) | 52 , memory_limit_in_bytes(0) |
53 , smoothness_takes_priority(false) | 53 , smoothness_takes_priority(false) |
54 , pending_tree_frame_number(-1) | 54 , pending_tree_frame_number(-1) |
55 , active_tree_frame_number(-1) { | 55 , active_tree_frame_number(-1) { |
56 } | 56 } |
57 | 57 |
58 TileMemoryLimitPolicy memory_limit_policy; | 58 TileMemoryLimitPolicy memory_limit_policy; |
59 | 59 |
60 size_t memory_limit_in_bytes; | 60 size_t memory_limit_in_bytes; |
61 | 61 |
62 // Set when scrolling. | 62 // Set when scrolling. |
63 bool smoothness_takes_priority; | 63 bool smoothness_takes_priority; |
64 | 64 |
65 // Use -1 if no tree. | 65 // Use -1 if no tree. |
66 int pending_tree_frame_number; | 66 int pending_tree_frame_number; |
67 int active_tree_frame_number; | 67 int active_tree_frame_number; |
68 }; | 68 }; |
69 | 69 |
70 class TilePriorityComparator { | 70 class TilePriorityComparator { |
71 public: | 71 public: |
72 TilePriorityComparator(GlobalStateThatImpactsTilePriority& global_state) | 72 TilePriorityComparator(GlobalStateThatImpactsTilePriority& global_state) |
73 : global_state_(global_state) {} | 73 : global_state_(global_state) {} |
74 | 74 |
75 int compare(const TilePriority& a, const TilePriority& b) { | 75 int compare(const TilePriority& a, const TilePriority& b) { |
76 // TODO(nduca,enne): Implement a comparator using the attributes here. | 76 // TODO(nduca,enne): Implement a comparator using the attributes here. |
77 return 0; | 77 return 0; |
78 } | 78 } |
79 | 79 |
80 private: | 80 private: |
81 GlobalStateThatImpactsTilePriority global_state_; | 81 GlobalStateThatImpactsTilePriority global_state_; |
82 }; | 82 }; |
83 | 83 |
84 } // namespace cc | 84 } // namespace cc |
85 #endif | 85 |
| 86 #endif // CC_TILE_PRIORITY_H_ |
OLD | NEW |