| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 can_use_lcd_text_ = can_use_lcd_text; | 65 can_use_lcd_text_ = can_use_lcd_text; |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool can_use_lcd_text() const { | 68 bool can_use_lcd_text() const { |
| 69 return can_use_lcd_text_; | 69 return can_use_lcd_text_; |
| 70 } | 70 } |
| 71 | 71 |
| 72 scoped_ptr<base::Value> AsValue() const; | 72 scoped_ptr<base::Value> AsValue() const; |
| 73 | 73 |
| 74 bool IsReadyToDraw() const { | 74 bool IsReadyToDraw() const { |
| 75 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 75 for (int mode = 0; mode < RasterMode_ARRAYSIZE; ++mode) { |
| 76 if (managed_state_.tile_versions[mode].IsReadyToDraw()) | 76 if (managed_state_.tile_versions[mode].IsReadyToDraw()) |
| 77 return true; | 77 return true; |
| 78 } | 78 } |
| 79 return false; | 79 return false; |
| 80 } | 80 } |
| 81 | 81 |
| 82 const ManagedTileState::TileVersion& GetTileVersionForDrawing() const { | 82 const ManagedTileState::TileVersion& GetTileVersionForDrawing() const { |
| 83 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 83 for (int mode = 0; mode < RasterMode_ARRAYSIZE; ++mode) { |
| 84 if (managed_state_.tile_versions[mode].IsReadyToDraw()) | 84 if (managed_state_.tile_versions[mode].IsReadyToDraw()) |
| 85 return managed_state_.tile_versions[mode]; | 85 return managed_state_.tile_versions[mode]; |
| 86 } | 86 } |
| 87 return managed_state_.tile_versions[HIGH_QUALITY_RASTER_MODE]; | 87 return managed_state_.tile_versions[HIGH_QUALITY_RASTER_MODE]; |
| 88 } | 88 } |
| 89 | 89 |
| 90 gfx::Rect opaque_rect() const { return opaque_rect_; } | 90 gfx::Rect opaque_rect() const { return opaque_rect_; } |
| 91 bool has_text(RasterMode mode) const { | 91 bool has_text(RasterMode mode) const { |
| 92 return managed_state_.tile_versions[mode].has_text_; | 92 return managed_state_.tile_versions[mode].has_text_; |
| 93 } | 93 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 friend class base::RefCounted<Tile>; | 130 friend class base::RefCounted<Tile>; |
| 131 ~Tile(); | 131 ~Tile(); |
| 132 | 132 |
| 133 TileManager* tile_manager_; | 133 TileManager* tile_manager_; |
| 134 scoped_refptr<PicturePileImpl> picture_pile_; | 134 scoped_refptr<PicturePileImpl> picture_pile_; |
| 135 gfx::Rect tile_size_; | 135 gfx::Rect tile_size_; |
| 136 gfx::Rect content_rect_; | 136 gfx::Rect content_rect_; |
| 137 float contents_scale_; | 137 float contents_scale_; |
| 138 gfx::Rect opaque_rect_; | 138 gfx::Rect opaque_rect_; |
| 139 | 139 |
| 140 TilePriority priority_[NUM_BIN_PRIORITIES]; | 140 TilePriority priority_[WhichTree_ARRAYSIZE]; |
| 141 ManagedTileState managed_state_; | 141 ManagedTileState managed_state_; |
| 142 int layer_id_; | 142 int layer_id_; |
| 143 int source_frame_number_; | 143 int source_frame_number_; |
| 144 bool can_use_lcd_text_; | 144 bool can_use_lcd_text_; |
| 145 | 145 |
| 146 Id id_; | 146 Id id_; |
| 147 static Id s_next_id_; | 147 static Id s_next_id_; |
| 148 | 148 |
| 149 DISALLOW_COPY_AND_ASSIGN(Tile); | 149 DISALLOW_COPY_AND_ASSIGN(Tile); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 } // namespace cc | 152 } // namespace cc |
| 153 | 153 |
| 154 #endif // CC_RESOURCES_TILE_H_ | 154 #endif // CC_RESOURCES_TILE_H_ |
| OLD | NEW |