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