OLD | NEW |
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> |
(...skipping 20 matching lines...) Expand all Loading... |
31 public: | 31 public: |
32 struct CC_EXPORT Pair { | 32 struct CC_EXPORT Pair { |
33 Pair(); | 33 Pair(); |
34 Pair(PictureLayerImpl* active_layer, PictureLayerImpl* pending_layer); | 34 Pair(PictureLayerImpl* active_layer, PictureLayerImpl* pending_layer); |
35 ~Pair(); | 35 ~Pair(); |
36 | 36 |
37 PictureLayerImpl* active; | 37 PictureLayerImpl* active; |
38 PictureLayerImpl* pending; | 38 PictureLayerImpl* pending; |
39 }; | 39 }; |
40 | 40 |
41 static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, | 41 static scoped_ptr<PictureLayerImpl> Create( |
42 int id, | 42 LayerTreeImpl* tree_impl, |
43 bool is_mask) { | 43 int id, |
44 return make_scoped_ptr(new PictureLayerImpl(tree_impl, id, is_mask)); | 44 bool is_mask, |
| 45 scoped_refptr<SyncedScrollOffset> scroll_offset) { |
| 46 return make_scoped_ptr( |
| 47 new PictureLayerImpl(tree_impl, id, is_mask, scroll_offset)); |
45 } | 48 } |
46 ~PictureLayerImpl() override; | 49 ~PictureLayerImpl() override; |
47 | 50 |
48 bool is_mask() const { return is_mask_; } | 51 bool is_mask() const { return is_mask_; } |
49 | 52 |
50 // LayerImpl overrides. | 53 // LayerImpl overrides. |
51 const char* LayerTypeAsString() const override; | 54 const char* LayerTypeAsString() const override; |
52 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 55 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
53 void PushPropertiesTo(LayerImpl* layer) override; | 56 void PushPropertiesTo(LayerImpl* layer) override; |
54 void AppendQuads(RenderPass* render_pass, | 57 void AppendQuads(RenderPass* render_pass, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // Virtual for testing. | 102 // Virtual for testing. |
100 virtual bool HasValidTilePriorities() const; | 103 virtual bool HasValidTilePriorities() const; |
101 | 104 |
102 // Used for benchmarking | 105 // Used for benchmarking |
103 RasterSource* GetRasterSource() const { return raster_source_.get(); } | 106 RasterSource* GetRasterSource() const { return raster_source_.get(); } |
104 | 107 |
105 protected: | 108 protected: |
106 friend class LayerRasterTileIterator; | 109 friend class LayerRasterTileIterator; |
107 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; | 110 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; |
108 | 111 |
109 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); | 112 PictureLayerImpl(LayerTreeImpl* tree_impl, |
| 113 int id, |
| 114 bool is_mask, |
| 115 scoped_refptr<SyncedScrollOffset> scroll_offset); |
110 PictureLayerTiling* AddTiling(float contents_scale); | 116 PictureLayerTiling* AddTiling(float contents_scale); |
111 void RemoveAllTilings(); | 117 void RemoveAllTilings(); |
112 void AddTilingsForRasterScale(); | 118 void AddTilingsForRasterScale(); |
113 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space); | 119 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space); |
114 virtual bool ShouldAdjustRasterScale() const; | 120 virtual bool ShouldAdjustRasterScale() const; |
115 virtual void RecalculateRasterScales(); | 121 virtual void RecalculateRasterScales(); |
116 void CleanUpTilingsOnActiveLayer( | 122 void CleanUpTilingsOnActiveLayer( |
117 const std::vector<PictureLayerTiling*>& used_tilings); | 123 const std::vector<PictureLayerTiling*>& used_tilings); |
118 float MinimumContentsScale() const; | 124 float MinimumContentsScale() const; |
119 float MaximumContentsScale() const; | 125 float MaximumContentsScale() const; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // of comparing pointers, since objects pointed to are not guaranteed to | 177 // of comparing pointers, since objects pointed to are not guaranteed to |
172 // exist. | 178 // exist. |
173 std::vector<PictureLayerTiling*> last_append_quads_tilings_; | 179 std::vector<PictureLayerTiling*> last_append_quads_tilings_; |
174 | 180 |
175 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 181 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
176 }; | 182 }; |
177 | 183 |
178 } // namespace cc | 184 } // namespace cc |
179 | 185 |
180 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 186 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |