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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; | 108 using TileRequirementCheck = bool (PictureLayerTiling::*)(const Tile*) const; |
109 | 109 |
110 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); | 110 PictureLayerImpl(LayerTreeImpl* tree_impl, int id, bool is_mask); |
111 PictureLayerTiling* AddTiling(float contents_scale); | 111 PictureLayerTiling* AddTiling(float contents_scale); |
112 void RemoveAllTilings(); | 112 void RemoveAllTilings(); |
113 void AddTilingsForRasterScale(); | 113 void AddTilingsForRasterScale(); |
114 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space); | 114 bool UpdateTilePriorities(const Occlusion& occlusion_in_content_space); |
115 virtual bool ShouldAdjustRasterScale() const; | 115 virtual bool ShouldAdjustRasterScale() const; |
116 virtual void RecalculateRasterScales(); | 116 virtual void RecalculateRasterScales(); |
117 void CleanUpTilingsOnActiveLayer( | 117 void CleanUpTilingsOnActiveLayer( |
118 std::vector<PictureLayerTiling*> used_tilings); | 118 const std::vector<PictureLayerTiling*>& used_tilings); |
119 float MinimumContentsScale() const; | 119 float MinimumContentsScale() const; |
120 float MaximumContentsScale() const; | 120 float MaximumContentsScale() const; |
121 void ResetRasterScale(); | 121 void ResetRasterScale(); |
122 void UpdateViewportRectForTilePriorityInContentSpace(); | 122 void UpdateViewportRectForTilePriorityInContentSpace(); |
123 PictureLayerImpl* GetRecycledTwinLayer() const; | 123 PictureLayerImpl* GetRecycledTwinLayer() const; |
124 | 124 |
125 void SanityCheckTilingState() const; | 125 void SanityCheckTilingState() const; |
126 // Checks if all tiles required for a certain action (e.g. activation) are | 126 // Checks if all tiles required for a certain action (e.g. activation) are |
127 // ready to draw. is_tile_required_callback gets called on all candidate | 127 // ready to draw. is_tile_required_callback gets called on all candidate |
128 // tiles and returns true if the tile is required for the action. | 128 // tiles and returns true if the tile is required for the action. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 // Any draw properties derived from |transform|, |viewport|, and |clip| | 166 // Any draw properties derived from |transform|, |viewport|, and |clip| |
167 // parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid | 167 // parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid |
168 // for prioritizing tiles during resourceless software draws. This is because | 168 // for prioritizing tiles during resourceless software draws. This is because |
169 // resourceless software draws can have wildly different transforms/viewports | 169 // resourceless software draws can have wildly different transforms/viewports |
170 // from regular draws. Save a copy of the required draw properties of the last | 170 // from regular draws. Save a copy of the required draw properties of the last |
171 // frame that has a valid viewport for prioritizing tiles. | 171 // frame that has a valid viewport for prioritizing tiles. |
172 gfx::Rect visible_rect_for_tile_priority_; | 172 gfx::Rect visible_rect_for_tile_priority_; |
173 gfx::Rect viewport_rect_for_tile_priority_in_content_space_; | 173 gfx::Rect viewport_rect_for_tile_priority_in_content_space_; |
174 | 174 |
| 175 // List of tilings that were used last time we appended quads. This can be |
| 176 // used as an optimization not to remove tilings if they are still being |
| 177 // drawn. Note that accessing this vector should only be done in the context |
| 178 // of comparing pointers, since objects pointed to are not guaranteed to |
| 179 // exist. |
| 180 std::vector<PictureLayerTiling*> last_append_quads_tilings_; |
| 181 |
175 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 182 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
176 }; | 183 }; |
177 | 184 |
178 } // namespace cc | 185 } // namespace cc |
179 | 186 |
180 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 187 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |