| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // Virtual for testing. | 101 // Virtual for testing. |
| 99 virtual bool HasValidTilePriorities() const; | 102 virtual bool HasValidTilePriorities() const; |
| 100 | 103 |
| 101 // Used for benchmarking | 104 // Used for benchmarking |
| 102 RasterSource* GetRasterSource() const { return raster_source_.get(); } | 105 RasterSource* GetRasterSource() const { return raster_source_.get(); } |
| 103 | 106 |
| 104 protected: | 107 protected: |
| 105 friend class LayerRasterTileIterator; | 108 friend class LayerRasterTileIterator; |
| 106 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; | 109 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; |
| 107 | 110 |
| 108 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); | 111 PictureLayerImpl(LayerTreeImpl* tree_impl, |
| 112 int id, |
| 113 bool is_mask, |
| 114 scoped_refptr<SyncedScrollOffset> scroll_offset); |
| 109 PictureLayerTiling* AddTiling(float contents_scale); | 115 PictureLayerTiling* AddTiling(float contents_scale); |
| 110 void RemoveAllTilings(); | 116 void RemoveAllTilings(); |
| 111 void AddTilingsForRasterScale(); | 117 void AddTilingsForRasterScale(); |
| 112 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space); | 118 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space); |
| 113 virtual bool ShouldAdjustRasterScale() const; | 119 virtual bool ShouldAdjustRasterScale() const; |
| 114 virtual void RecalculateRasterScales(); | 120 virtual void RecalculateRasterScales(); |
| 115 void CleanUpTilingsOnActiveLayer( | 121 void CleanUpTilingsOnActiveLayer( |
| 116 const std::vector<PictureLayerTiling*>& used_tilings); | 122 const std::vector<PictureLayerTiling*>& used_tilings); |
| 117 float MinimumContentsScale() const; | 123 float MinimumContentsScale() const; |
| 118 float MaximumContentsScale() const; | 124 float MaximumContentsScale() const; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // of comparing pointers, since objects pointed to are not guaranteed to | 176 // of comparing pointers, since objects pointed to are not guaranteed to |
| 171 // exist. | 177 // exist. |
| 172 std::vector<PictureLayerTiling*> last_append_quads_tilings_; | 178 std::vector<PictureLayerTiling*> last_append_quads_tilings_; |
| 173 | 179 |
| 174 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 180 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 175 }; | 181 }; |
| 176 | 182 |
| 177 } // namespace cc | 183 } // namespace cc |
| 178 | 184 |
| 179 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 185 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |