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/managed_tile_state.h" | 10 #include "cc/resources/managed_tile_state.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 ManagedTileState::DrawInfo& draw_info() { return managed_state_.draw_info; } | 116 ManagedTileState::DrawInfo& draw_info() { return managed_state_.draw_info; } |
117 | 117 |
118 float contents_scale() const { return contents_scale_; } | 118 float contents_scale() const { return contents_scale_; } |
119 gfx::Rect content_rect() const { return content_rect_; } | 119 gfx::Rect content_rect() const { return content_rect_; } |
120 | 120 |
121 int layer_id() const { return layer_id_; } | 121 int layer_id() const { return layer_id_; } |
122 | 122 |
123 int source_frame_number() const { return source_frame_number_; } | 123 int source_frame_number() const { return source_frame_number_; } |
124 | 124 |
| 125 TileResolution resolution() const { return managed_state_.resolution; } |
| 126 |
125 void set_raster_source(scoped_refptr<RasterSource> raster_source) { | 127 void set_raster_source(scoped_refptr<RasterSource> raster_source) { |
126 DCHECK(raster_source->CoversRect(content_rect_, contents_scale_)) | 128 DCHECK(raster_source->CoversRect(content_rect_, contents_scale_)) |
127 << "Recording rect: " | 129 << "Recording rect: " |
128 << gfx::ScaleToEnclosingRect(content_rect_, 1.f / contents_scale_) | 130 << gfx::ScaleToEnclosingRect(content_rect_, 1.f / contents_scale_) |
129 .ToString(); | 131 .ToString(); |
130 raster_source_ = raster_source; | 132 raster_source_ = raster_source; |
131 } | 133 } |
132 | 134 |
133 size_t GPUMemoryUsageInBytes() const; | 135 size_t GPUMemoryUsageInBytes() const; |
134 | 136 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 186 |
185 Id id_; | 187 Id id_; |
186 static Id s_next_id_; | 188 static Id s_next_id_; |
187 | 189 |
188 DISALLOW_COPY_AND_ASSIGN(Tile); | 190 DISALLOW_COPY_AND_ASSIGN(Tile); |
189 }; | 191 }; |
190 | 192 |
191 } // namespace cc | 193 } // namespace cc |
192 | 194 |
193 #endif // CC_RESOURCES_TILE_H_ | 195 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |