Chromium Code Reviews| 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" |
| 11 #include "cc/base/ref_counted_managed.h" | 11 #include "cc/base/ref_counted_managed.h" |
| 12 #include "cc/resources/managed_tile_state.h" | 12 #include "cc/resources/managed_tile_state.h" |
| 13 #include "cc/resources/picture_pile_impl.h" | 13 #include "cc/resources/picture_pile_impl.h" |
| 14 #include "cc/resources/raster_mode.h" | 14 #include "cc/resources/raster_mode.h" |
| 15 #include "cc/resources/tile_priority.h" | 15 #include "cc/resources/tile_priority.h" |
| 16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 17 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
| 18 | 18 |
| 19 namespace cc { | 19 namespace cc { |
| 20 | 20 |
| 21 class CC_EXPORT Tile : public RefCountedManaged<Tile> { | 21 class CC_EXPORT Tile : public RefCountedManaged<Tile> { |
| 22 public: | 22 public: |
| 23 // Needed by ScopedVector for deleting released tiles. | |
| 24 ~Tile(); | |
|
reveman
2014/07/30 14:24:01
This is really inappropriate for a ref counted typ
sohanjg
2014/07/30 17:27:04
Acknowledged.
| |
| 25 | |
| 23 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0 }; | 26 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0 }; |
| 24 | 27 |
| 25 typedef uint64 Id; | 28 typedef uint64 Id; |
| 26 | 29 |
| 27 Id id() const { | 30 Id id() const { |
| 28 return id_; | 31 return id_; |
| 29 } | 32 } |
| 30 | 33 |
| 31 PicturePileImpl* picture_pile() { | 34 PicturePileImpl* picture_pile() { |
| 32 return picture_pile_.get(); | 35 return picture_pile_.get(); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 // Methods called by by tile manager. | 164 // Methods called by by tile manager. |
| 162 Tile(TileManager* tile_manager, | 165 Tile(TileManager* tile_manager, |
| 163 PicturePileImpl* picture_pile, | 166 PicturePileImpl* picture_pile, |
| 164 const gfx::Size& tile_size, | 167 const gfx::Size& tile_size, |
| 165 const gfx::Rect& content_rect, | 168 const gfx::Rect& content_rect, |
| 166 const gfx::Rect& opaque_rect, | 169 const gfx::Rect& opaque_rect, |
| 167 float contents_scale, | 170 float contents_scale, |
| 168 int layer_id, | 171 int layer_id, |
| 169 int source_frame_number, | 172 int source_frame_number, |
| 170 int flags); | 173 int flags); |
| 171 ~Tile(); | |
| 172 | 174 |
| 173 ManagedTileState& managed_state() { return managed_state_; } | 175 ManagedTileState& managed_state() { return managed_state_; } |
| 174 const ManagedTileState& managed_state() const { return managed_state_; } | 176 const ManagedTileState& managed_state() const { return managed_state_; } |
| 175 RasterMode DetermineRasterModeForResolution(TileResolution resolution) const; | 177 RasterMode DetermineRasterModeForResolution(TileResolution resolution) const; |
| 176 | 178 |
| 179 bool HasRasterTask() const; | |
| 180 | |
| 177 TileManager* tile_manager_; | 181 TileManager* tile_manager_; |
| 178 scoped_refptr<PicturePileImpl> picture_pile_; | 182 scoped_refptr<PicturePileImpl> picture_pile_; |
| 179 gfx::Rect tile_size_; | 183 gfx::Rect tile_size_; |
| 180 gfx::Rect content_rect_; | 184 gfx::Rect content_rect_; |
| 181 float contents_scale_; | 185 float contents_scale_; |
| 182 gfx::Rect opaque_rect_; | 186 gfx::Rect opaque_rect_; |
| 183 bool is_occluded_[NUM_TREES]; | 187 bool is_occluded_[NUM_TREES]; |
| 184 | 188 |
| 185 TilePriority priority_[NUM_TREES]; | 189 TilePriority priority_[NUM_TREES]; |
| 186 ManagedTileState managed_state_; | 190 ManagedTileState managed_state_; |
| 187 int layer_id_; | 191 int layer_id_; |
| 188 int source_frame_number_; | 192 int source_frame_number_; |
| 189 int flags_; | 193 int flags_; |
| 190 | 194 |
| 191 Id id_; | 195 Id id_; |
| 192 static Id s_next_id_; | 196 static Id s_next_id_; |
| 193 | 197 |
| 194 DISALLOW_COPY_AND_ASSIGN(Tile); | 198 DISALLOW_COPY_AND_ASSIGN(Tile); |
| 195 }; | 199 }; |
| 196 | 200 |
| 197 } // namespace cc | 201 } // namespace cc |
| 198 | 202 |
| 199 #endif // CC_RESOURCES_TILE_H_ | 203 #endif // CC_RESOURCES_TILE_H_ |
| OLD | NEW |