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 17 matching lines...) Expand all Loading... |
28 void operator()(Tile* tile) const; | 28 void operator()(Tile* tile) const; |
29 }; | 29 }; |
30 | 30 |
31 class CC_EXPORT CreateInfo { | 31 class CC_EXPORT CreateInfo { |
32 public: | 32 public: |
33 int tiling_i_index; | 33 int tiling_i_index; |
34 int tiling_j_index; | 34 int tiling_j_index; |
35 gfx::Rect enclosing_layer_rect; | 35 gfx::Rect enclosing_layer_rect; |
36 gfx::Rect content_rect; | 36 gfx::Rect content_rect; |
37 float contents_scale; | 37 float contents_scale; |
| 38 gfx::Vector2dF contents_translation; |
38 | 39 |
39 CreateInfo(int tiling_i_index, | 40 CreateInfo(int tiling_i_index, |
40 int tiling_j_index, | 41 int tiling_j_index, |
41 const gfx::Rect& enclosing_layer_rect, | 42 const gfx::Rect& enclosing_layer_rect, |
42 const gfx::Rect& content_rect, | 43 const gfx::Rect& content_rect, |
43 float contents_scale) | 44 float contents_scale, |
| 45 const gfx::Vector2dF contents_translation) |
44 : tiling_i_index(tiling_i_index), | 46 : tiling_i_index(tiling_i_index), |
45 tiling_j_index(tiling_j_index), | 47 tiling_j_index(tiling_j_index), |
46 enclosing_layer_rect(enclosing_layer_rect), | 48 enclosing_layer_rect(enclosing_layer_rect), |
47 content_rect(content_rect), | 49 content_rect(content_rect), |
48 contents_scale(contents_scale) {} | 50 contents_scale(contents_scale), |
| 51 contents_translation(contents_translation) {} |
49 }; | 52 }; |
50 | 53 |
51 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0, IS_OPAQUE = 1 << 1 }; | 54 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0, IS_OPAQUE = 1 << 1 }; |
52 | 55 |
53 typedef uint64_t Id; | 56 typedef uint64_t Id; |
54 | 57 |
55 Id id() const { | 58 Id id() const { |
56 return id_; | 59 return id_; |
57 } | 60 } |
58 | 61 |
(...skipping 12 matching lines...) Expand all Loading... |
71 } | 74 } |
72 | 75 |
73 bool is_opaque() const { return !!(flags_ & IS_OPAQUE); } | 76 bool is_opaque() const { return !!(flags_ & IS_OPAQUE); } |
74 | 77 |
75 void AsValueInto(base::trace_event::TracedValue* value) const; | 78 void AsValueInto(base::trace_event::TracedValue* value) const; |
76 | 79 |
77 const TileDrawInfo& draw_info() const { return draw_info_; } | 80 const TileDrawInfo& draw_info() const { return draw_info_; } |
78 TileDrawInfo& draw_info() { return draw_info_; } | 81 TileDrawInfo& draw_info() { return draw_info_; } |
79 | 82 |
80 float contents_scale() const { return contents_scale_; } | 83 float contents_scale() const { return contents_scale_; } |
| 84 const gfx::Vector2dF& contents_translation() const { |
| 85 return contents_translation_; |
| 86 } |
81 const gfx::Rect& content_rect() const { return content_rect_; } | 87 const gfx::Rect& content_rect() const { return content_rect_; } |
82 const gfx::Rect& enclosing_layer_rect() const { | 88 const gfx::Rect& enclosing_layer_rect() const { |
83 return enclosing_layer_rect_; | 89 return enclosing_layer_rect_; |
84 } | 90 } |
85 | 91 |
86 int layer_id() const { return layer_id_; } | 92 int layer_id() const { return layer_id_; } |
87 | 93 |
88 int source_frame_number() const { return source_frame_number_; } | 94 int source_frame_number() const { return source_frame_number_; } |
89 | 95 |
90 size_t GPUMemoryUsageInBytes() const; | 96 size_t GPUMemoryUsageInBytes() const; |
(...skipping 26 matching lines...) Expand all Loading... |
117 const CreateInfo& info, | 123 const CreateInfo& info, |
118 int layer_id, | 124 int layer_id, |
119 int source_frame_number, | 125 int source_frame_number, |
120 int flags); | 126 int flags); |
121 ~Tile(); | 127 ~Tile(); |
122 | 128 |
123 TileManager* const tile_manager_; | 129 TileManager* const tile_manager_; |
124 const gfx::Rect content_rect_; | 130 const gfx::Rect content_rect_; |
125 const gfx::Rect enclosing_layer_rect_; | 131 const gfx::Rect enclosing_layer_rect_; |
126 const float contents_scale_; | 132 const float contents_scale_; |
| 133 const gfx::Vector2dF contents_translation_; |
127 | 134 |
128 TileDrawInfo draw_info_; | 135 TileDrawInfo draw_info_; |
129 | 136 |
130 const int layer_id_; | 137 const int layer_id_; |
131 const int source_frame_number_; | 138 const int source_frame_number_; |
132 const int flags_; | 139 const int flags_; |
133 const int tiling_i_index_; | 140 const int tiling_i_index_; |
134 const int tiling_j_index_; | 141 const int tiling_j_index_; |
135 bool required_for_activation_ : 1; | 142 bool required_for_activation_ : 1; |
136 bool required_for_draw_ : 1; | 143 bool required_for_draw_ : 1; |
(...skipping 11 matching lines...) Expand all Loading... |
148 scoped_refptr<TileTask> raster_task_; | 155 scoped_refptr<TileTask> raster_task_; |
149 | 156 |
150 DISALLOW_COPY_AND_ASSIGN(Tile); | 157 DISALLOW_COPY_AND_ASSIGN(Tile); |
151 }; | 158 }; |
152 | 159 |
153 using ScopedTilePtr = std::unique_ptr<Tile, Tile::Deleter>; | 160 using ScopedTilePtr = std::unique_ptr<Tile, Tile::Deleter>; |
154 | 161 |
155 } // namespace cc | 162 } // namespace cc |
156 | 163 |
157 #endif // CC_TILES_TILE_H_ | 164 #endif // CC_TILES_TILE_H_ |
OLD | NEW |