OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_TILE_PRIORTY_H_ |
| 6 #define CC_TILE_PRIORTY_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "cc/picture_pile.h" |
| 10 #include "cc/tile_priority.h" |
| 11 #include "ui/gfx/rect.h" |
| 12 #include "ui/gfx/size.h" |
| 13 |
| 14 namespace cc { |
| 15 |
| 16 struct TilePriority { |
| 17 // A given layer may have multiple tilings, of differing quality. |
| 18 // would_be_drawn is set for the tiles that are visible that would be |
| 19 // drawn if they were chosen. |
| 20 bool would_be_drawn; |
| 21 |
| 22 // Set to true for tiles that should be favored during, for example, |
| 23 // scrolls. |
| 24 bool on_primary_tree; |
| 25 |
| 26 // Used to prefer tiles near to the viewport. |
| 27 float distance_to_viewport; |
| 28 |
| 29 // TODO(enne): some metric that penalizes blurriness. |
| 30 }; |
| 31 |
| 32 class TilePriorityComparator { |
| 33 public: |
| 34 TilePriorityComparator(bool currently_scrolling) |
| 35 : currently_scrolling_(currently_scrolling) {} |
| 36 |
| 37 int compare(const TilePriority& a, const TilePriority& b) { |
| 38 // TODO(nduca,enne): Implement a comparator using the attributes here. |
| 39 return 0; |
| 40 } |
| 41 |
| 42 private: |
| 43 bool currently_scrolling_; |
| 44 }; |
| 45 |
| 46 } // namespace cc |
| 47 #endif |
OLD | NEW |