| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 float last_layer_contents_scale, | 357 float last_layer_contents_scale, |
| 358 float current_layer_contents_scale, | 358 float current_layer_contents_scale, |
| 359 const gfx::Transform& last_screen_transform, | 359 const gfx::Transform& last_screen_transform, |
| 360 const gfx::Transform& current_screen_transform, | 360 const gfx::Transform& current_screen_transform, |
| 361 int current_source_frame_number, | 361 int current_source_frame_number, |
| 362 double current_frame_time, | 362 double current_frame_time, |
| 363 bool store_screen_space_quads_on_tiles) { | 363 bool store_screen_space_quads_on_tiles) { |
| 364 if (ContentRect().IsEmpty()) | 364 if (ContentRect().IsEmpty()) |
| 365 return; | 365 return; |
| 366 | 366 |
| 367 bool first_update_in_new_source_frame = | 367 if (!needs_update_tile_priorities(current_source_frame_number, |
| 368 current_source_frame_number != last_source_frame_number_; | 368 current_frame_time)) |
| 369 | |
| 370 bool first_update_in_new_impl_frame = | |
| 371 current_frame_time != last_impl_frame_time_; | |
| 372 | |
| 373 // In pending tree, this is always called. We update priorities: | |
| 374 // - Immediately after a commit (first_update_in_new_source_frame). | |
| 375 // - On animation ticks after the first frame in the tree | |
| 376 // (first_update_in_new_impl_frame). | |
| 377 // In active tree, this is only called during draw. We update priorities: | |
| 378 // - On draw if properties were not already computed by the pending tree | |
| 379 // and activated for the frame (first_update_in_new_impl_frame). | |
| 380 if (!first_update_in_new_impl_frame && !first_update_in_new_source_frame) | |
| 381 return; | 369 return; |
| 382 | 370 |
| 383 double time_delta = 0; | 371 double time_delta = 0; |
| 384 if (last_impl_frame_time_ != 0 && | 372 if (last_impl_frame_time_ != 0 && |
| 385 last_layer_bounds == current_layer_bounds && | 373 last_layer_bounds == current_layer_bounds && |
| 386 last_layer_content_bounds == current_layer_content_bounds && | 374 last_layer_content_bounds == current_layer_content_bounds && |
| 387 last_layer_contents_scale == current_layer_contents_scale) { | 375 last_layer_contents_scale == current_layer_contents_scale) { |
| 388 time_delta = current_frame_time - last_impl_frame_time_; | 376 time_delta = current_frame_time - last_impl_frame_time_; |
| 389 } | 377 } |
| 390 | 378 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 // and recreated, then that picture pile ref could exist indefinitely. To | 512 // and recreated, then that picture pile ref could exist indefinitely. To |
| 525 // prevent this, ask the client to update the pile to its own ref. This | 513 // prevent this, ask the client to update the pile to its own ref. This |
| 526 // will cause PicturePileImpls and their clones to get deleted once the | 514 // will cause PicturePileImpls and their clones to get deleted once the |
| 527 // corresponding PictureLayerImpl and any in flight raster jobs go out of | 515 // corresponding PictureLayerImpl and any in flight raster jobs go out of |
| 528 // scope. | 516 // scope. |
| 529 client_->UpdatePile(it->second); | 517 client_->UpdatePile(it->second); |
| 530 } | 518 } |
| 531 } | 519 } |
| 532 | 520 |
| 533 } // namespace cc | 521 } // namespace cc |
| OLD | NEW |