| 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/picture_layer_tiling.h" | 5 #include "cc/picture_layer_tiling.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "cc/math_util.h" | 8 #include "cc/math_util.h" |
| 9 #include "ui/gfx/point_conversions.h" | 9 #include "ui/gfx/point_conversions.h" |
| 10 #include "ui/gfx/rect_conversions.h" | 10 #include "ui/gfx/rect_conversions.h" |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 last_layer_bounds == current_layer_bounds && | 366 last_layer_bounds == current_layer_bounds && |
| 367 last_layer_content_bounds == current_layer_content_bounds && | 367 last_layer_content_bounds == current_layer_content_bounds && |
| 368 last_layer_contents_scale == current_layer_contents_scale) { | 368 last_layer_contents_scale == current_layer_contents_scale) { |
| 369 time_delta = current_frame_time - last_impl_frame_time_; | 369 time_delta = current_frame_time - last_impl_frame_time_; |
| 370 } | 370 } |
| 371 | 371 |
| 372 gfx::Rect viewport_in_content_space = | 372 gfx::Rect viewport_in_content_space = |
| 373 gfx::ToEnclosingRect(gfx::ScaleRect(viewport_in_layer_space, | 373 gfx::ToEnclosingRect(gfx::ScaleRect(viewport_in_layer_space, |
| 374 contents_scale_)); | 374 contents_scale_)); |
| 375 gfx::Rect inflated_rect = viewport_in_content_space; | 375 gfx::Rect inflated_rect = viewport_in_content_space; |
| 376 float adjusted_inset = TilePriority::kMaxDistanceInContentSpace / |
| 377 std::max(contents_scale_, 1.f); |
| 376 inflated_rect.Inset( | 378 inflated_rect.Inset( |
| 377 -TilePriority::kMaxDistanceInContentSpace, | 379 -adjusted_inset, |
| 378 -TilePriority::kMaxDistanceInContentSpace, | 380 -adjusted_inset, |
| 379 -TilePriority::kMaxDistanceInContentSpace, | 381 -adjusted_inset, |
| 380 -TilePriority::kMaxDistanceInContentSpace); | 382 -adjusted_inset); |
| 381 inflated_rect.Intersect(ContentRect()); | 383 inflated_rect.Intersect(ContentRect()); |
| 382 | 384 |
| 383 // Iterate through all of the tiles that were live last frame but will | 385 // Iterate through all of the tiles that were live last frame but will |
| 384 // not be live this frame, and mark them as being dead. | 386 // not be live this frame, and mark them as being dead. |
| 385 for (TilingData::DifferenceIterator iter(&tiling_data_, | 387 for (TilingData::DifferenceIterator iter(&tiling_data_, |
| 386 last_prioritized_rect_, | 388 last_prioritized_rect_, |
| 387 inflated_rect); | 389 inflated_rect); |
| 388 iter; | 390 iter; |
| 389 ++iter) { | 391 ++iter) { |
| 390 TileMap::iterator find = tiles_.find(iter.index()); | 392 TileMap::iterator find = tiles_.find(iter.index()); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 // and recreated, then that picture pile ref could exist indefinitely. To | 498 // and recreated, then that picture pile ref could exist indefinitely. To |
| 497 // prevent this, ask the client to update the pile to its own ref. This | 499 // prevent this, ask the client to update the pile to its own ref. This |
| 498 // will cause PicturePileImpls and their clones to get deleted once the | 500 // will cause PicturePileImpls and their clones to get deleted once the |
| 499 // corresponding PictureLayerImpl and any in flight raster jobs go out of | 501 // corresponding PictureLayerImpl and any in flight raster jobs go out of |
| 500 // scope. | 502 // scope. |
| 501 client_->UpdatePile(it->second); | 503 client_->UpdatePile(it->second); |
| 502 } | 504 } |
| 503 } | 505 } |
| 504 | 506 |
| 505 } // namespace cc | 507 } // namespace cc |
| OLD | NEW |