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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 int layer_id() const { return layer_id_; } | 76 int layer_id() const { return layer_id_; } |
77 | 77 |
78 int source_frame_number() const { return source_frame_number_; } | 78 int source_frame_number() const { return source_frame_number_; } |
79 | 79 |
80 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { | 80 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { |
81 DCHECK(pile->CanRaster(contents_scale_, content_rect_)); | 81 DCHECK(pile->CanRaster(contents_scale_, content_rect_)); |
82 picture_pile_ = pile; | 82 picture_pile_ = pile; |
83 } | 83 } |
84 | 84 |
85 bool IsAssignedGpuMemory() const { | 85 // For test only methods. |
86 return tile_version().memory_state_ != NOT_ALLOWED_TO_USE_MEMORY; | 86 bool HasRasterTaskForTesting() const { |
| 87 return !managed_state().raster_task.is_null(); |
| 88 } |
| 89 void ResetRasterTaskForTesting() { |
| 90 managed_state().raster_task.Reset(); |
87 } | 91 } |
88 | 92 |
89 private: | 93 private: |
90 // Methods called by by tile manager. | 94 // Methods called by by tile manager. |
91 friend class TileManager; | 95 friend class TileManager; |
92 friend class BinComparator; | 96 friend class BinComparator; |
93 ManagedTileState& managed_state() { return managed_state_; } | 97 ManagedTileState& managed_state() { return managed_state_; } |
94 const ManagedTileState& managed_state() const { return managed_state_; } | 98 const ManagedTileState& managed_state() const { return managed_state_; } |
95 | 99 |
96 inline size_t bytes_consumed_if_allocated() const { | 100 inline size_t bytes_consumed_if_allocated() const { |
(...skipping 16 matching lines...) Expand all Loading... |
113 ManagedTileState managed_state_; | 117 ManagedTileState managed_state_; |
114 int layer_id_; | 118 int layer_id_; |
115 int source_frame_number_; | 119 int source_frame_number_; |
116 | 120 |
117 DISALLOW_COPY_AND_ASSIGN(Tile); | 121 DISALLOW_COPY_AND_ASSIGN(Tile); |
118 }; | 122 }; |
119 | 123 |
120 } // namespace cc | 124 } // namespace cc |
121 | 125 |
122 #endif // CC_RESOURCES_TILE_H_ | 126 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |