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_TILES_TILE_H_ | 5 #ifndef CC_TILES_TILE_H_ |
6 #define CC_TILES_TILE_H_ | 6 #define CC_TILES_TILE_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "cc/tiles/tile_draw_info.h" | 9 #include "cc/tiles/tile_draw_info.h" |
10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 gfx::Size desired_texture_size() const { return desired_texture_size_; } | 62 gfx::Size desired_texture_size() const { return desired_texture_size_; } |
63 | 63 |
64 void set_tiling_index(int i, int j) { | 64 void set_tiling_index(int i, int j) { |
65 tiling_i_index_ = i; | 65 tiling_i_index_ = i; |
66 tiling_j_index_ = j; | 66 tiling_j_index_ = j; |
67 } | 67 } |
68 int tiling_i_index() const { return tiling_i_index_; } | 68 int tiling_i_index() const { return tiling_i_index_; } |
69 int tiling_j_index() const { return tiling_j_index_; } | 69 int tiling_j_index() const { return tiling_j_index_; } |
70 | 70 |
| 71 void SetInvalidated(const gfx::Rect& invalid_content_rect, |
| 72 Id previous_tile_id) { |
| 73 invalidated_content_rect_ = invalid_content_rect; |
| 74 invalidated_id_ = previous_tile_id; |
| 75 } |
| 76 |
| 77 Id invalidated_id() const { return invalidated_id_; } |
| 78 const gfx::Rect& invalidated_content_rect() const { |
| 79 return invalidated_content_rect_; |
| 80 } |
| 81 |
71 private: | 82 private: |
72 friend class TileManager; | 83 friend class TileManager; |
73 friend class FakeTileManager; | 84 friend class FakeTileManager; |
74 friend class FakePictureLayerImpl; | 85 friend class FakePictureLayerImpl; |
75 | 86 |
76 // Methods called by by tile manager. | 87 // Methods called by by tile manager. |
77 Tile(TileManager* tile_manager, | 88 Tile(TileManager* tile_manager, |
78 const gfx::Size& desired_texture_size, | 89 const gfx::Size& desired_texture_size, |
79 const gfx::Rect& content_rect, | 90 const gfx::Rect& content_rect, |
80 float contents_scale, | 91 float contents_scale, |
(...skipping 15 matching lines...) Expand all Loading... |
96 int source_frame_number_; | 107 int source_frame_number_; |
97 int flags_; | 108 int flags_; |
98 int tiling_i_index_; | 109 int tiling_i_index_; |
99 int tiling_j_index_; | 110 int tiling_j_index_; |
100 bool required_for_activation_ : 1; | 111 bool required_for_activation_ : 1; |
101 bool required_for_draw_ : 1; | 112 bool required_for_draw_ : 1; |
102 | 113 |
103 Id id_; | 114 Id id_; |
104 static Id s_next_id_; | 115 static Id s_next_id_; |
105 | 116 |
| 117 // The rect bounding the changes in this Tile vs the previous tile it |
| 118 // replaced. |
| 119 gfx::Rect invalidated_content_rect_; |
| 120 // The |id_| of the Tile that was invalidated and replaced by this tile. |
| 121 Id invalidated_id_; |
| 122 |
106 unsigned scheduled_priority_; | 123 unsigned scheduled_priority_; |
107 | 124 |
108 scoped_refptr<RasterTask> raster_task_; | 125 scoped_refptr<RasterTask> raster_task_; |
109 | 126 |
110 DISALLOW_COPY_AND_ASSIGN(Tile); | 127 DISALLOW_COPY_AND_ASSIGN(Tile); |
111 }; | 128 }; |
112 | 129 |
113 using ScopedTilePtr = scoped_ptr<Tile, Tile::Deleter>; | 130 using ScopedTilePtr = scoped_ptr<Tile, Tile::Deleter>; |
114 | 131 |
115 } // namespace cc | 132 } // namespace cc |
116 | 133 |
117 #endif // CC_TILES_TILE_H_ | 134 #endif // CC_TILES_TILE_H_ |
OLD | NEW |