| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 void set_can_use_lcd_text(bool can_use_lcd_text) { | 55 void set_can_use_lcd_text(bool can_use_lcd_text) { |
| 56 can_use_lcd_text_ = can_use_lcd_text; | 56 can_use_lcd_text_ = can_use_lcd_text; |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool can_use_lcd_text() const { | 59 bool can_use_lcd_text() const { |
| 60 return can_use_lcd_text_; | 60 return can_use_lcd_text_; |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool use_gpu_rasterizer() const { |
| 64 return use_gpu_rasterizer_; |
| 65 } |
| 66 |
| 63 scoped_ptr<base::Value> AsValue() const; | 67 scoped_ptr<base::Value> AsValue() const; |
| 64 | 68 |
| 65 inline bool IsReadyToDraw() const { | 69 inline bool IsReadyToDraw() const { |
| 66 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 70 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
| 67 if (managed_state_.tile_versions[mode].IsReadyToDraw()) | 71 if (managed_state_.tile_versions[mode].IsReadyToDraw()) |
| 68 return true; | 72 return true; |
| 69 } | 73 } |
| 70 return false; | 74 return false; |
| 71 } | 75 } |
| 72 | 76 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 109 } |
| 106 | 110 |
| 107 gfx::Size size() const { return tile_size_.size(); } | 111 gfx::Size size() const { return tile_size_.size(); } |
| 108 | 112 |
| 109 private: | 113 private: |
| 110 friend class TileManager; | 114 friend class TileManager; |
| 111 friend class PrioritizedTileSet; | 115 friend class PrioritizedTileSet; |
| 112 friend class FakeTileManager; | 116 friend class FakeTileManager; |
| 113 friend class BinComparator; | 117 friend class BinComparator; |
| 114 friend class FakePictureLayerImpl; | 118 friend class FakePictureLayerImpl; |
| 119 friend class GpuRasterizer; |
| 115 | 120 |
| 116 // Methods called by by tile manager. | 121 // Methods called by by tile manager. |
| 117 Tile(TileManager* tile_manager, | 122 Tile(TileManager* tile_manager, |
| 118 PicturePileImpl* picture_pile, | 123 PicturePileImpl* picture_pile, |
| 119 gfx::Size tile_size, | 124 gfx::Size tile_size, |
| 120 gfx::Rect content_rect, | 125 gfx::Rect content_rect, |
| 121 gfx::Rect opaque_rect, | 126 gfx::Rect opaque_rect, |
| 122 float contents_scale, | 127 float contents_scale, |
| 123 int layer_id, | 128 int layer_id, |
| 124 int source_frame_number, | 129 int source_frame_number, |
| 125 bool can_use_lcd_text); | 130 bool can_use_lcd_text, |
| 131 bool use_gpu_rasterizer); |
| 126 ~Tile(); | 132 ~Tile(); |
| 127 | 133 |
| 128 ManagedTileState& managed_state() { return managed_state_; } | 134 ManagedTileState& managed_state() { return managed_state_; } |
| 129 const ManagedTileState& managed_state() const { return managed_state_; } | 135 const ManagedTileState& managed_state() const { return managed_state_; } |
| 130 | 136 |
| 131 TileManager* tile_manager_; | 137 TileManager* tile_manager_; |
| 132 scoped_refptr<PicturePileImpl> picture_pile_; | 138 scoped_refptr<PicturePileImpl> picture_pile_; |
| 133 gfx::Rect tile_size_; | 139 gfx::Rect tile_size_; |
| 134 gfx::Rect content_rect_; | 140 gfx::Rect content_rect_; |
| 135 float contents_scale_; | 141 float contents_scale_; |
| 136 gfx::Rect opaque_rect_; | 142 gfx::Rect opaque_rect_; |
| 137 | 143 |
| 138 TilePriority priority_[NUM_TREES]; | 144 TilePriority priority_[NUM_TREES]; |
| 139 ManagedTileState managed_state_; | 145 ManagedTileState managed_state_; |
| 140 int layer_id_; | 146 int layer_id_; |
| 141 int source_frame_number_; | 147 int source_frame_number_; |
| 142 bool can_use_lcd_text_; | 148 bool can_use_lcd_text_; |
| 149 bool use_gpu_rasterizer_; |
| 143 | 150 |
| 144 Id id_; | 151 Id id_; |
| 145 static Id s_next_id_; | 152 static Id s_next_id_; |
| 146 | 153 |
| 147 DISALLOW_COPY_AND_ASSIGN(Tile); | 154 DISALLOW_COPY_AND_ASSIGN(Tile); |
| 148 }; | 155 }; |
| 149 | 156 |
| 150 } // namespace cc | 157 } // namespace cc |
| 151 | 158 |
| 152 #endif // CC_RESOURCES_TILE_H_ | 159 #endif // CC_RESOURCES_TILE_H_ |
| OLD | NEW |