| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 67 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
| 68 virtual void AppendQuads(QuadSink* quad_sink, | 68 virtual void AppendQuads(QuadSink* quad_sink, |
| 69 AppendQuadsData* append_quads_data) OVERRIDE; | 69 AppendQuadsData* append_quads_data) OVERRIDE; |
| 70 virtual void UpdateTilePriorities() OVERRIDE; | 70 virtual void UpdateTilePriorities() OVERRIDE; |
| 71 virtual void DidBecomeActive() OVERRIDE; | 71 virtual void DidBecomeActive() OVERRIDE; |
| 72 virtual void DidBeginTracing() OVERRIDE; | 72 virtual void DidBeginTracing() OVERRIDE; |
| 73 virtual void ReleaseResources() OVERRIDE; | 73 virtual void ReleaseResources() OVERRIDE; |
| 74 virtual void CalculateContentsScale(float ideal_contents_scale, | 74 virtual void CalculateContentsScale(float ideal_contents_scale, |
| 75 float device_scale_factor, | 75 float device_scale_factor, |
| 76 float page_scale_factor, | 76 float page_scale_factor, |
| 77 float maximum_animation_scale_factor, |
| 77 bool animating_transform_to_screen, | 78 bool animating_transform_to_screen, |
| 78 float* contents_scale_x, | 79 float* contents_scale_x, |
| 79 float* contents_scale_y, | 80 float* contents_scale_y, |
| 80 gfx::Size* content_bounds) OVERRIDE; | 81 gfx::Size* content_bounds) OVERRIDE; |
| 81 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE; | 82 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE; |
| 82 | 83 |
| 83 // PictureLayerTilingClient overrides. | 84 // PictureLayerTilingClient overrides. |
| 84 virtual scoped_refptr<Tile> CreateTile( | 85 virtual scoped_refptr<Tile> CreateTile( |
| 85 PictureLayerTiling* tiling, | 86 PictureLayerTiling* tiling, |
| 86 const gfx::Rect& content_rect) OVERRIDE; | 87 const gfx::Rect& content_rect) OVERRIDE; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 115 bool IsOnActiveOrPendingTree() const; | 116 bool IsOnActiveOrPendingTree() const; |
| 116 | 117 |
| 117 protected: | 118 protected: |
| 118 friend class LayerRasterTileIterator; | 119 friend class LayerRasterTileIterator; |
| 119 | 120 |
| 120 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 121 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
| 121 PictureLayerTiling* AddTiling(float contents_scale); | 122 PictureLayerTiling* AddTiling(float contents_scale); |
| 122 void RemoveTiling(float contents_scale); | 123 void RemoveTiling(float contents_scale); |
| 123 void RemoveAllTilings(); | 124 void RemoveAllTilings(); |
| 124 void SyncFromActiveLayer(const PictureLayerImpl* other); | 125 void SyncFromActiveLayer(const PictureLayerImpl* other); |
| 125 void ManageTilings(bool animating_transform_to_screen); | 126 void ManageTilings(bool animating_transform_to_screen, |
| 127 float maximum_animation_scale_factor); |
| 126 bool ShouldHaveLowResTiling() const { | 128 bool ShouldHaveLowResTiling() const { |
| 127 return should_use_low_res_tiling_ && !ShouldUseGpuRasterization(); | 129 return should_use_low_res_tiling_ && !ShouldUseGpuRasterization(); |
| 128 } | 130 } |
| 129 virtual bool ShouldAdjustRasterScale( | 131 virtual bool ShouldAdjustRasterScale( |
| 130 bool animating_transform_to_screen) const; | 132 bool animating_transform_to_screen) const; |
| 131 virtual void RecalculateRasterScales( | 133 virtual void RecalculateRasterScales(bool animating_transform_to_screen, |
| 132 bool animating_transform_to_screen); | 134 float maximum_animation_scale_factor); |
| 133 void CleanUpTilingsOnActiveLayer( | 135 void CleanUpTilingsOnActiveLayer( |
| 134 std::vector<PictureLayerTiling*> used_tilings); | 136 std::vector<PictureLayerTiling*> used_tilings); |
| 135 float MinimumContentsScale() const; | 137 float MinimumContentsScale() const; |
| 136 float SnappedContentsScale(float new_contents_scale); | 138 float SnappedContentsScale(float new_contents_scale); |
| 137 void UpdateLCDTextStatus(bool new_status); | 139 void UpdateLCDTextStatus(bool new_status); |
| 138 void ResetRasterScale(); | 140 void ResetRasterScale(); |
| 139 void MarkVisibleResourcesAsRequired() const; | 141 void MarkVisibleResourcesAsRequired() const; |
| 140 bool MarkVisibleTilesAsRequired( | 142 bool MarkVisibleTilesAsRequired( |
| 141 PictureLayerTiling* tiling, | 143 PictureLayerTiling* tiling, |
| 142 const PictureLayerTiling* optional_twin_tiling, | 144 const PictureLayerTiling* optional_twin_tiling, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 190 |
| 189 bool layer_needs_to_register_itself_; | 191 bool layer_needs_to_register_itself_; |
| 190 | 192 |
| 191 friend class PictureLayer; | 193 friend class PictureLayer; |
| 192 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 194 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 193 }; | 195 }; |
| 194 | 196 |
| 195 } // namespace cc | 197 } // namespace cc |
| 196 | 198 |
| 197 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 199 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |