| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 TreePriority tree_priority); | 52 TreePriority tree_priority); |
| 53 scoped_ptr<TilingSetRasterQueue> CreateRasterQueue(bool prioritize_low_res); | 53 scoped_ptr<TilingSetRasterQueue> CreateRasterQueue(bool prioritize_low_res); |
| 54 | 54 |
| 55 // LayerImpl overrides. | 55 // LayerImpl overrides. |
| 56 const char* LayerTypeAsString() const override; | 56 const char* LayerTypeAsString() const override; |
| 57 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 57 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 58 void PushPropertiesTo(LayerImpl* layer) override; | 58 void PushPropertiesTo(LayerImpl* layer) override; |
| 59 void AppendQuads(RenderPass* render_pass, | 59 void AppendQuads(RenderPass* render_pass, |
| 60 const Occlusion& occlusion_in_content_space, | 60 const Occlusion& occlusion_in_content_space, |
| 61 AppendQuadsData* append_quads_data) override; | 61 AppendQuadsData* append_quads_data) override; |
| 62 void UpdateTiles(const Occlusion& occlusion_in_content_space, | 62 bool UpdateTiles(const Occlusion& occlusion_in_content_space, |
| 63 bool resourceless_software_draw) override; | 63 bool resourceless_software_draw) override; |
| 64 void NotifyTileStateChanged(const Tile* tile) override; | 64 void NotifyTileStateChanged(const Tile* tile) override; |
| 65 void DidBecomeActive() override; | |
| 66 void DidBeginTracing() override; | 65 void DidBeginTracing() override; |
| 67 void ReleaseResources() override; | 66 void ReleaseResources() override; |
| 68 skia::RefPtr<SkPicture> GetPicture() override; | 67 skia::RefPtr<SkPicture> GetPicture() override; |
| 69 | 68 |
| 70 // PictureLayerTilingClient overrides. | 69 // PictureLayerTilingClient overrides. |
| 71 scoped_refptr<Tile> CreateTile(float contents_scale, | 70 scoped_refptr<Tile> CreateTile(float contents_scale, |
| 72 const gfx::Rect& content_rect) override; | 71 const gfx::Rect& content_rect) override; |
| 73 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; | 72 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; |
| 74 const Region* GetPendingInvalidation() override; | 73 const Region* GetPendingInvalidation() override; |
| 75 const PictureLayerTiling* GetPendingOrActiveTwinTiling( | 74 const PictureLayerTiling* GetPendingOrActiveTwinTiling( |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 RasterSource* GetRasterSource() const { return raster_source_.get(); } | 107 RasterSource* GetRasterSource() const { return raster_source_.get(); } |
| 109 | 108 |
| 110 protected: | 109 protected: |
| 111 friend class LayerRasterTileIterator; | 110 friend class LayerRasterTileIterator; |
| 112 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; | 111 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; |
| 113 | 112 |
| 114 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); | 113 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); |
| 115 PictureLayerTiling* AddTiling(float contents_scale); | 114 PictureLayerTiling* AddTiling(float contents_scale); |
| 116 void RemoveAllTilings(); | 115 void RemoveAllTilings(); |
| 117 void AddTilingsForRasterScale(); | 116 void AddTilingsForRasterScale(); |
| 118 void UpdateTilePriorities(const Occlusion& occlusion_in_content_space); | 117 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space); |
| 119 virtual bool ShouldAdjustRasterScale() const; | 118 virtual bool ShouldAdjustRasterScale() const; |
| 120 virtual void RecalculateRasterScales(); | 119 virtual void RecalculateRasterScales(); |
| 121 void CleanUpTilingsOnActiveLayer( | 120 void CleanUpTilingsOnActiveLayer( |
| 122 std::vector<PictureLayerTiling*> used_tilings); | 121 std::vector<PictureLayerTiling*> used_tilings); |
| 123 float MinimumContentsScale() const; | 122 float MinimumContentsScale() const; |
| 124 float MaximumContentsScale() const; | 123 float MaximumContentsScale() const; |
| 125 void ResetRasterScale(); | 124 void ResetRasterScale(); |
| 126 gfx::Rect GetViewportForTilePriorityInContentSpace() const; | 125 gfx::Rect GetViewportForTilePriorityInContentSpace() const; |
| 127 PictureLayerImpl* GetRecycledTwinLayer() const; | 126 PictureLayerImpl* GetRecycledTwinLayer() const; |
| 128 | 127 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // from regular draws. Save a copy of the required draw properties of the last | 176 // from regular draws. Save a copy of the required draw properties of the last |
| 178 // frame that has a valid viewport for prioritizing tiles. | 177 // frame that has a valid viewport for prioritizing tiles. |
| 179 gfx::Rect visible_rect_for_tile_priority_; | 178 gfx::Rect visible_rect_for_tile_priority_; |
| 180 | 179 |
| 181 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 180 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 182 }; | 181 }; |
| 183 | 182 |
| 184 } // namespace cc | 183 } // namespace cc |
| 185 | 184 |
| 186 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 185 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |