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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 int layer_id() const { return layer_id_; } | 101 int layer_id() const { return layer_id_; } |
102 | 102 |
103 int source_frame_number() const { return source_frame_number_; } | 103 int source_frame_number() const { return source_frame_number_; } |
104 | 104 |
105 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { | 105 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { |
106 DCHECK(pile->CanRaster(contents_scale_, content_rect_)); | 106 DCHECK(pile->CanRaster(contents_scale_, content_rect_)); |
107 picture_pile_ = pile; | 107 picture_pile_ = pile; |
108 } | 108 } |
109 | 109 |
110 // For test only methods. | |
111 bool HasRasterTaskForTesting() const { | |
112 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | |
113 if (!managed_state().tile_versions[mode].raster_task_.is_null()) | |
114 return true; | |
115 } | |
116 return false; | |
117 } | |
118 void ResetRasterTaskForTesting() { | |
119 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) | |
120 managed_state().tile_versions[mode].raster_task_.Reset(); | |
121 } | |
122 RasterMode GetRasterModeForTesting() const { | 110 RasterMode GetRasterModeForTesting() const { |
123 return managed_state().raster_mode; | 111 return managed_state().raster_mode; |
124 } | 112 } |
125 | 113 |
126 private: | 114 private: |
127 // Methods called by by tile manager. | 115 // Methods called by by tile manager. |
128 friend class TileManager; | 116 friend class TileManager; |
| 117 friend class FakeTileManager; |
129 friend class BinComparator; | 118 friend class BinComparator; |
130 ManagedTileState& managed_state() { return managed_state_; } | 119 ManagedTileState& managed_state() { return managed_state_; } |
131 const ManagedTileState& managed_state() const { return managed_state_; } | 120 const ManagedTileState& managed_state() const { return managed_state_; } |
132 | 121 |
133 inline size_t bytes_consumed_if_allocated() const { | 122 inline size_t bytes_consumed_if_allocated() const { |
134 return 4 * tile_size_.width() * tile_size_.height(); | 123 return 4 * tile_size_.width() * tile_size_.height(); |
135 } | 124 } |
136 | 125 |
137 | 126 |
138 // Normal private methods. | 127 // Normal private methods. |
(...skipping 12 matching lines...) Expand all Loading... |
151 int layer_id_; | 140 int layer_id_; |
152 int source_frame_number_; | 141 int source_frame_number_; |
153 bool can_use_lcd_text_; | 142 bool can_use_lcd_text_; |
154 | 143 |
155 DISALLOW_COPY_AND_ASSIGN(Tile); | 144 DISALLOW_COPY_AND_ASSIGN(Tile); |
156 }; | 145 }; |
157 | 146 |
158 } // namespace cc | 147 } // namespace cc |
159 | 148 |
160 #endif // CC_RESOURCES_TILE_H_ | 149 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |