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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 | 69 |
70 private: | 70 private: |
71 // Methods called by by tile manager. | 71 // Methods called by by tile manager. |
72 friend class TileManager; | 72 friend class TileManager; |
73 friend class BinComparator; | 73 friend class BinComparator; |
74 ManagedTileState& managed_state() { return managed_state_; } | 74 ManagedTileState& managed_state() { return managed_state_; } |
75 const ManagedTileState& managed_state() const { return managed_state_; } | 75 const ManagedTileState& managed_state() const { return managed_state_; } |
76 | 76 |
77 inline size_t bytes_consumed_if_allocated() const { | 77 inline size_t bytes_consumed_if_allocated() const { |
78 DCHECK(format_ == GL_RGBA); | |
79 return 4 * tile_size_.width() * tile_size_.height(); | 78 return 4 * tile_size_.width() * tile_size_.height(); |
80 } | 79 } |
81 | 80 |
82 | 81 |
83 // Normal private methods. | 82 // Normal private methods. |
84 friend class base::RefCounted<Tile>; | 83 friend class base::RefCounted<Tile>; |
85 ~Tile(); | 84 ~Tile(); |
86 | 85 |
87 TileManager* tile_manager_; | 86 TileManager* tile_manager_; |
88 scoped_refptr<PicturePileImpl> picture_pile_; | 87 scoped_refptr<PicturePileImpl> picture_pile_; |
89 gfx::Rect tile_size_; | 88 gfx::Rect tile_size_; |
90 GLenum format_; | |
91 gfx::Rect content_rect_; | 89 gfx::Rect content_rect_; |
92 float contents_scale_; | 90 float contents_scale_; |
93 gfx::Rect opaque_rect_; | 91 gfx::Rect opaque_rect_; |
94 | 92 |
95 TilePriority priority_[NUM_BIN_PRIORITIES]; | 93 TilePriority priority_[NUM_BIN_PRIORITIES]; |
96 ManagedTileState managed_state_; | 94 ManagedTileState managed_state_; |
97 int layer_id_; | 95 int layer_id_; |
98 | 96 |
99 DISALLOW_COPY_AND_ASSIGN(Tile); | 97 DISALLOW_COPY_AND_ASSIGN(Tile); |
100 }; | 98 }; |
101 | 99 |
102 } // namespace cc | 100 } // namespace cc |
103 | 101 |
104 #endif // CC_RESOURCES_TILE_H_ | 102 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |