| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 90 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
| 91 OVERRIDE; | 91 OVERRIDE; |
| 92 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 92 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
| 93 virtual void AppendQuads(QuadSink* quad_sink, | 93 virtual void AppendQuads(QuadSink* quad_sink, |
| 94 AppendQuadsData* append_quads_data) OVERRIDE; | 94 AppendQuadsData* append_quads_data) OVERRIDE; |
| 95 virtual void UpdateTilePriorities() OVERRIDE; | 95 virtual void UpdateTilePriorities() OVERRIDE; |
| 96 virtual void NotifyTileInitialized(const Tile* tile) OVERRIDE; | 96 virtual void NotifyTileInitialized(const Tile* tile) OVERRIDE; |
| 97 virtual void DidBecomeActive() OVERRIDE; | 97 virtual void DidBecomeActive() OVERRIDE; |
| 98 virtual void DidBeginTracing() OVERRIDE; | 98 virtual void DidBeginTracing() OVERRIDE; |
| 99 virtual void ReleaseResources() OVERRIDE; | 99 virtual void ReleaseResources() OVERRIDE; |
| 100 virtual void CalculateContentsScale(float ideal_contents_scale, | |
| 101 float device_scale_factor, | |
| 102 float page_scale_factor, | |
| 103 float maximum_animation_contents_scale, | |
| 104 bool animating_transform_to_screen, | |
| 105 float* contents_scale_x, | |
| 106 float* contents_scale_y, | |
| 107 gfx::Size* content_bounds) OVERRIDE; | |
| 108 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE; | 100 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE; |
| 109 | 101 |
| 110 // PictureLayerTilingClient overrides. | 102 // PictureLayerTilingClient overrides. |
| 111 virtual scoped_refptr<Tile> CreateTile( | 103 virtual scoped_refptr<Tile> CreateTile( |
| 112 PictureLayerTiling* tiling, | 104 PictureLayerTiling* tiling, |
| 113 const gfx::Rect& content_rect) OVERRIDE; | 105 const gfx::Rect& content_rect) OVERRIDE; |
| 114 virtual void UpdatePile(Tile* tile) OVERRIDE; | 106 virtual void UpdatePile(Tile* tile) OVERRIDE; |
| 115 virtual gfx::Size CalculateTileSize( | 107 virtual gfx::Size CalculateTileSize( |
| 116 const gfx::Size& content_bounds) const OVERRIDE; | 108 const gfx::Size& content_bounds) const OVERRIDE; |
| 117 virtual const Region* GetInvalidation() OVERRIDE; | 109 virtual const Region* GetInvalidation() OVERRIDE; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 135 bool use_gpu_rasterization() const { | 127 bool use_gpu_rasterization() const { |
| 136 return layer_tree_impl()->use_gpu_rasterization(); | 128 return layer_tree_impl()->use_gpu_rasterization(); |
| 137 } | 129 } |
| 138 | 130 |
| 139 // Functions used by tile manager. | 131 // Functions used by tile manager. |
| 140 void DidUnregisterLayer(); | 132 void DidUnregisterLayer(); |
| 141 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } | 133 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } |
| 142 WhichTree GetTree() const; | 134 WhichTree GetTree() const; |
| 143 bool IsOnActiveOrPendingTree() const; | 135 bool IsOnActiveOrPendingTree() const; |
| 144 | 136 |
| 137 float MaximumTilingContentScale() const; |
| 138 void PopulateSharedQuadStateWithOverrides( |
| 139 SharedQuadState* state, |
| 140 gfx::Transform target_space_transform, |
| 141 gfx::Size content_bounds, |
| 142 gfx::Rect visible_content_rect) const; |
| 143 |
| 145 protected: | 144 protected: |
| 146 friend class LayerRasterTileIterator; | 145 friend class LayerRasterTileIterator; |
| 147 | 146 |
| 148 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 147 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
| 149 PictureLayerTiling* AddTiling(float contents_scale); | 148 PictureLayerTiling* AddTiling(float contents_scale); |
| 150 void RemoveTiling(float contents_scale); | 149 void RemoveTiling(float contents_scale); |
| 151 void RemoveAllTilings(); | 150 void RemoveAllTilings(); |
| 152 void SyncFromActiveLayer(const PictureLayerImpl* other); | 151 void SyncFromActiveLayer(const PictureLayerImpl* other); |
| 153 void ManageTilings(bool animating_transform_to_screen, | 152 void ManageTilings(bool animating_transform_to_screen, |
| 154 float maximum_animation_contents_scale); | 153 float maximum_animation_contents_scale); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 176 void DoPostCommitInitializationIfNeeded() { | 175 void DoPostCommitInitializationIfNeeded() { |
| 177 if (needs_post_commit_initialization_) | 176 if (needs_post_commit_initialization_) |
| 178 DoPostCommitInitialization(); | 177 DoPostCommitInitialization(); |
| 179 } | 178 } |
| 180 void DoPostCommitInitialization(); | 179 void DoPostCommitInitialization(); |
| 181 | 180 |
| 182 bool CanHaveTilings() const; | 181 bool CanHaveTilings() const; |
| 183 bool CanHaveTilingWithScale(float contents_scale) const; | 182 bool CanHaveTilingWithScale(float contents_scale) const; |
| 184 void SanityCheckTilingState() const; | 183 void SanityCheckTilingState() const; |
| 185 | 184 |
| 185 void UpdateIdealScales(); |
| 186 |
| 186 virtual void GetDebugBorderProperties( | 187 virtual void GetDebugBorderProperties( |
| 187 SkColor* color, float* width) const OVERRIDE; | 188 SkColor* color, float* width) const OVERRIDE; |
| 188 virtual void AsValueInto(base::DictionaryValue* dict) const OVERRIDE; | 189 virtual void AsValueInto(base::DictionaryValue* dict) const OVERRIDE; |
| 189 | 190 |
| 190 PictureLayerImpl* twin_layer_; | 191 PictureLayerImpl* twin_layer_; |
| 191 | 192 |
| 192 scoped_ptr<PictureLayerTilingSet> tilings_; | 193 scoped_ptr<PictureLayerTilingSet> tilings_; |
| 193 scoped_refptr<PicturePileImpl> pile_; | 194 scoped_refptr<PicturePileImpl> pile_; |
| 194 Region invalidation_; | 195 Region invalidation_; |
| 195 | 196 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 223 gfx::Size viewport_size_for_tile_priority_; | 224 gfx::Size viewport_size_for_tile_priority_; |
| 224 gfx::Transform screen_space_transform_for_tile_priority_; | 225 gfx::Transform screen_space_transform_for_tile_priority_; |
| 225 | 226 |
| 226 friend class PictureLayer; | 227 friend class PictureLayer; |
| 227 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 228 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 228 }; | 229 }; |
| 229 | 230 |
| 230 } // namespace cc | 231 } // namespace cc |
| 231 | 232 |
| 232 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 233 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |