| 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_TILES_PICTURE_LAYER_TILING_SET_H_ | 5 #ifndef CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
| 6 #define CC_TILES_PICTURE_LAYER_TILING_SET_H_ | 6 #define CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 float minimum_contents_scale, | 73 float minimum_contents_scale, |
| 74 float maximum_contents_scale); | 74 float maximum_contents_scale); |
| 75 | 75 |
| 76 // This function is called on the sync tree right after commit. | 76 // This function is called on the sync tree right after commit. |
| 77 void UpdateRasterSourceDueToLCDChange( | 77 void UpdateRasterSourceDueToLCDChange( |
| 78 scoped_refptr<RasterSource> raster_source, | 78 scoped_refptr<RasterSource> raster_source, |
| 79 const Region& layer_invalidation); | 79 const Region& layer_invalidation); |
| 80 | 80 |
| 81 void UpdateTilingsForImplSideInvalidation(const Region& layer_invalidation); | 81 void UpdateTilingsForImplSideInvalidation(const Region& layer_invalidation); |
| 82 | 82 |
| 83 PictureLayerTiling* AddTiling(float contents_scale, | 83 PictureLayerTiling* AddTiling(const ScaleTranslate2d& raster_transform, |
| 84 scoped_refptr<RasterSource> raster_source); | 84 scoped_refptr<RasterSource> raster_source); |
| 85 size_t num_tilings() const { return tilings_.size(); } | 85 size_t num_tilings() const { return tilings_.size(); } |
| 86 int NumHighResTilings() const; | 86 int NumHighResTilings() const; |
| 87 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx].get(); } | 87 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx].get(); } |
| 88 const PictureLayerTiling* tiling_at(size_t idx) const { | 88 const PictureLayerTiling* tiling_at(size_t idx) const { |
| 89 return tilings_[idx].get(); | 89 return tilings_[idx].get(); |
| 90 } | 90 } |
| 91 WhichTree tree() const { return tree_; } | 91 WhichTree tree() const { return tree_; } |
| 92 | 92 |
| 93 PictureLayerTiling* FindTilingWithScaleKey(float scale_key) const; | 93 PictureLayerTiling* FindTilingWithScaleKey(float scale_key) const; |
| 94 PictureLayerTiling* FindTilingWithResolution(TileResolution resolution) const; | 94 PictureLayerTiling* FindTilingWithResolution(TileResolution resolution) const; |
| 95 | 95 |
| 96 void MarkAllTilingsNonIdeal(); | 96 void MarkAllTilingsNonIdeal(); |
| 97 | 97 |
| 98 // If a tiling exists whose scale is within |snap_to_existing_tiling_ratio| | 98 // If a tiling exists whose scale is within |snap_to_existing_tiling_ratio| |
| 99 // ratio of |start_scale|, then return that tiling's scale. Otherwise, return | 99 // ratio of |start_scale|, then return that tiling's scale. Otherwise, return |
| 100 // |start_scale|. If multiple tilings match the criteria, return the one with | 100 // |start_scale|. If multiple tilings match the criteria, return the one with |
| 101 // the least ratio to |start_scale|. | 101 // the least ratio to |start_scale|. |
| 102 float GetSnappedContentsScaleKey(float start_scale, | 102 float GetSnappedContentsScaleKey(float start_scale, |
| 103 float snap_to_existing_tiling_ratio) const; | 103 float snap_to_existing_tiling_ratio) const; |
| 104 | 104 |
| 105 // Returns the maximum contents scale of all tilings, or 0 if no tilings | 105 // Returns the maximum contents scale of all tilings, or 0 if no tilings |
| 106 // exist. Note that this returns the maximum of x and y scales depending on | 106 // exist. Note that this returns the maximum of x and y scales depending on |
| 107 // the aspect ratio. | 107 // the aspect ratio. |
| 108 float GetMaximumContentsScale() const; | 108 float GetMaximumContentsScale() const; |
| 109 | 109 |
| 110 // Remove one tiling. |
| 111 void Remove(PictureLayerTiling* tiling); |
| 112 |
| 110 // Removes all tilings with a contents scale key < |minimum_scale_key|. | 113 // Removes all tilings with a contents scale key < |minimum_scale_key|. |
| 111 void RemoveTilingsBelowScaleKey(float minimum_scale_key); | 114 void RemoveTilingsBelowScaleKey(float minimum_scale_key); |
| 112 | 115 |
| 113 // Removes all tilings with a contents scale key > |maximum_scale_key|. | 116 // Removes all tilings with a contents scale key > |maximum_scale_key|. |
| 114 void RemoveTilingsAboveScaleKey(float maximum_scale); | 117 void RemoveTilingsAboveScaleKey(float maximum_scale); |
| 115 | 118 |
| 116 // Remove all tilings. | 119 // Remove all tilings. |
| 117 void RemoveAllTilings(); | 120 void RemoveAllTilings(); |
| 118 | 121 |
| 119 // Remove all tiles; keep all tilings. | 122 // Remove all tiles; keep all tilings. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 int tiling_interest_area_padding, | 222 int tiling_interest_area_padding, |
| 220 float skewport_target_time_in_seconds, | 223 float skewport_target_time_in_seconds, |
| 221 int skewport_extrapolation_limit_in_screen_pixels, | 224 int skewport_extrapolation_limit_in_screen_pixels, |
| 222 float max_preraster_distance); | 225 float max_preraster_distance); |
| 223 | 226 |
| 224 void CopyTilingsAndPropertiesFromPendingTwin( | 227 void CopyTilingsAndPropertiesFromPendingTwin( |
| 225 const PictureLayerTilingSet* pending_twin_set, | 228 const PictureLayerTilingSet* pending_twin_set, |
| 226 scoped_refptr<RasterSource> raster_source, | 229 scoped_refptr<RasterSource> raster_source, |
| 227 const Region& layer_invalidation); | 230 const Region& layer_invalidation); |
| 228 | 231 |
| 229 // Remove one tiling. | |
| 230 void Remove(PictureLayerTiling* tiling); | |
| 231 void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const; | 232 void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const; |
| 232 | 233 |
| 233 bool TilingsNeedUpdate(const gfx::Rect& required_rect_in_layer_space, | 234 bool TilingsNeedUpdate(const gfx::Rect& required_rect_in_layer_space, |
| 234 double current_frame_time_in_Seconds); | 235 double current_frame_time_in_Seconds); |
| 235 gfx::Rect ComputeSkewport(const gfx::Rect& visible_rect_in_layer_space, | 236 gfx::Rect ComputeSkewport(const gfx::Rect& visible_rect_in_layer_space, |
| 236 double current_frame_time_in_seconds, | 237 double current_frame_time_in_seconds, |
| 237 float ideal_contents_scale); | 238 float ideal_contents_scale); |
| 238 gfx::Rect ComputeSoonBorderRect(const gfx::Rect& visible_rect_in_layer_space, | 239 gfx::Rect ComputeSoonBorderRect(const gfx::Rect& visible_rect_in_layer_space, |
| 239 float ideal_contents_scale); | 240 float ideal_contents_scale); |
| 240 void UpdatePriorityRects(const gfx::Rect& visible_rect_in_layer_space, | 241 void UpdatePriorityRects(const gfx::Rect& visible_rect_in_layer_space, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 263 | 264 |
| 264 friend class Iterator; | 265 friend class Iterator; |
| 265 | 266 |
| 266 private: | 267 private: |
| 267 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 268 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
| 268 }; | 269 }; |
| 269 | 270 |
| 270 } // namespace cc | 271 } // namespace cc |
| 271 | 272 |
| 272 #endif // CC_TILES_PICTURE_LAYER_TILING_SET_H_ | 273 #endif // CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
| OLD | NEW |