Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

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

Issue 541843002: cc: Optimise shared raster tile handling in raster tile priority queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Less code duplication Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/resources/raster_tile_priority_queue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_ 5 #ifndef CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_
6 #define CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_ 6 #define CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_
7 7
8 #include <set>
8 #include <utility> 9 #include <utility>
9 #include <vector> 10 #include <vector>
10 11
11 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
12 #include "cc/layers/picture_layer_impl.h" 13 #include "cc/layers/picture_layer_impl.h"
13 #include "cc/resources/tile_priority.h" 14 #include "cc/resources/tile_priority.h"
14 15
15 namespace cc { 16 namespace cc {
16 17
17 class CC_EXPORT RasterTilePriorityQueue { 18 class CC_EXPORT RasterTilePriorityQueue {
18 public: 19 public:
19 struct PairedPictureLayerQueue { 20 struct PairedPictureLayerQueue {
20 PairedPictureLayerQueue(); 21 PairedPictureLayerQueue();
21 PairedPictureLayerQueue(const PictureLayerImpl::Pair& layer_pair, 22 PairedPictureLayerQueue(const PictureLayerImpl::Pair& layer_pair,
22 TreePriority tree_priority); 23 TreePriority tree_priority);
23 ~PairedPictureLayerQueue(); 24 ~PairedPictureLayerQueue();
24 25
25 bool IsEmpty() const; 26 bool IsEmpty() const;
26 Tile* Top(TreePriority tree_priority); 27 Tile* Top(TreePriority tree_priority);
27 void Pop(TreePriority tree_priority); 28 void Pop(TreePriority tree_priority);
28 29
29 WhichTree NextTileIteratorTree(TreePriority tree_priority) const; 30 WhichTree NextTileIteratorTree(TreePriority tree_priority) const;
30 31
31 PictureLayerImpl::LayerRasterTileIterator active_iterator; 32 PictureLayerImpl::LayerRasterTileIterator active_iterator;
32 PictureLayerImpl::LayerRasterTileIterator pending_iterator; 33 PictureLayerImpl::LayerRasterTileIterator pending_iterator;
34 bool has_both_layers;
33 35
34 // TODO(vmpstr): Investigate removing this. 36 // Set of returned tiles (excluding the current one) for DCHECKing.
35 std::vector<Tile*> returned_shared_tiles; 37 std::set<const Tile*> returned_tiles_for_debug;
36 }; 38 };
37 39
38 RasterTilePriorityQueue(); 40 RasterTilePriorityQueue();
39 ~RasterTilePriorityQueue(); 41 ~RasterTilePriorityQueue();
40 42
41 void Build(const std::vector<PictureLayerImpl::Pair>& paired_layers, 43 void Build(const std::vector<PictureLayerImpl::Pair>& paired_layers,
42 TreePriority tree_priority); 44 TreePriority tree_priority);
43 void Reset(); 45 void Reset();
44 46
45 bool IsEmpty() const; 47 bool IsEmpty() const;
46 Tile* Top(); 48 Tile* Top();
47 void Pop(); 49 void Pop();
48 50
49 private: 51 private:
50 // TODO(vmpstr): This is potentially unnecessary if it becomes the case that 52 // 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 53 // PairedPictureLayerQueue is fast enough to copy. In that case, we can use
52 // objects directly (ie std::vector<PairedPictureLayerQueue>. 54 // objects directly (ie std::vector<PairedPictureLayerQueue>.
53 ScopedPtrVector<PairedPictureLayerQueue> paired_queues_; 55 ScopedPtrVector<PairedPictureLayerQueue> paired_queues_;
54 TreePriority tree_priority_; 56 TreePriority tree_priority_;
55 57
56 DISALLOW_COPY_AND_ASSIGN(RasterTilePriorityQueue); 58 DISALLOW_COPY_AND_ASSIGN(RasterTilePriorityQueue);
57 }; 59 };
58 60
59 } // namespace cc 61 } // namespace cc
60 62
61 #endif // CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_ 63 #endif // CC_RESOURCES_RASTER_TILE_PRIORITY_QUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/resources/raster_tile_priority_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698