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

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

Issue 816453008: cc: Split tiling set raster queues into all and required. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todos Created 5 years, 11 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
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_TILING_SET_RASTER_QUEUE_H_ 5 #ifndef CC_RESOURCES_TILING_SET_RASTER_QUEUE_H_
6 #define CC_RESOURCES_TILING_SET_RASTER_QUEUE_H_ 6 #define CC_RESOURCES_TILING_SET_RASTER_QUEUE_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "cc/resources/picture_layer_tiling_set.h"
10 #include "cc/resources/tile.h"
11 #include "cc/resources/tile_priority.h"
12 9
13 namespace cc { 10 namespace cc {
14 11
12 class Tile;
danakj 2015/01/08 23:24:41 move up a line
vmpstr 2015/01/09 20:21:40 Done.
15 class CC_EXPORT TilingSetRasterQueue { 13 class CC_EXPORT TilingSetRasterQueue {
danakj 2015/01/08 23:24:41 no longer needs to be exported, i think?
vmpstr 2015/01/09 20:21:40 Maybe? dtor needs to be exported, no? I'll see if
16 public: 14 public:
17 TilingSetRasterQueue(); 15 TilingSetRasterQueue() = default;
danakj 2015/01/08 23:24:41 do you need a constructor? remind me why default i
vmpstr 2015/01/09 20:21:40 Removed.
18 TilingSetRasterQueue(PictureLayerTilingSet* tiling_set, 16 virtual ~TilingSetRasterQueue() = default;
danakj 2015/01/08 23:24:41 ditto why is default better than {}?
vmpstr 2015/01/09 20:21:40 Personal preference: it specifies intent better. I
19 bool prioritize_low_res);
20 ~TilingSetRasterQueue();
21 17
22 Tile* Top(); 18 virtual Tile* Top() = 0;
23 const Tile* Top() const; 19 virtual const Tile* Top() const = 0;
24 void Pop(); 20 virtual void Pop() = 0;
25 bool IsEmpty() const; 21 virtual bool IsEmpty() const = 0;
26
27 private:
28 class TilingIterator {
29 public:
30 TilingIterator();
31 explicit TilingIterator(PictureLayerTiling* tiling,
32 TilingData* tiling_data);
33 ~TilingIterator();
34
35 operator bool() const { return !!current_tile_; }
36 const Tile* operator*() const { return current_tile_; }
37 Tile* operator*() { return current_tile_; }
38 TilePriority::PriorityBin type() const {
39 switch (phase_) {
40 case VISIBLE_RECT:
41 return TilePriority::NOW;
42 case SKEWPORT_RECT:
43 case SOON_BORDER_RECT:
44 return TilePriority::SOON;
45 case EVENTUALLY_RECT:
46 return TilePriority::EVENTUALLY;
47 }
48 NOTREACHED();
49 return TilePriority::EVENTUALLY;
50 }
51
52 TilingIterator& operator++();
53
54 private:
55 enum Phase {
56 VISIBLE_RECT,
57 SKEWPORT_RECT,
58 SOON_BORDER_RECT,
59 EVENTUALLY_RECT
60 };
61
62 void AdvancePhase();
63 bool TileNeedsRaster(Tile* tile) const {
64 return tile->NeedsRaster() && !tiling_->IsTileOccluded(tile);
65 }
66
67 PictureLayerTiling* tiling_;
68 TilingData* tiling_data_;
69
70 Phase phase_;
71
72 Tile* current_tile_;
73 TilingData::Iterator visible_iterator_;
74 TilingData::SpiralDifferenceIterator spiral_iterator_;
75 };
76
77 enum IteratorType { LOW_RES, HIGH_RES, NUM_ITERATORS };
78
79 void AdvanceToNextStage();
80
81 PictureLayerTilingSet* tiling_set_;
82
83 struct IterationStage {
84 IteratorType iterator_type;
85 TilePriority::PriorityBin tile_type;
86 };
87
88 size_t current_stage_;
89
90 // One low res stage, and three high res stages.
91 IterationStage stages_[4];
92 TilingIterator iterators_[NUM_ITERATORS];
93 }; 22 };
94 23
95 } // namespace cc 24 } // namespace cc
96 25
97 #endif // CC_RESOURCES_TILING_SET_RASTER_QUEUE_H_ 26 #endif // CC_RESOURCES_TILING_SET_RASTER_QUEUE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698