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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 bool resourceless_software_draw) override; | 112 bool resourceless_software_draw) override; |
113 void NotifyTileStateChanged(const Tile* tile) override; | 113 void NotifyTileStateChanged(const Tile* tile) override; |
114 void DidBecomeActive() override; | 114 void DidBecomeActive() override; |
115 void DidBeginTracing() override; | 115 void DidBeginTracing() override; |
116 void ReleaseResources() override; | 116 void ReleaseResources() override; |
117 skia::RefPtr<SkPicture> GetPicture() override; | 117 skia::RefPtr<SkPicture> GetPicture() override; |
118 | 118 |
119 // PictureLayerTilingClient overrides. | 119 // PictureLayerTilingClient overrides. |
120 scoped_refptr<Tile> CreateTile(PictureLayerTiling* tiling, | 120 scoped_refptr<Tile> CreateTile(PictureLayerTiling* tiling, |
121 const gfx::Rect& content_rect) override; | 121 const gfx::Rect& content_rect) override; |
122 RasterSource* GetRasterSource() override; | |
123 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; | 122 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; |
124 const Region* GetPendingInvalidation() override; | 123 const Region* GetPendingInvalidation() override; |
125 const PictureLayerTiling* GetPendingOrActiveTwinTiling( | 124 const PictureLayerTiling* GetPendingOrActiveTwinTiling( |
126 const PictureLayerTiling* tiling) const override; | 125 const PictureLayerTiling* tiling) const override; |
127 PictureLayerTiling* GetRecycledTwinTiling( | 126 PictureLayerTiling* GetRecycledTwinTiling( |
128 const PictureLayerTiling* tiling) override; | 127 const PictureLayerTiling* tiling) override; |
129 TilePriority::PriorityBin GetMaxTilePriorityBin() const override; | 128 TilePriority::PriorityBin GetMaxTilePriorityBin() const override; |
130 size_t GetMaxTilesForInterestArea() const override; | 129 size_t GetMaxTilesForInterestArea() const override; |
131 float GetSkewportTargetTimeInSeconds() const override; | 130 float GetSkewportTargetTimeInSeconds() const override; |
132 int GetSkewportExtrapolationLimitInContentPixels() const override; | 131 int GetSkewportExtrapolationLimitInContentPixels() const override; |
133 WhichTree GetTree() const override; | 132 WhichTree GetTree() const override; |
134 bool RequiresHighResToDraw() const override; | 133 bool RequiresHighResToDraw() const override; |
135 | 134 |
136 // PushPropertiesTo active tree => pending tree. | 135 // PushPropertiesTo active tree => pending tree. |
137 void SyncTiling(const PictureLayerTiling* tiling); | 136 void SyncTiling(const PictureLayerTiling* tiling); |
138 | 137 |
139 // Mask-related functions. | 138 // Mask-related functions. |
140 void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, | 139 void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, |
141 gfx::Size* resource_size) const override; | 140 gfx::Size* resource_size) const override; |
| 141 void set_is_mask(bool is_mask) { is_mask_ = is_mask; } |
142 | 142 |
143 size_t GPUMemoryUsageInBytes() const override; | 143 size_t GPUMemoryUsageInBytes() const override; |
144 | 144 |
145 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; | 145 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; |
146 | 146 |
147 // Functions used by tile manager. | 147 // Functions used by tile manager. |
148 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; | 148 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; |
149 bool IsOnActiveOrPendingTree() const; | 149 bool IsOnActiveOrPendingTree() const; |
150 // Virtual for testing. | 150 // Virtual for testing. |
151 virtual bool HasValidTilePriorities() const; | 151 virtual bool HasValidTilePriorities() const; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 float raster_contents_scale_; | 215 float raster_contents_scale_; |
216 float low_res_raster_contents_scale_; | 216 float low_res_raster_contents_scale_; |
217 | 217 |
218 bool raster_source_scale_is_fixed_; | 218 bool raster_source_scale_is_fixed_; |
219 bool was_screen_space_transform_animating_; | 219 bool was_screen_space_transform_animating_; |
220 bool needs_post_commit_initialization_; | 220 bool needs_post_commit_initialization_; |
221 // A sanity state check to make sure UpdateTilePriorities only gets called | 221 // A sanity state check to make sure UpdateTilePriorities only gets called |
222 // after a CalculateContentsScale/ManageTilings. | 222 // after a CalculateContentsScale/ManageTilings. |
223 bool should_update_tile_priorities_; | 223 bool should_update_tile_priorities_; |
224 bool only_used_low_res_last_append_quads_; | 224 bool only_used_low_res_last_append_quads_; |
| 225 bool is_mask_; |
225 | 226 |
226 // Any draw properties derived from |transform|, |viewport|, and |clip| | 227 // Any draw properties derived from |transform|, |viewport|, and |clip| |
227 // parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid | 228 // parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid |
228 // for prioritizing tiles during resourceless software draws. This is because | 229 // for prioritizing tiles during resourceless software draws. This is because |
229 // resourceless software draws can have wildly different transforms/viewports | 230 // resourceless software draws can have wildly different transforms/viewports |
230 // from regular draws. Save a copy of the required draw properties of the last | 231 // from regular draws. Save a copy of the required draw properties of the last |
231 // frame that has a valid viewport for prioritizing tiles. | 232 // frame that has a valid viewport for prioritizing tiles. |
232 gfx::Rect visible_rect_for_tile_priority_; | 233 gfx::Rect visible_rect_for_tile_priority_; |
233 | 234 |
234 friend class PictureLayer; | 235 friend class PictureLayer; |
235 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 236 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
236 }; | 237 }; |
237 | 238 |
238 } // namespace cc | 239 } // namespace cc |
239 | 240 |
240 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 241 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |