| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 size_t current_tiling_; | 95 size_t current_tiling_; |
| 96 PictureLayerTiling::TilingEvictionTileIterator current_iterator_; | 96 PictureLayerTiling::TilingEvictionTileIterator current_iterator_; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, int id) { | 99 static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, int id) { |
| 100 return make_scoped_ptr(new PictureLayerImpl(tree_impl, id)); | 100 return make_scoped_ptr(new PictureLayerImpl(tree_impl, id)); |
| 101 } | 101 } |
| 102 virtual ~PictureLayerImpl(); | 102 virtual ~PictureLayerImpl(); |
| 103 | 103 |
| 104 // LayerImpl overrides. | 104 // LayerImpl overrides. |
| 105 virtual const char* LayerTypeAsString() const OVERRIDE; | 105 virtual const char* LayerTypeAsString() const override; |
| 106 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 106 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
| 107 OVERRIDE; | 107 override; |
| 108 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 108 virtual void PushPropertiesTo(LayerImpl* layer) override; |
| 109 virtual void AppendQuads(RenderPass* render_pass, | 109 virtual void AppendQuads(RenderPass* render_pass, |
| 110 const OcclusionTracker<LayerImpl>& occlusion_tracker, | 110 const OcclusionTracker<LayerImpl>& occlusion_tracker, |
| 111 AppendQuadsData* append_quads_data) OVERRIDE; | 111 AppendQuadsData* append_quads_data) override; |
| 112 virtual void UpdateTiles(const Occlusion& occlusion_in_content_space, | 112 virtual void UpdateTiles(const Occlusion& occlusion_in_content_space, |
| 113 bool resourceless_software_draw) OVERRIDE; | 113 bool resourceless_software_draw) override; |
| 114 virtual void NotifyTileStateChanged(const Tile* tile) OVERRIDE; | 114 virtual void NotifyTileStateChanged(const Tile* tile) override; |
| 115 virtual void DidBecomeActive() OVERRIDE; | 115 virtual void DidBecomeActive() override; |
| 116 virtual void DidBeginTracing() OVERRIDE; | 116 virtual void DidBeginTracing() override; |
| 117 virtual void ReleaseResources() OVERRIDE; | 117 virtual void ReleaseResources() override; |
| 118 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE; | 118 virtual skia::RefPtr<SkPicture> GetPicture() override; |
| 119 | 119 |
| 120 // PictureLayerTilingClient overrides. | 120 // PictureLayerTilingClient overrides. |
| 121 virtual scoped_refptr<Tile> CreateTile( | 121 virtual scoped_refptr<Tile> CreateTile( |
| 122 PictureLayerTiling* tiling, | 122 PictureLayerTiling* tiling, |
| 123 const gfx::Rect& content_rect) OVERRIDE; | 123 const gfx::Rect& content_rect) override; |
| 124 virtual PicturePileImpl* GetPile() OVERRIDE; | 124 virtual PicturePileImpl* GetPile() override; |
| 125 virtual gfx::Size CalculateTileSize( | 125 virtual gfx::Size CalculateTileSize( |
| 126 const gfx::Size& content_bounds) const OVERRIDE; | 126 const gfx::Size& content_bounds) const override; |
| 127 virtual const Region* GetInvalidation() OVERRIDE; | 127 virtual const Region* GetInvalidation() override; |
| 128 virtual const PictureLayerTiling* GetTwinTiling( | 128 virtual const PictureLayerTiling* GetTwinTiling( |
| 129 const PictureLayerTiling* tiling) const OVERRIDE; | 129 const PictureLayerTiling* tiling) const override; |
| 130 virtual PictureLayerTiling* GetRecycledTwinTiling( | 130 virtual PictureLayerTiling* GetRecycledTwinTiling( |
| 131 const PictureLayerTiling* tiling) OVERRIDE; | 131 const PictureLayerTiling* tiling) override; |
| 132 virtual size_t GetMaxTilesForInterestArea() const OVERRIDE; | 132 virtual size_t GetMaxTilesForInterestArea() const override; |
| 133 virtual float GetSkewportTargetTimeInSeconds() const OVERRIDE; | 133 virtual float GetSkewportTargetTimeInSeconds() const override; |
| 134 virtual int GetSkewportExtrapolationLimitInContentPixels() const OVERRIDE; | 134 virtual int GetSkewportExtrapolationLimitInContentPixels() const override; |
| 135 virtual WhichTree GetTree() const OVERRIDE; | 135 virtual WhichTree GetTree() const override; |
| 136 | 136 |
| 137 // PushPropertiesTo active tree => pending tree. | 137 // PushPropertiesTo active tree => pending tree. |
| 138 void SyncTiling(const PictureLayerTiling* tiling); | 138 void SyncTiling(const PictureLayerTiling* tiling); |
| 139 | 139 |
| 140 // Mask-related functions. | 140 // Mask-related functions. |
| 141 virtual ResourceProvider::ResourceId ContentsResourceId() const OVERRIDE; | 141 virtual ResourceProvider::ResourceId ContentsResourceId() const override; |
| 142 | 142 |
| 143 virtual size_t GPUMemoryUsageInBytes() const OVERRIDE; | 143 virtual size_t GPUMemoryUsageInBytes() const override; |
| 144 | 144 |
| 145 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; | 145 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; |
| 146 | 146 |
| 147 // Functions used by tile manager. | 147 // Functions used by tile manager. |
| 148 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } | 148 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } |
| 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; |
| 152 bool AllTilesRequiredForActivationAreReadyToDraw() const; | 152 bool AllTilesRequiredForActivationAreReadyToDraw() const; |
| 153 | 153 |
| 154 protected: | 154 protected: |
| 155 friend class LayerRasterTileIterator; | 155 friend class LayerRasterTileIterator; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 183 } | 183 } |
| 184 void DoPostCommitInitialization(); | 184 void DoPostCommitInitialization(); |
| 185 | 185 |
| 186 bool CanHaveTilings() const; | 186 bool CanHaveTilings() const; |
| 187 bool CanHaveTilingWithScale(float contents_scale) const; | 187 bool CanHaveTilingWithScale(float contents_scale) const; |
| 188 void SanityCheckTilingState() const; | 188 void SanityCheckTilingState() const; |
| 189 | 189 |
| 190 bool ShouldAdjustRasterScaleDuringScaleAnimations() const; | 190 bool ShouldAdjustRasterScaleDuringScaleAnimations() const; |
| 191 | 191 |
| 192 virtual void GetDebugBorderProperties( | 192 virtual void GetDebugBorderProperties( |
| 193 SkColor* color, float* width) const OVERRIDE; | 193 SkColor* color, float* width) const override; |
| 194 virtual void GetAllTilesForTracing( | 194 virtual void GetAllTilesForTracing( |
| 195 std::set<const Tile*>* tiles) const OVERRIDE; | 195 std::set<const Tile*>* tiles) const override; |
| 196 virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE; | 196 virtual void AsValueInto(base::debug::TracedValue* dict) const override; |
| 197 | 197 |
| 198 virtual void UpdateIdealScales(); | 198 virtual void UpdateIdealScales(); |
| 199 float MaximumTilingContentsScale() const; | 199 float MaximumTilingContentsScale() const; |
| 200 | 200 |
| 201 PictureLayerImpl* twin_layer_; | 201 PictureLayerImpl* twin_layer_; |
| 202 | 202 |
| 203 scoped_ptr<PictureLayerTilingSet> tilings_; | 203 scoped_ptr<PictureLayerTilingSet> tilings_; |
| 204 scoped_refptr<PicturePileImpl> pile_; | 204 scoped_refptr<PicturePileImpl> pile_; |
| 205 Region invalidation_; | 205 Region invalidation_; |
| 206 | 206 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 228 gfx::Rect viewport_rect_for_tile_priority_; | 228 gfx::Rect viewport_rect_for_tile_priority_; |
| 229 gfx::Transform screen_space_transform_for_tile_priority_; | 229 gfx::Transform screen_space_transform_for_tile_priority_; |
| 230 | 230 |
| 231 friend class PictureLayer; | 231 friend class PictureLayer; |
| 232 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 232 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 } // namespace cc | 235 } // namespace cc |
| 236 | 236 |
| 237 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 237 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |