| 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_RESOURCES_PICTURE_LAYER_TILING_H_ | 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 bool store_screen_space_quads_on_tiles, | 143 bool store_screen_space_quads_on_tiles, |
| 144 size_t max_tiles_for_interest_area); | 144 size_t max_tiles_for_interest_area); |
| 145 | 145 |
| 146 // Copies the src_tree priority into the dst_tree priority for all tiles. | 146 // Copies the src_tree priority into the dst_tree priority for all tiles. |
| 147 // The src_tree priority is reset to the lowest priority possible. This | 147 // The src_tree priority is reset to the lowest priority possible. This |
| 148 // also updates the pile on each tile to be the current client's pile. | 148 // also updates the pile on each tile to be the current client's pile. |
| 149 void DidBecomeActive(); | 149 void DidBecomeActive(); |
| 150 | 150 |
| 151 scoped_ptr<base::Value> AsValue() const; | 151 scoped_ptr<base::Value> AsValue() const; |
| 152 | 152 |
| 153 bool needs_first_time_update_tile_priorities() const { |
| 154 return last_impl_frame_time_ == 0.0; |
| 155 } |
| 156 |
| 153 protected: | 157 protected: |
| 154 typedef std::pair<int, int> TileMapKey; | 158 typedef std::pair<int, int> TileMapKey; |
| 155 typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap; | 159 typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap; |
| 156 | 160 |
| 157 explicit PictureLayerTiling(float contents_scale); | 161 explicit PictureLayerTiling(float contents_scale); |
| 158 Tile* TileAt(int, int) const; | 162 Tile* TileAt(int, int) const; |
| 159 void CreateTilesFromContentRect(gfx::Rect layer_rect); | 163 void CreateTilesFromContentRect(gfx::Rect layer_rect); |
| 160 void CreateTile(int i, int j); | 164 void CreateTile(int i, int j); |
| 161 | 165 |
| 162 PictureLayerTilingClient* client_; | 166 PictureLayerTilingClient* client_; |
| 163 float contents_scale_; | 167 float contents_scale_; |
| 164 gfx::Size layer_bounds_; | 168 gfx::Size layer_bounds_; |
| 165 gfx::Rect last_prioritized_rect_; | 169 gfx::Rect last_prioritized_rect_; |
| 166 // It is not legal to have a NULL tile in the tiles_ map. | 170 // It is not legal to have a NULL tile in the tiles_ map. |
| 167 TileMap tiles_; | 171 TileMap tiles_; |
| 168 TilingData tiling_data_; | 172 TilingData tiling_data_; |
| 169 TileResolution resolution_; | 173 TileResolution resolution_; |
| 170 int last_source_frame_number_; | 174 int last_source_frame_number_; |
| 171 double last_impl_frame_time_; | 175 double last_impl_frame_time_; |
| 172 | 176 |
| 173 friend class CoverageIterator; | 177 friend class CoverageIterator; |
| 174 | 178 |
| 175 private: | 179 private: |
| 176 DISALLOW_ASSIGN(PictureLayerTiling); | 180 DISALLOW_ASSIGN(PictureLayerTiling); |
| 177 }; | 181 }; |
| 178 | 182 |
| 179 } // namespace cc | 183 } // namespace cc |
| 180 | 184 |
| 181 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 185 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |