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

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

Issue 367833003: cc: Start using raster/eviction iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/picture_layer_tiling_unittest.cc ('k') | cc/resources/prioritized_tile_set.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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_PRIORITIZED_TILE_SET_H_
6 #define CC_RESOURCES_PRIORITIZED_TILE_SET_H_
7
8 #include <vector>
9
10 #include "cc/base/cc_export.h"
11 #include "cc/resources/managed_tile_state.h"
12
13 namespace cc {
14 class Tile;
15
16 class CC_EXPORT PrioritizedTileSet {
17 public:
18 PrioritizedTileSet();
19 ~PrioritizedTileSet();
20
21 void InsertTile(Tile* tile, ManagedTileBin bin);
22 void Clear();
23 bool IsEmpty();
24
25 class CC_EXPORT Iterator {
26 public:
27 Iterator(PrioritizedTileSet* set, bool use_priority_ordering);
28
29 ~Iterator();
30
31 void DisablePriorityOrdering();
32
33 Iterator& operator++();
34 Tile* operator->() { return *(*this); }
35 Tile* operator*();
36 operator bool() const {
37 return iterator_ != tile_set_->tiles_[current_bin_].end();
38 }
39
40 private:
41 void AdvanceList();
42
43 PrioritizedTileSet* tile_set_;
44 ManagedTileBin current_bin_;
45 std::vector<Tile*>::iterator iterator_;
46 bool use_priority_ordering_;
47 };
48
49 private:
50 friend class Iterator;
51
52 void SortBinIfNeeded(ManagedTileBin bin);
53
54 std::vector<Tile*> tiles_[NUM_BINS];
55 bool bin_sorted_[NUM_BINS];
56 };
57
58 } // namespace cc
59
60 #endif // CC_RESOURCES_PRIORITIZED_TILE_SET_H_
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling_unittest.cc ('k') | cc/resources/prioritized_tile_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698