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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 const gfx::Rect& content_rect) OVERRIDE; | 105 const gfx::Rect& content_rect) OVERRIDE; |
106 virtual PicturePileImpl* GetPile() OVERRIDE; | 106 virtual PicturePileImpl* GetPile() OVERRIDE; |
107 virtual gfx::Size CalculateTileSize( | 107 virtual gfx::Size CalculateTileSize( |
108 const gfx::Size& content_bounds) const OVERRIDE; | 108 const gfx::Size& content_bounds) const OVERRIDE; |
109 virtual const Region* GetInvalidation() OVERRIDE; | 109 virtual const Region* GetInvalidation() OVERRIDE; |
110 virtual const PictureLayerTiling* GetTwinTiling( | 110 virtual const PictureLayerTiling* GetTwinTiling( |
111 const PictureLayerTiling* tiling) const OVERRIDE; | 111 const PictureLayerTiling* tiling) const OVERRIDE; |
112 virtual size_t GetMaxTilesForInterestArea() const OVERRIDE; | 112 virtual size_t GetMaxTilesForInterestArea() const OVERRIDE; |
113 virtual float GetSkewportTargetTimeInSeconds() const OVERRIDE; | 113 virtual float GetSkewportTargetTimeInSeconds() const OVERRIDE; |
114 virtual int GetSkewportExtrapolationLimitInContentPixels() const OVERRIDE; | 114 virtual int GetSkewportExtrapolationLimitInContentPixels() const OVERRIDE; |
115 virtual WhichTree GetTree() const OVERRIDE; | |
116 virtual bool RequiresHighResToDraw() const OVERRIDE; | |
vmpstr
2014/07/02 23:51:29
This is here for detecting when to mark tiles requ
enne (OOO)
2014/07/07 19:41:59
I think this name is fine.
| |
115 | 117 |
116 // PushPropertiesTo active tree => pending tree. | 118 // PushPropertiesTo active tree => pending tree. |
117 void SyncTiling(const PictureLayerTiling* tiling); | 119 void SyncTiling(const PictureLayerTiling* tiling); |
118 | 120 |
119 // Mask-related functions | 121 // Mask-related functions |
120 void SetIsMask(bool is_mask); | 122 void SetIsMask(bool is_mask); |
121 virtual ResourceProvider::ResourceId ContentsResourceId() const OVERRIDE; | 123 virtual ResourceProvider::ResourceId ContentsResourceId() const OVERRIDE; |
122 | 124 |
123 virtual size_t GPUMemoryUsageInBytes() const OVERRIDE; | 125 virtual size_t GPUMemoryUsageInBytes() const OVERRIDE; |
124 | 126 |
125 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; | 127 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; |
126 | 128 |
127 // Functions used by tile manager. | 129 // Functions used by tile manager. |
128 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } | 130 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } |
129 WhichTree GetTree() const; | |
130 bool IsOnActiveOrPendingTree() const; | 131 bool IsOnActiveOrPendingTree() const; |
131 bool HasValidTilePriorities() const; | 132 bool HasValidTilePriorities() const; |
132 bool AllTilesRequiredForActivationAreReadyToDraw() const; | 133 bool AllTilesRequiredForActivationAreReadyToDraw() const; |
133 | 134 |
134 protected: | 135 protected: |
135 friend class LayerRasterTileIterator; | 136 friend class LayerRasterTileIterator; |
136 | 137 |
137 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 138 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
138 PictureLayerTiling* AddTiling(float contents_scale); | 139 PictureLayerTiling* AddTiling(float contents_scale); |
139 void RemoveTiling(float contents_scale); | 140 void RemoveTiling(float contents_scale); |
140 void RemoveAllTilings(); | 141 void RemoveAllTilings(); |
141 void SyncFromActiveLayer(const PictureLayerImpl* other); | 142 void SyncFromActiveLayer(const PictureLayerImpl* other); |
142 void AddTilingsForRasterScale(); | 143 void AddTilingsForRasterScale(); |
143 void UpdateTilePriorities( | 144 void UpdateTilePriorities( |
144 const OcclusionTracker<LayerImpl>* occlusion_tracker); | 145 const OcclusionTracker<LayerImpl>* occlusion_tracker); |
145 virtual bool ShouldAdjustRasterScale() const; | 146 virtual bool ShouldAdjustRasterScale() const; |
146 virtual void RecalculateRasterScales(); | 147 virtual void RecalculateRasterScales(); |
147 void CleanUpTilingsOnActiveLayer( | 148 void CleanUpTilingsOnActiveLayer( |
148 std::vector<PictureLayerTiling*> used_tilings); | 149 std::vector<PictureLayerTiling*> used_tilings); |
149 float MinimumContentsScale() const; | 150 float MinimumContentsScale() const; |
150 float SnappedContentsScale(float new_contents_scale); | 151 float SnappedContentsScale(float new_contents_scale); |
151 void ResetRasterScale(); | 152 void ResetRasterScale(); |
152 void MarkVisibleResourcesAsRequired() const; | |
153 bool MarkVisibleTilesAsRequired( | |
154 PictureLayerTiling* tiling, | |
155 const PictureLayerTiling* optional_twin_tiling, | |
156 float contents_scale, | |
157 const gfx::Rect& rect, | |
158 const Region& missing_region) const; | |
159 | 153 |
160 void DoPostCommitInitializationIfNeeded() { | 154 void DoPostCommitInitializationIfNeeded() { |
161 if (needs_post_commit_initialization_) | 155 if (needs_post_commit_initialization_) |
162 DoPostCommitInitialization(); | 156 DoPostCommitInitialization(); |
163 } | 157 } |
164 void DoPostCommitInitialization(); | 158 void DoPostCommitInitialization(); |
165 | 159 |
166 bool CanHaveTilings() const; | 160 bool CanHaveTilings() const; |
167 bool CanHaveTilingWithScale(float contents_scale) const; | 161 bool CanHaveTilingWithScale(float contents_scale) const; |
168 void SanityCheckTilingState() const; | 162 void SanityCheckTilingState() const; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 gfx::Size viewport_size_for_tile_priority_; | 200 gfx::Size viewport_size_for_tile_priority_; |
207 gfx::Transform screen_space_transform_for_tile_priority_; | 201 gfx::Transform screen_space_transform_for_tile_priority_; |
208 | 202 |
209 friend class PictureLayer; | 203 friend class PictureLayer; |
210 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 204 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
211 }; | 205 }; |
212 | 206 |
213 } // namespace cc | 207 } // namespace cc |
214 | 208 |
215 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 209 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |