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/base/ref_counted_managed.h" | 9 #include "cc/base/ref_counted_managed.h" |
10 #include "cc/resources/raster_source.h" | 10 #include "cc/resources/raster_source.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void set_required_for_draw(bool is_required) { | 81 void set_required_for_draw(bool is_required) { |
82 required_for_draw_ = is_required; | 82 required_for_draw_ = is_required; |
83 } | 83 } |
84 | 84 |
85 bool use_picture_analysis() const { | 85 bool use_picture_analysis() const { |
86 return !!(flags_ & USE_PICTURE_ANALYSIS); | 86 return !!(flags_ & USE_PICTURE_ANALYSIS); |
87 } | 87 } |
88 | 88 |
89 bool HasResource() const { return draw_info_.has_resource(); } | 89 bool HasResource() const { return draw_info_.has_resource(); } |
90 bool NeedsRaster() const { | 90 bool NeedsRaster() const { |
91 return draw_info_.mode() == TileDrawInfo::OOM_MODE || | 91 return draw_info_.mode() == TileDrawInfo::PICTURE_PILE_MODE || |
92 !draw_info_.IsReadyToDraw(); | 92 !draw_info_.IsReadyToDraw(); |
93 } | 93 } |
94 | 94 |
95 void AsValueInto(base::trace_event::TracedValue* dict) const; | 95 void AsValueInto(base::trace_event::TracedValue* dict) const; |
96 | 96 |
97 inline bool IsReadyToDraw() const { return draw_info_.IsReadyToDraw(); } | 97 inline bool IsReadyToDraw() const { return draw_info_.IsReadyToDraw(); } |
98 | 98 |
99 const TileDrawInfo& draw_info() const { return draw_info_; } | 99 const TileDrawInfo& draw_info() const { return draw_info_; } |
100 | 100 |
101 TileDrawInfo& draw_info() { return draw_info_; } | 101 TileDrawInfo& draw_info() { return draw_info_; } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 int source_frame_number, | 143 int source_frame_number, |
144 int flags); | 144 int flags); |
145 ~Tile(); | 145 ~Tile(); |
146 | 146 |
147 bool HasRasterTask() const { return !!raster_task_.get(); } | 147 bool HasRasterTask() const { return !!raster_task_.get(); } |
148 | 148 |
149 scoped_refptr<RasterSource> raster_source_; | 149 scoped_refptr<RasterSource> raster_source_; |
150 gfx::Size desired_texture_size_; | 150 gfx::Size desired_texture_size_; |
151 gfx::Rect content_rect_; | 151 gfx::Rect content_rect_; |
152 float contents_scale_; | 152 float contents_scale_; |
153 bool is_occluded_[LAST_TREE + 1]; | 153 bool is_occluded_[NUM_TREES]; |
154 | 154 |
155 TilePriority priority_[LAST_TREE + 1]; | 155 TilePriority priority_[NUM_TREES]; |
156 TileDrawInfo draw_info_; | 156 TileDrawInfo draw_info_; |
157 | 157 |
158 int layer_id_; | 158 int layer_id_; |
159 int source_frame_number_; | 159 int source_frame_number_; |
160 int flags_; | 160 int flags_; |
161 int tiling_i_index_; | 161 int tiling_i_index_; |
162 int tiling_j_index_; | 162 int tiling_j_index_; |
163 bool is_shared_ : 1; | 163 bool is_shared_ : 1; |
164 bool required_for_activation_ : 1; | 164 bool required_for_activation_ : 1; |
165 bool required_for_draw_ : 1; | 165 bool required_for_draw_ : 1; |
166 | 166 |
167 Id id_; | 167 Id id_; |
168 static Id s_next_id_; | 168 static Id s_next_id_; |
169 | 169 |
170 unsigned scheduled_priority_; | 170 unsigned scheduled_priority_; |
171 | 171 |
172 scoped_refptr<RasterTask> raster_task_; | 172 scoped_refptr<RasterTask> raster_task_; |
173 | 173 |
174 DISALLOW_COPY_AND_ASSIGN(Tile); | 174 DISALLOW_COPY_AND_ASSIGN(Tile); |
175 }; | 175 }; |
176 | 176 |
177 } // namespace cc | 177 } // namespace cc |
178 | 178 |
179 #endif // CC_RESOURCES_TILE_H_ | 179 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |