Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: cc/layers/picture_layer_impl.h

Issue 226283004: Rasterize at maximum scale for scale animations on CPU-rasterized layers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
90 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; 90 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
91 virtual void AppendQuads(QuadSink* quad_sink, 91 virtual void AppendQuads(QuadSink* quad_sink,
92 AppendQuadsData* append_quads_data) OVERRIDE; 92 AppendQuadsData* append_quads_data) OVERRIDE;
93 virtual void UpdateTilePriorities() OVERRIDE; 93 virtual void UpdateTilePriorities() OVERRIDE;
94 virtual void DidBecomeActive() OVERRIDE; 94 virtual void DidBecomeActive() OVERRIDE;
95 virtual void DidBeginTracing() OVERRIDE; 95 virtual void DidBeginTracing() OVERRIDE;
96 virtual void ReleaseResources() OVERRIDE; 96 virtual void ReleaseResources() OVERRIDE;
97 virtual void CalculateContentsScale(float ideal_contents_scale, 97 virtual void CalculateContentsScale(float ideal_contents_scale,
98 float device_scale_factor, 98 float device_scale_factor,
99 float page_scale_factor, 99 float page_scale_factor,
100 float maximum_animation_scale_factor,
100 bool animating_transform_to_screen, 101 bool animating_transform_to_screen,
101 float* contents_scale_x, 102 float* contents_scale_x,
102 float* contents_scale_y, 103 float* contents_scale_y,
103 gfx::Size* content_bounds) OVERRIDE; 104 gfx::Size* content_bounds) OVERRIDE;
104 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE; 105 virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE;
105 106
106 // PictureLayerTilingClient overrides. 107 // PictureLayerTilingClient overrides.
107 virtual scoped_refptr<Tile> CreateTile( 108 virtual scoped_refptr<Tile> CreateTile(
108 PictureLayerTiling* tiling, 109 PictureLayerTiling* tiling,
109 const gfx::Rect& content_rect) OVERRIDE; 110 const gfx::Rect& content_rect) OVERRIDE;
(...skipping 28 matching lines...) Expand all
138 bool IsOnActiveOrPendingTree() const; 139 bool IsOnActiveOrPendingTree() const;
139 140
140 protected: 141 protected:
141 friend class LayerRasterTileIterator; 142 friend class LayerRasterTileIterator;
142 143
143 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); 144 PictureLayerImpl(LayerTreeImpl* tree_impl, int id);
144 PictureLayerTiling* AddTiling(float contents_scale); 145 PictureLayerTiling* AddTiling(float contents_scale);
145 void RemoveTiling(float contents_scale); 146 void RemoveTiling(float contents_scale);
146 void RemoveAllTilings(); 147 void RemoveAllTilings();
147 void SyncFromActiveLayer(const PictureLayerImpl* other); 148 void SyncFromActiveLayer(const PictureLayerImpl* other);
148 void ManageTilings(bool animating_transform_to_screen); 149 void ManageTilings(bool animating_transform_to_screen,
150 float maximum_animation_scale_factor);
149 bool ShouldHaveLowResTiling() const { 151 bool ShouldHaveLowResTiling() const {
150 return should_use_low_res_tiling_ && !ShouldUseGpuRasterization(); 152 return should_use_low_res_tiling_ && !ShouldUseGpuRasterization();
151 } 153 }
152 virtual bool ShouldAdjustRasterScale( 154 virtual bool ShouldAdjustRasterScale(
153 bool animating_transform_to_screen) const; 155 bool animating_transform_to_screen) const;
154 virtual void RecalculateRasterScales( 156 virtual void RecalculateRasterScales(bool animating_transform_to_screen,
155 bool animating_transform_to_screen); 157 float maximum_animation_scale_factor);
156 void CleanUpTilingsOnActiveLayer( 158 void CleanUpTilingsOnActiveLayer(
157 std::vector<PictureLayerTiling*> used_tilings); 159 std::vector<PictureLayerTiling*> used_tilings);
158 float MinimumContentsScale() const; 160 float MinimumContentsScale() const;
159 float SnappedContentsScale(float new_contents_scale); 161 float SnappedContentsScale(float new_contents_scale);
160 void UpdateLCDTextStatus(bool new_status); 162 void UpdateLCDTextStatus(bool new_status);
161 void ResetRasterScale(); 163 void ResetRasterScale();
162 void MarkVisibleResourcesAsRequired() const; 164 void MarkVisibleResourcesAsRequired() const;
163 bool MarkVisibleTilesAsRequired( 165 bool MarkVisibleTilesAsRequired(
164 PictureLayerTiling* tiling, 166 PictureLayerTiling* tiling,
165 const PictureLayerTiling* optional_twin_tiling, 167 const PictureLayerTiling* optional_twin_tiling,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 213
212 bool layer_needs_to_register_itself_; 214 bool layer_needs_to_register_itself_;
213 215
214 friend class PictureLayer; 216 friend class PictureLayer;
215 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); 217 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
216 }; 218 };
217 219
218 } // namespace cc 220 } // namespace cc
219 221
220 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ 222 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698