| 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_TILE_H_ | 5 #ifndef CC_RESOURCES_TILE_H_ |
| 6 #define CC_RESOURCES_TILE_H_ | 6 #define CC_RESOURCES_TILE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 RasterMode DetermineOverallRasterMode() const; | 121 RasterMode DetermineOverallRasterMode() const; |
| 122 | 122 |
| 123 // Functionality used in tests. | 123 // Functionality used in tests. |
| 124 RasterMode GetRasterModeForTesting() const { | 124 RasterMode GetRasterModeForTesting() const { |
| 125 return managed_state().raster_mode; | 125 return managed_state().raster_mode; |
| 126 } | 126 } |
| 127 ManagedTileState::TileVersion& GetTileVersionForTesting(RasterMode mode) { | 127 ManagedTileState::TileVersion& GetTileVersionForTesting(RasterMode mode) { |
| 128 return managed_state_.tile_versions[mode]; | 128 return managed_state_.tile_versions[mode]; |
| 129 } | 129 } |
| 130 | 130 |
| 131 void set_is_occluded(bool is_occluded) { is_occluded_ = is_occluded; } | 131 void set_is_occluded(WhichTree tree, bool is_occluded) { |
| 132 bool is_occluded() const { return is_occluded_; } | 132 is_occluded_[tree] = is_occluded; |
| 133 } |
| 134 |
| 135 bool is_occluded(WhichTree tree) const { return is_occluded_[tree]; } |
| 133 | 136 |
| 134 private: | 137 private: |
| 135 friend class TileManager; | 138 friend class TileManager; |
| 136 friend class PrioritizedTileSet; | 139 friend class PrioritizedTileSet; |
| 137 friend class FakeTileManager; | 140 friend class FakeTileManager; |
| 138 friend class BinComparator; | 141 friend class BinComparator; |
| 139 friend class FakePictureLayerImpl; | 142 friend class FakePictureLayerImpl; |
| 140 | 143 |
| 141 // Methods called by by tile manager. | 144 // Methods called by by tile manager. |
| 142 Tile(TileManager* tile_manager, | 145 Tile(TileManager* tile_manager, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 153 ManagedTileState& managed_state() { return managed_state_; } | 156 ManagedTileState& managed_state() { return managed_state_; } |
| 154 const ManagedTileState& managed_state() const { return managed_state_; } | 157 const ManagedTileState& managed_state() const { return managed_state_; } |
| 155 RasterMode DetermineRasterModeForResolution(TileResolution resolution) const; | 158 RasterMode DetermineRasterModeForResolution(TileResolution resolution) const; |
| 156 | 159 |
| 157 TileManager* tile_manager_; | 160 TileManager* tile_manager_; |
| 158 scoped_refptr<PicturePileImpl> picture_pile_; | 161 scoped_refptr<PicturePileImpl> picture_pile_; |
| 159 gfx::Rect tile_size_; | 162 gfx::Rect tile_size_; |
| 160 gfx::Rect content_rect_; | 163 gfx::Rect content_rect_; |
| 161 float contents_scale_; | 164 float contents_scale_; |
| 162 gfx::Rect opaque_rect_; | 165 gfx::Rect opaque_rect_; |
| 163 bool is_occluded_; | 166 bool is_occluded_[NUM_TREES]; |
| 164 | 167 |
| 165 TilePriority priority_[NUM_TREES]; | 168 TilePriority priority_[NUM_TREES]; |
| 166 ManagedTileState managed_state_; | 169 ManagedTileState managed_state_; |
| 167 int layer_id_; | 170 int layer_id_; |
| 168 int source_frame_number_; | 171 int source_frame_number_; |
| 169 int flags_; | 172 int flags_; |
| 170 | 173 |
| 171 Id id_; | 174 Id id_; |
| 172 static Id s_next_id_; | 175 static Id s_next_id_; |
| 173 | 176 |
| 174 DISALLOW_COPY_AND_ASSIGN(Tile); | 177 DISALLOW_COPY_AND_ASSIGN(Tile); |
| 175 }; | 178 }; |
| 176 | 179 |
| 177 } // namespace cc | 180 } // namespace cc |
| 178 | 181 |
| 179 #endif // CC_RESOURCES_TILE_H_ | 182 #endif // CC_RESOURCES_TILE_H_ |
| OLD | NEW |