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