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 #include "cc/resources/picture_layer_tiling_set.h" | 5 #include "cc/resources/picture_layer_tiling_set.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 return *this; | 302 return *this; |
303 } | 303 } |
304 | 304 |
305 PictureLayerTilingSet::CoverageIterator::operator bool() const { | 305 PictureLayerTilingSet::CoverageIterator::operator bool() const { |
306 return current_tiling_ < static_cast<int>(set_->tilings_.size()) || | 306 return current_tiling_ < static_cast<int>(set_->tilings_.size()) || |
307 region_iter_.has_rect(); | 307 region_iter_.has_rect(); |
308 } | 308 } |
309 | 309 |
310 void PictureLayerTilingSet::UpdateTilePriorities( | 310 void PictureLayerTilingSet::UpdateTilePriorities( |
311 WhichTree tree, | 311 WhichTree tree, |
312 const gfx::Rect& visible_content_rect, | 312 const gfx::Rect& visible_layer_rect, |
313 float layer_contents_scale, | 313 float layer_contents_scale, |
314 double current_frame_time_in_seconds) { | 314 double current_frame_time_in_seconds) { |
315 gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect( | |
316 visible_content_rect, 1.f / layer_contents_scale); | |
317 | |
318 for (size_t i = 0; i < tilings_.size(); ++i) { | 315 for (size_t i = 0; i < tilings_.size(); ++i) { |
319 tilings_[i]->UpdateTilePriorities(tree, | 316 tilings_[i]->UpdateTilePriorities(tree, |
320 visible_layer_rect, | 317 visible_layer_rect, |
321 layer_contents_scale, | 318 layer_contents_scale, |
322 current_frame_time_in_seconds); | 319 current_frame_time_in_seconds); |
323 } | 320 } |
324 } | 321 } |
325 | 322 |
326 void PictureLayerTilingSet::DidBecomeActive() { | 323 void PictureLayerTilingSet::DidBecomeActive() { |
327 for (size_t i = 0; i < tilings_.size(); ++i) | 324 for (size_t i = 0; i < tilings_.size(); ++i) |
(...skipping 13 matching lines...) Expand all Loading... |
341 } | 338 } |
342 | 339 |
343 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { | 340 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { |
344 size_t amount = 0; | 341 size_t amount = 0; |
345 for (size_t i = 0; i < tilings_.size(); ++i) | 342 for (size_t i = 0; i < tilings_.size(); ++i) |
346 amount += tilings_[i]->GPUMemoryUsageInBytes(); | 343 amount += tilings_[i]->GPUMemoryUsageInBytes(); |
347 return amount; | 344 return amount; |
348 } | 345 } |
349 | 346 |
350 } // namespace cc | 347 } // namespace cc |
OLD | NEW |