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 "cc/resources/raster_source.h" | 9 #include "cc/resources/raster_source.h" |
10 #include "cc/resources/tile_draw_info.h" | 10 #include "cc/resources/tile_draw_info.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 gfx::Size desired_texture_size() const { return desired_texture_size_; } | 84 gfx::Size desired_texture_size() const { return desired_texture_size_; } |
85 | 85 |
86 void set_tiling_index(int i, int j) { | 86 void set_tiling_index(int i, int j) { |
87 tiling_i_index_ = i; | 87 tiling_i_index_ = i; |
88 tiling_j_index_ = j; | 88 tiling_j_index_ = j; |
89 } | 89 } |
90 int tiling_i_index() const { return tiling_i_index_; } | 90 int tiling_i_index() const { return tiling_i_index_; } |
91 int tiling_j_index() const { return tiling_j_index_; } | 91 int tiling_j_index() const { return tiling_j_index_; } |
92 | 92 |
| 93 void SetInvalidatedRect(const gfx::Rect& invalid_content_rect) { |
| 94 invalidated_content_rect_ = invalid_content_rect; |
| 95 } |
| 96 void SetInvalidatedId(Id previous_tile_id) { |
| 97 invalidated_id_ = previous_tile_id; |
| 98 } |
| 99 |
| 100 Id invalidated_id() const { return invalidated_id_; } |
| 101 const gfx::Rect& invalidated_content_rect() const { |
| 102 return invalidated_content_rect_; |
| 103 } |
| 104 |
93 private: | 105 private: |
94 friend class TileManager; | 106 friend class TileManager; |
95 friend class FakeTileManager; | 107 friend class FakeTileManager; |
96 friend class FakePictureLayerImpl; | 108 friend class FakePictureLayerImpl; |
97 | 109 |
98 // Methods called by by tile manager. | 110 // Methods called by by tile manager. |
99 Tile(TileManager* tile_manager, | 111 Tile(TileManager* tile_manager, |
100 RasterSource* raster_source, | 112 RasterSource* raster_source, |
101 const gfx::Size& desired_texture_size, | 113 const gfx::Size& desired_texture_size, |
102 const gfx::Rect& content_rect, | 114 const gfx::Rect& content_rect, |
(...skipping 17 matching lines...) Expand all Loading... |
120 int source_frame_number_; | 132 int source_frame_number_; |
121 int flags_; | 133 int flags_; |
122 int tiling_i_index_; | 134 int tiling_i_index_; |
123 int tiling_j_index_; | 135 int tiling_j_index_; |
124 bool required_for_activation_ : 1; | 136 bool required_for_activation_ : 1; |
125 bool required_for_draw_ : 1; | 137 bool required_for_draw_ : 1; |
126 | 138 |
127 Id id_; | 139 Id id_; |
128 static Id s_next_id_; | 140 static Id s_next_id_; |
129 | 141 |
| 142 // The rect bounding the changes in this Tile vs the previous tile it |
| 143 // replaced. |
| 144 gfx::Rect invalidated_content_rect_; |
| 145 // The |id_| of the Tile that was invalidated and replaced by this tile. |
| 146 Id invalidated_id_; |
| 147 |
130 unsigned scheduled_priority_; | 148 unsigned scheduled_priority_; |
131 | 149 |
132 scoped_refptr<RasterTask> raster_task_; | 150 scoped_refptr<RasterTask> raster_task_; |
133 | 151 |
134 DISALLOW_COPY_AND_ASSIGN(Tile); | 152 DISALLOW_COPY_AND_ASSIGN(Tile); |
135 }; | 153 }; |
136 | 154 |
137 using ScopedTilePtr = scoped_ptr<Tile, Tile::Deleter>; | 155 using ScopedTilePtr = scoped_ptr<Tile, Tile::Deleter>; |
138 | 156 |
139 } // namespace cc | 157 } // namespace cc |
140 | 158 |
141 #endif // CC_RESOURCES_TILE_H_ | 159 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |