| 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 17 matching lines...) Expand all Loading... |
| 28 gfx::Rect content_rect, | 28 gfx::Rect content_rect, |
| 29 gfx::Rect opaque_rect, | 29 gfx::Rect opaque_rect, |
| 30 float contents_scale, | 30 float contents_scale, |
| 31 int layer_id, | 31 int layer_id, |
| 32 int source_frame_number); | 32 int source_frame_number); |
| 33 | 33 |
| 34 PicturePileImpl* picture_pile() { | 34 PicturePileImpl* picture_pile() { |
| 35 return picture_pile_.get(); | 35 return picture_pile_.get(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 const PicturePileImpl* picture_pile() const { |
| 39 return picture_pile_.get(); |
| 40 } |
| 41 |
| 38 const TilePriority& priority(WhichTree tree) const { | 42 const TilePriority& priority(WhichTree tree) const { |
| 39 return priority_[tree]; | 43 return priority_[tree]; |
| 40 } | 44 } |
| 41 | 45 |
| 42 TilePriority combined_priority() const { | 46 TilePriority combined_priority() const { |
| 43 return TilePriority(priority_[ACTIVE_TREE], | 47 return TilePriority(priority_[ACTIVE_TREE], |
| 44 priority_[PENDING_TREE]); | 48 priority_[PENDING_TREE]); |
| 45 } | 49 } |
| 46 | 50 |
| 47 void SetPriority(WhichTree tree, const TilePriority& priority) { | 51 void SetPriority(WhichTree tree, const TilePriority& priority) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 77 | 81 |
| 78 int source_frame_number() const { return source_frame_number_; } | 82 int source_frame_number() const { return source_frame_number_; } |
| 79 | 83 |
| 80 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { | 84 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { |
| 81 DCHECK(pile->CanRaster(contents_scale_, content_rect_)); | 85 DCHECK(pile->CanRaster(contents_scale_, content_rect_)); |
| 82 picture_pile_ = pile; | 86 picture_pile_ = pile; |
| 83 } | 87 } |
| 84 | 88 |
| 85 // For test only methods. | 89 // For test only methods. |
| 86 bool HasRasterTaskForTesting() const { | 90 bool HasRasterTaskForTesting() const { |
| 87 return !managed_state().raster_task.is_null(); | 91 return !managed_state().pending_tile_versions.empty(); |
| 88 } | 92 } |
| 89 void ResetRasterTaskForTesting() { | 93 void ResetRasterTaskForTesting() { |
| 90 managed_state().raster_task.Reset(); | 94 managed_state().pending_tile_versions.clear(); |
| 91 } | 95 } |
| 92 | 96 |
| 93 private: | 97 private: |
| 94 // Methods called by by tile manager. | 98 // Methods called by by tile manager. |
| 95 friend class TileManager; | 99 friend class TileManager; |
| 96 friend class BinComparator; | 100 friend class BinComparator; |
| 97 ManagedTileState& managed_state() { return managed_state_; } | 101 ManagedTileState& managed_state() { return managed_state_; } |
| 98 const ManagedTileState& managed_state() const { return managed_state_; } | 102 const ManagedTileState& managed_state() const { return managed_state_; } |
| 99 | 103 |
| 100 inline size_t bytes_consumed_if_allocated() const { | 104 inline size_t bytes_consumed_if_allocated() const { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 117 ManagedTileState managed_state_; | 121 ManagedTileState managed_state_; |
| 118 int layer_id_; | 122 int layer_id_; |
| 119 int source_frame_number_; | 123 int source_frame_number_; |
| 120 | 124 |
| 121 DISALLOW_COPY_AND_ASSIGN(Tile); | 125 DISALLOW_COPY_AND_ASSIGN(Tile); |
| 122 }; | 126 }; |
| 123 | 127 |
| 124 } // namespace cc | 128 } // namespace cc |
| 125 | 129 |
| 126 #endif // CC_RESOURCES_TILE_H_ | 130 #endif // CC_RESOURCES_TILE_H_ |
| OLD | NEW |