Update mojo sdk to rev cb6c5abfadfea0ca73dca466e2894554ac1ae144
[chromium-blink-merge.git] / cc / resources / eviction_tile_priority_queue.h
blob32ea9af681c7793356d720077ce9053db91074f6
1 // Copyright 2014 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_EVICTION_TILE_PRIORITY_QUEUE_H_
6 #define CC_RESOURCES_EVICTION_TILE_PRIORITY_QUEUE_H_
8 #include <set>
9 #include <utility>
10 #include <vector>
12 #include "cc/base/cc_export.h"
13 #include "cc/layers/picture_layer_impl.h"
14 #include "cc/resources/tile_priority.h"
15 #include "cc/resources/tiling_set_eviction_queue.h"
17 namespace cc {
19 class CC_EXPORT EvictionTilePriorityQueue {
20 public:
21 struct PairedTilingSetQueue {
22 PairedTilingSetQueue();
23 PairedTilingSetQueue(const PictureLayerImpl::Pair& layer_pair,
24 TreePriority tree_priority);
25 ~PairedTilingSetQueue();
27 bool IsEmpty() const;
28 Tile* Top();
29 void Pop();
31 WhichTree NextTileIteratorTree() const;
33 scoped_ptr<TilingSetEvictionQueue> active_queue;
34 scoped_ptr<TilingSetEvictionQueue> pending_queue;
36 // Set of returned tiles (excluding the current one) for DCHECKing.
37 std::set<const Tile*> returned_tiles_for_debug;
40 EvictionTilePriorityQueue();
41 ~EvictionTilePriorityQueue();
43 void Build(const std::vector<PictureLayerImpl::Pair>& paired_layers,
44 TreePriority tree_priority);
46 bool IsEmpty() const;
47 Tile* Top();
48 void Pop();
50 private:
51 // TODO(vmpstr): This is potentially unnecessary if it becomes the case that
52 // PairedTilingSetQueue is fast enough to copy. In that case, we can use
53 // objects directly (ie std::vector<PairedTilingSetQueue>).
54 ScopedPtrVector<PairedTilingSetQueue> paired_queues_;
55 TreePriority tree_priority_;
57 DISALLOW_COPY_AND_ASSIGN(EvictionTilePriorityQueue);
60 } // namespace cc
62 #endif // CC_RESOURCES_EVICTION_TILE_PRIORITY_QUEUE_H_