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 "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 gfx::Rect opaque_rect() const { return opaque_rect_; } | 103 gfx::Rect opaque_rect() const { return opaque_rect_; } |
104 float contents_scale() const { return contents_scale_; } | 104 float contents_scale() const { return contents_scale_; } |
105 gfx::Rect content_rect() const { return content_rect_; } | 105 gfx::Rect content_rect() const { return content_rect_; } |
106 | 106 |
107 int layer_id() const { return layer_id_; } | 107 int layer_id() const { return layer_id_; } |
108 | 108 |
109 int source_frame_number() const { return source_frame_number_; } | 109 int source_frame_number() const { return source_frame_number_; } |
110 | 110 |
111 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { | 111 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { |
112 DCHECK(pile->CanRaster(contents_scale_, content_rect_)); | 112 DCHECK(pile->CanRaster(contents_scale_, content_rect_)) |
| 113 << gfx::ScaleToEnclosingRect(content_rect_, 1.f / contents_scale_) |
| 114 .ToString(); |
113 picture_pile_ = pile; | 115 picture_pile_ = pile; |
114 } | 116 } |
115 | 117 |
116 size_t GPUMemoryUsageInBytes() const; | 118 size_t GPUMemoryUsageInBytes() const; |
117 | 119 |
118 gfx::Size size() const { return tile_size_.size(); } | 120 gfx::Size size() const { return tile_size_.size(); } |
119 | 121 |
120 RasterMode DetermineRasterModeForTree(WhichTree tree) const; | 122 RasterMode DetermineRasterModeForTree(WhichTree tree) const; |
121 RasterMode DetermineOverallRasterMode() const; | 123 RasterMode DetermineOverallRasterMode() const; |
122 | 124 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 175 |
174 Id id_; | 176 Id id_; |
175 static Id s_next_id_; | 177 static Id s_next_id_; |
176 | 178 |
177 DISALLOW_COPY_AND_ASSIGN(Tile); | 179 DISALLOW_COPY_AND_ASSIGN(Tile); |
178 }; | 180 }; |
179 | 181 |
180 } // namespace cc | 182 } // namespace cc |
181 | 183 |
182 #endif // CC_RESOURCES_TILE_H_ | 184 #endif // CC_RESOURCES_TILE_H_ |
OLD | NEW |