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_
11 #include "cc/base/cc_export.h"
12 #include "cc/layers/picture_layer_impl.h"
13 #include "cc/resources/tile_priority.h"
17 class CC_EXPORT EvictionTilePriorityQueue {
19 struct PairedPictureLayerQueue {
20 PairedPictureLayerQueue();
21 PairedPictureLayerQueue(const PictureLayerImpl::Pair& layer_pair,
22 TreePriority tree_priority);
23 ~PairedPictureLayerQueue();
26 Tile* Top(TreePriority tree_priority);
27 void Pop(TreePriority tree_priority);
29 WhichTree NextTileIteratorTree(TreePriority tree_priority) const;
31 PictureLayerImpl::LayerEvictionTileIterator active_iterator;
32 PictureLayerImpl::LayerEvictionTileIterator pending_iterator;
34 // TODO(vmpstr): Investigate removing this.
35 std::vector<Tile*> returned_shared_tiles;
38 EvictionTilePriorityQueue();
39 ~EvictionTilePriorityQueue();
41 void Build(const std::vector<PictureLayerImpl::Pair>& paired_layers,
42 TreePriority tree_priority);
50 // TODO(vmpstr): This is potentially unnecessary if it becomes the case that
51 // PairedPictureLayerQueue is fast enough to copy. In that case, we can use
52 // objects directly (ie std::vector<PairedPictureLayerQueue>).
53 ScopedPtrVector<PairedPictureLayerQueue> paired_queues_;
54 TreePriority tree_priority_;
56 DISALLOW_COPY_AND_ASSIGN(EvictionTilePriorityQueue);
61 #endif // CC_RESOURCES_EVICTION_TILE_PRIORITY_QUEUE_H_