Chromium Code Reviews

Side by Side Diff: cc/resources/raster_tile_priority_queue.h

Issue 367833003: cc: Start using raster/eviction iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_
6 #define CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_
7
8 #include <utility>
9 #include <vector>
10
11 #include "cc/base/cc_export.h"
12 #include "cc/layers/picture_layer_impl.h"
13 #include "cc/resources/tile_priority.h"
14 #include "cc/resources/tile_priority_queue.h"
15
16 namespace cc {
17
18 class CC_EXPORT RasterTilePriorityQueue : public TilePriorityQueue {
19 public:
20 RasterTilePriorityQueue();
21 virtual ~RasterTilePriorityQueue();
22
23 void Reset();
24 void BuildQueue(const std::vector<PairedPictureLayer>& paired_picture_layers,
25 TreePriority tree_priority);
26
27 // TilePriorityQueue overrides.
28 virtual void Pop() OVERRIDE;
29 virtual bool IsEmpty() OVERRIDE;
30 virtual Tile* Top() OVERRIDE;
31
32 private:
33 struct PairedPictureLayerIterator {
34 PairedPictureLayerIterator();
35 ~PairedPictureLayerIterator();
36
37 Tile* PeekTile(TreePriority tree_priority);
38 void PopTile(TreePriority tree_priority);
39
40 std::pair<PictureLayerImpl::LayerRasterTileIterator*, WhichTree>
41 NextTileIterator(TreePriority tree_priority);
42
43 PictureLayerImpl::LayerRasterTileIterator active_iterator;
44 PictureLayerImpl::LayerRasterTileIterator pending_iterator;
45
46 std::vector<Tile*> returned_shared_tiles;
47 };
48
49 class RasterOrderComparator {
50 public:
51 explicit RasterOrderComparator(TreePriority tree_priority);
52
53 bool operator()(PairedPictureLayerIterator* a,
54 PairedPictureLayerIterator* b) const;
55
56 private:
57 TreePriority tree_priority_;
58 };
59
60 std::vector<PairedPictureLayerIterator> paired_iterators_;
61 std::vector<PairedPictureLayerIterator*> iterator_heap_;
62 TreePriority tree_priority_;
63 RasterOrderComparator comparator_;
64
65 DISALLOW_COPY_AND_ASSIGN(RasterTilePriorityQueue);
66 };
67
68 } // namespace cc
69
70 #endif // CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_
OLDNEW

Powered by Google App Engine