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
3 // found in the LICENSE file.
5 #ifndef CC_RESOURCES_PRIORITIZED_TILE_SET_H_
6 #define CC_RESOURCES_PRIORITIZED_TILE_SET_H_
10 #include "cc/base/cc_export.h"
11 #include "cc/resources/managed_tile_state.h"
16 class CC_EXPORT PrioritizedTileSet
{
19 ~PrioritizedTileSet();
21 void InsertTile(Tile
* tile
, ManagedTileBin bin
);
24 class CC_EXPORT Iterator
{
26 Iterator(PrioritizedTileSet
* set
, bool use_priority_ordering
);
30 void DisablePriorityOrdering();
32 Iterator
& operator++();
33 Tile
* operator->() { return *(*this); }
35 operator bool() const {
36 return iterator_
!= tile_set_
->tiles_
[current_bin_
].end();
42 PrioritizedTileSet
* tile_set_
;
43 ManagedTileBin current_bin_
;
44 std::vector
<Tile
*>::iterator iterator_
;
45 bool use_priority_ordering_
;
49 friend class Iterator
;
51 void SortBinIfNeeded(ManagedTileBin bin
);
53 std::vector
<Tile
*> tiles_
[NUM_BINS
];
54 bool bin_sorted_
[NUM_BINS
];
59 #endif // CC_RESOURCES_PRIORITIZED_TILE_SET_H_