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

Side by Side Diff: cc/layers/picture_layer_impl.h

Issue 741683003: cc: Move LayerEvictionTileIterator to a separate file and make it a queue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years 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 | « cc/cc.gyp ('k') | cc/layers/picture_layer_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_LAYERS_PICTURE_LAYER_IMPL_H_ 5 #ifndef CC_LAYERS_PICTURE_LAYER_IMPL_H_
6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_ 6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
13 #include "cc/base/scoped_ptr_vector.h" 13 #include "cc/base/scoped_ptr_vector.h"
14 #include "cc/layers/layer_impl.h" 14 #include "cc/layers/layer_impl.h"
15 #include "cc/resources/picture_layer_tiling.h" 15 #include "cc/resources/picture_layer_tiling.h"
16 #include "cc/resources/picture_layer_tiling_set.h" 16 #include "cc/resources/picture_layer_tiling_set.h"
17 #include "cc/resources/picture_pile_impl.h" 17 #include "cc/resources/picture_pile_impl.h"
18 #include "cc/resources/tiling_set_eviction_queue.h"
18 #include "skia/ext/refptr.h" 19 #include "skia/ext/refptr.h"
19 #include "third_party/skia/include/core/SkPicture.h" 20 #include "third_party/skia/include/core/SkPicture.h"
20 21
21 namespace cc { 22 namespace cc {
22 23
23 struct AppendQuadsData; 24 struct AppendQuadsData;
24 class MicroBenchmarkImpl; 25 class MicroBenchmarkImpl;
25 class Tile; 26 class Tile;
26 27
27 class CC_EXPORT PictureLayerImpl 28 class CC_EXPORT PictureLayerImpl
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 TilePriority::PriorityBin tile_type; 61 TilePriority::PriorityBin tile_type;
61 }; 62 };
62 63
63 size_t current_stage_; 64 size_t current_stage_;
64 65
65 // One low res stage, and three high res stages. 66 // One low res stage, and three high res stages.
66 IterationStage stages_[4]; 67 IterationStage stages_[4];
67 PictureLayerTiling::TilingRasterTileIterator iterators_[NUM_ITERATORS]; 68 PictureLayerTiling::TilingRasterTileIterator iterators_[NUM_ITERATORS];
68 }; 69 };
69 70
70 class CC_EXPORT LayerEvictionTileIterator {
71 public:
72 LayerEvictionTileIterator();
73 LayerEvictionTileIterator(PictureLayerImpl* layer,
74 TreePriority tree_priority);
75 ~LayerEvictionTileIterator();
76
77 Tile* operator*();
78 const Tile* operator*() const;
79 LayerEvictionTileIterator& operator++();
80 operator bool() const;
81
82 private:
83 bool AdvanceToNextCategory();
84 bool AdvanceToNextTilingRangeType();
85 bool AdvanceToNextTiling();
86
87 PictureLayerTilingSet::TilingRange CurrentTilingRange() const;
88 size_t CurrentTilingIndex() const;
89
90 PictureLayerImpl* layer_;
91 TreePriority tree_priority_;
92
93 PictureLayerTiling::EvictionCategory current_category_;
94 PictureLayerTilingSet::TilingRangeType current_tiling_range_type_;
95 size_t current_tiling_;
96 PictureLayerTiling::TilingEvictionTileIterator current_iterator_;
97 };
98
99 static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, int id) { 71 static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
100 return make_scoped_ptr(new PictureLayerImpl(tree_impl, id)); 72 return make_scoped_ptr(new PictureLayerImpl(tree_impl, id));
101 } 73 }
102 ~PictureLayerImpl() override; 74 ~PictureLayerImpl() override;
103 75
76 scoped_ptr<TilingSetEvictionQueue> CreateEvictionQueue(
77 TreePriority tree_priority);
78
104 // LayerImpl overrides. 79 // LayerImpl overrides.
105 const char* LayerTypeAsString() const override; 80 const char* LayerTypeAsString() const override;
106 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; 81 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
107 void PushPropertiesTo(LayerImpl* layer) override; 82 void PushPropertiesTo(LayerImpl* layer) override;
108 void AppendQuads(RenderPass* render_pass, 83 void AppendQuads(RenderPass* render_pass,
109 const Occlusion& occlusion_in_content_space, 84 const Occlusion& occlusion_in_content_space,
110 AppendQuadsData* append_quads_data) override; 85 AppendQuadsData* append_quads_data) override;
111 void UpdateTiles(const Occlusion& occlusion_in_content_space, 86 void UpdateTiles(const Occlusion& occlusion_in_content_space,
112 bool resourceless_software_draw) override; 87 bool resourceless_software_draw) override;
113 void NotifyTileStateChanged(const Tile* tile) override; 88 void NotifyTileStateChanged(const Tile* tile) override;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // frame that has a valid viewport for prioritizing tiles. 206 // frame that has a valid viewport for prioritizing tiles.
232 gfx::Rect visible_rect_for_tile_priority_; 207 gfx::Rect visible_rect_for_tile_priority_;
233 208
234 friend class PictureLayer; 209 friend class PictureLayer;
235 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); 210 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
236 }; 211 };
237 212
238 } // namespace cc 213 } // namespace cc
239 214
240 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ 215 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698