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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 AppendQuadsData* append_quads_data) override; | 61 AppendQuadsData* append_quads_data) override; |
62 void UpdateTiles(const Occlusion& occlusion_in_content_space, | 62 void 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; | 65 void DidBecomeActive() override; |
66 void DidBeginTracing() override; | 66 void DidBeginTracing() override; |
67 void ReleaseResources() override; | 67 void ReleaseResources() override; |
68 skia::RefPtr<SkPicture> GetPicture() override; | 68 skia::RefPtr<SkPicture> GetPicture() override; |
69 | 69 |
70 // PictureLayerTilingClient overrides. | 70 // PictureLayerTilingClient overrides. |
71 scoped_refptr<Tile> CreateTile(PictureLayerTiling* tiling, | 71 scoped_refptr<Tile> CreateTile(float contents_scale, |
72 const gfx::Rect& content_rect) override; | 72 const gfx::Rect& content_rect) override; |
73 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; | 73 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; |
74 const Region* GetPendingInvalidation() override; | 74 const Region* GetPendingInvalidation() override; |
75 const PictureLayerTiling* GetPendingOrActiveTwinTiling( | 75 const PictureLayerTiling* GetPendingOrActiveTwinTiling( |
76 const PictureLayerTiling* tiling) const override; | 76 const PictureLayerTiling* tiling) const override; |
77 PictureLayerTiling* GetRecycledTwinTiling( | 77 PictureLayerTiling* GetRecycledTwinTiling( |
78 const PictureLayerTiling* tiling) override; | 78 const PictureLayerTiling* tiling) override; |
79 TilePriority::PriorityBin GetMaxTilePriorityBin() const override; | 79 TilePriority::PriorityBin GetMaxTilePriorityBin() const override; |
80 WhichTree GetTree() const override; | 80 WhichTree GetTree() const override; |
81 bool RequiresHighResToDraw() const override; | 81 bool RequiresHighResToDraw() const override; |
(...skipping 16 matching lines...) Expand all Loading... |
98 | 98 |
99 // Functions used by tile manager. | 99 // Functions used by tile manager. |
100 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; | 100 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; |
101 bool IsOnActiveOrPendingTree() const; | 101 bool IsOnActiveOrPendingTree() const; |
102 // Virtual for testing. | 102 // Virtual for testing. |
103 virtual bool HasValidTilePriorities() const; | 103 virtual bool HasValidTilePriorities() const; |
104 bool AllTilesRequiredForActivationAreReadyToDraw() const; | 104 bool AllTilesRequiredForActivationAreReadyToDraw() const; |
105 bool AllTilesRequiredForDrawAreReadyToDraw() const; | 105 bool AllTilesRequiredForDrawAreReadyToDraw() const; |
106 | 106 |
107 // Used for benchmarking | 107 // Used for benchmarking |
108 const RasterSource* GetRasterSource() const { return raster_source_.get(); } | 108 RasterSource* GetRasterSource() const { return raster_source_.get(); } |
109 | 109 |
110 protected: | 110 protected: |
111 friend class LayerRasterTileIterator; | 111 friend class LayerRasterTileIterator; |
112 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; | 112 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; |
113 | 113 |
114 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); | 114 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); |
115 PictureLayerTiling* AddTiling(float contents_scale); | 115 PictureLayerTiling* AddTiling(float contents_scale); |
116 void RemoveAllTilings(); | 116 void RemoveAllTilings(); |
117 void AddTilingsForRasterScale(); | 117 void AddTilingsForRasterScale(); |
118 void UpdateTilePriorities(const Occlusion& occlusion_in_content_space); | 118 void UpdateTilePriorities(const Occlusion& occlusion_in_content_space); |
(...skipping 58 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 | 177 // from regular draws. Save a copy of the required draw properties of the last |
178 // frame that has a valid viewport for prioritizing tiles. | 178 // frame that has a valid viewport for prioritizing tiles. |
179 gfx::Rect visible_rect_for_tile_priority_; | 179 gfx::Rect visible_rect_for_tile_priority_; |
180 | 180 |
181 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 181 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
182 }; | 182 }; |
183 | 183 |
184 } // namespace cc | 184 } // namespace cc |
185 | 185 |
186 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 186 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |