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_PRIORITY_H_ | 5 #ifndef CC_TILE_PRIORITY_H_ |
6 #define CC_TILE_PRIORITY_H_ | 6 #define CC_TILE_PRIORITY_H_ |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 pending.time_to_visible_in_seconds); | 89 pending.time_to_visible_in_seconds); |
90 distance_to_visible_in_pixels = | 90 distance_to_visible_in_pixels = |
91 std::min(active.distance_to_visible_in_pixels, | 91 std::min(active.distance_to_visible_in_pixels, |
92 pending.distance_to_visible_in_pixels); | 92 pending.distance_to_visible_in_pixels); |
93 } | 93 } |
94 void set_current_screen_quad(const gfx::QuadF& q) { current_screen_quad = q; } | 94 void set_current_screen_quad(const gfx::QuadF& q) { current_screen_quad = q; } |
95 | 95 |
96 scoped_ptr<base::Value> AsValue() const; | 96 scoped_ptr<base::Value> AsValue() const; |
97 | 97 |
98 static const float kMaxDistanceInContentSpace; | 98 static const float kMaxDistanceInContentSpace; |
| 99 static const int64 kNumTilesToCoverWithInflatedViewportRectForPrioritization; |
99 | 100 |
100 static inline float manhattanDistance(const gfx::RectF& a, const gfx::RectF& b
) { | 101 static inline float manhattanDistance(const gfx::RectF& a, const gfx::RectF& b
) { |
101 // Compute the union explicitly. | 102 // Compute the union explicitly. |
102 gfx::RectF c = gfx::RectF( | 103 gfx::RectF c = gfx::RectF( |
103 std::min(a.x(), b.x()), | 104 std::min(a.x(), b.x()), |
104 std::min(a.y(), b.y()), | 105 std::min(a.y(), b.y()), |
105 std::max(a.right(), b.right()) - std::min(a.x(), b.x()), | 106 std::max(a.right(), b.right()) - std::min(a.x(), b.x()), |
106 std::max(a.bottom(), b.bottom()) - std::min(a.y(), b.y())); | 107 std::max(a.bottom(), b.bottom()) - std::min(a.y(), b.y())); |
107 | 108 |
108 // Rects touching the edge of the screen should not be considered visible. | 109 // Rects touching the edge of the screen should not be considered visible. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 size_t memory_limit_in_bytes; | 171 size_t memory_limit_in_bytes; |
171 | 172 |
172 TreePriority tree_priority; | 173 TreePriority tree_priority; |
173 | 174 |
174 scoped_ptr<base::Value> AsValue() const; | 175 scoped_ptr<base::Value> AsValue() const; |
175 }; | 176 }; |
176 | 177 |
177 } // namespace cc | 178 } // namespace cc |
178 | 179 |
179 #endif // CC_TILE_PRIORITY_H_ | 180 #endif // CC_TILE_PRIORITY_H_ |
OLD | NEW |