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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 class CC_EXPORT Tile { | 23 class CC_EXPORT Tile { |
24 public: | 24 public: |
25 class CC_EXPORT CreateInfo { | 25 class CC_EXPORT CreateInfo { |
26 public: | 26 public: |
27 const PictureLayerTiling* tiling; | 27 const PictureLayerTiling* tiling; |
28 int tiling_i_index; | 28 int tiling_i_index; |
29 int tiling_j_index; | 29 int tiling_j_index; |
30 gfx::Rect enclosing_layer_rect; | 30 gfx::Rect enclosing_layer_rect; |
31 gfx::Rect content_rect; | 31 gfx::Rect content_rect; |
32 gfx::SizeF raster_scales; | 32 float contents_scale; |
33 | 33 |
34 CreateInfo(const PictureLayerTiling* tiling, | 34 CreateInfo(const PictureLayerTiling* tiling, |
35 int tiling_i_index, | 35 int tiling_i_index, |
36 int tiling_j_index, | 36 int tiling_j_index, |
37 const gfx::Rect& enclosing_layer_rect, | 37 const gfx::Rect& enclosing_layer_rect, |
38 const gfx::Rect& content_rect, | 38 const gfx::Rect& content_rect, |
39 const gfx::SizeF& raster_scales) | 39 float contents_scale) |
40 : tiling(tiling), | 40 : tiling(tiling), |
41 tiling_i_index(tiling_i_index), | 41 tiling_i_index(tiling_i_index), |
42 tiling_j_index(tiling_j_index), | 42 tiling_j_index(tiling_j_index), |
43 enclosing_layer_rect(enclosing_layer_rect), | 43 enclosing_layer_rect(enclosing_layer_rect), |
44 content_rect(content_rect), | 44 content_rect(content_rect), |
45 raster_scales(raster_scales) {} | 45 contents_scale(contents_scale) {} |
46 }; | 46 }; |
47 | 47 |
48 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0, IS_OPAQUE = 1 << 1 }; | 48 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0, IS_OPAQUE = 1 << 1 }; |
49 | 49 |
50 typedef uint64_t Id; | 50 typedef uint64_t Id; |
51 | 51 |
52 ~Tile(); | 52 ~Tile(); |
53 | 53 |
54 Id id() const { | 54 Id id() const { |
55 return id_; | 55 return id_; |
(...skipping 13 matching lines...) Expand all Loading... |
69 return !!(flags_ & USE_PICTURE_ANALYSIS); | 69 return !!(flags_ & USE_PICTURE_ANALYSIS); |
70 } | 70 } |
71 | 71 |
72 bool is_opaque() const { return !!(flags_ & IS_OPAQUE); } | 72 bool is_opaque() const { return !!(flags_ & IS_OPAQUE); } |
73 | 73 |
74 void AsValueInto(base::trace_event::TracedValue* value) const; | 74 void AsValueInto(base::trace_event::TracedValue* value) const; |
75 | 75 |
76 const TileDrawInfo& draw_info() const { return draw_info_; } | 76 const TileDrawInfo& draw_info() const { return draw_info_; } |
77 TileDrawInfo& draw_info() { return draw_info_; } | 77 TileDrawInfo& draw_info() { return draw_info_; } |
78 | 78 |
79 float contents_scale_key() const { return raster_scales_.width(); } | 79 float contents_scale() const { return contents_scale_; } |
80 const gfx::SizeF& raster_scales() const { return raster_scales_; } | |
81 const gfx::Rect& content_rect() const { return content_rect_; } | 80 const gfx::Rect& content_rect() const { return content_rect_; } |
82 const gfx::Rect& enclosing_layer_rect() const { | 81 const gfx::Rect& enclosing_layer_rect() const { |
83 return enclosing_layer_rect_; | 82 return enclosing_layer_rect_; |
84 } | 83 } |
85 | 84 |
86 int layer_id() const { return layer_id_; } | 85 int layer_id() const { return layer_id_; } |
87 | 86 |
88 int source_frame_number() const { return source_frame_number_; } | 87 int source_frame_number() const { return source_frame_number_; } |
89 | 88 |
90 size_t GPUMemoryUsageInBytes() const; | 89 size_t GPUMemoryUsageInBytes() const; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 Tile(TileManager* tile_manager, | 125 Tile(TileManager* tile_manager, |
127 const CreateInfo& info, | 126 const CreateInfo& info, |
128 int layer_id, | 127 int layer_id, |
129 int source_frame_number, | 128 int source_frame_number, |
130 int flags); | 129 int flags); |
131 | 130 |
132 TileManager* const tile_manager_; | 131 TileManager* const tile_manager_; |
133 const PictureLayerTiling* tiling_; | 132 const PictureLayerTiling* tiling_; |
134 const gfx::Rect content_rect_; | 133 const gfx::Rect content_rect_; |
135 const gfx::Rect enclosing_layer_rect_; | 134 const gfx::Rect enclosing_layer_rect_; |
136 const gfx::SizeF raster_scales_; | 135 const float contents_scale_; |
137 | 136 |
138 TileDrawInfo draw_info_; | 137 TileDrawInfo draw_info_; |
139 | 138 |
140 const int layer_id_; | 139 const int layer_id_; |
141 const int source_frame_number_; | 140 const int source_frame_number_; |
142 const int flags_; | 141 const int flags_; |
143 const int tiling_i_index_; | 142 const int tiling_i_index_; |
144 const int tiling_j_index_; | 143 const int tiling_j_index_; |
145 bool required_for_activation_ : 1; | 144 bool required_for_activation_ : 1; |
146 bool required_for_draw_ : 1; | 145 bool required_for_draw_ : 1; |
147 bool is_solid_color_analysis_performed_ : 1; | 146 bool is_solid_color_analysis_performed_ : 1; |
148 | 147 |
149 Id id_; | 148 Id id_; |
150 | 149 |
151 // The rect bounding the changes in this Tile vs the previous tile it | 150 // The rect bounding the changes in this Tile vs the previous tile it |
152 // replaced. | 151 // replaced. |
153 gfx::Rect invalidated_content_rect_; | 152 gfx::Rect invalidated_content_rect_; |
154 // The |id_| of the Tile that was invalidated and replaced by this tile. | 153 // The |id_| of the Tile that was invalidated and replaced by this tile. |
155 Id invalidated_id_; | 154 Id invalidated_id_; |
156 | 155 |
157 unsigned scheduled_priority_; | 156 unsigned scheduled_priority_; |
158 scoped_refptr<TileTask> raster_task_; | 157 scoped_refptr<TileTask> raster_task_; |
159 | 158 |
160 DISALLOW_COPY_AND_ASSIGN(Tile); | 159 DISALLOW_COPY_AND_ASSIGN(Tile); |
161 }; | 160 }; |
162 | 161 |
163 } // namespace cc | 162 } // namespace cc |
164 | 163 |
165 #endif // CC_TILES_TILE_H_ | 164 #endif // CC_TILES_TILE_H_ |
OLD | NEW |