Revert 279472 "Mojo: Add mojo_shell_tests to the Linux bots."
[chromium-blink-merge.git] / cc / resources / prioritized_tile_set.h
blob15d0e4f8b48b1b0c609c452439fc616d644e6375
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_
8 #include <vector>
10 #include "cc/base/cc_export.h"
11 #include "cc/resources/managed_tile_state.h"
13 namespace cc {
14 class Tile;
16 class CC_EXPORT PrioritizedTileSet {
17 public:
18 PrioritizedTileSet();
19 ~PrioritizedTileSet();
21 void InsertTile(Tile* tile, ManagedTileBin bin);
22 void Clear();
24 class CC_EXPORT Iterator {
25 public:
26 Iterator(PrioritizedTileSet* set, bool use_priority_ordering);
28 ~Iterator();
30 void DisablePriorityOrdering();
32 Iterator& operator++();
33 Tile* operator->() { return *(*this); }
34 Tile* operator*();
35 operator bool() const {
36 return iterator_ != tile_set_->tiles_[current_bin_].end();
39 private:
40 void AdvanceList();
42 PrioritizedTileSet* tile_set_;
43 ManagedTileBin current_bin_;
44 std::vector<Tile*>::iterator iterator_;
45 bool use_priority_ordering_;
48 private:
49 friend class Iterator;
51 void SortBinIfNeeded(ManagedTileBin bin);
53 std::vector<Tile*> tiles_[NUM_BINS];
54 bool bin_sorted_[NUM_BINS];
57 } // namespace cc
59 #endif // CC_RESOURCES_PRIORITIZED_TILE_SET_H_