| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 "SourceFrameNumber", | 502 "SourceFrameNumber", |
| 503 source_frame_number_); | 503 source_frame_number_); |
| 504 scoped_ptr<OcclusionTracker<LayerImpl> > occlusion_tracker; | 504 scoped_ptr<OcclusionTracker<LayerImpl> > occlusion_tracker; |
| 505 if (settings().use_occlusion_for_tile_prioritization) { | 505 if (settings().use_occlusion_for_tile_prioritization) { |
| 506 occlusion_tracker.reset(new OcclusionTracker<LayerImpl>( | 506 occlusion_tracker.reset(new OcclusionTracker<LayerImpl>( |
| 507 root_layer()->render_surface()->content_rect())); | 507 root_layer()->render_surface()->content_rect())); |
| 508 occlusion_tracker->set_minimum_tracking_size( | 508 occlusion_tracker->set_minimum_tracking_size( |
| 509 settings().minimum_occlusion_tracking_size); | 509 settings().minimum_occlusion_tracking_size); |
| 510 } | 510 } |
| 511 | 511 |
| 512 bool draw_properties_valid_for_tile_priority = |
| 513 (layer_tree_host_impl_->GetDrawMode() != |
| 514 DRAW_MODE_RESOURCELESS_SOFTWARE); |
| 515 |
| 512 // LayerIterator is used here instead of CallFunctionForSubtree to only | 516 // LayerIterator is used here instead of CallFunctionForSubtree to only |
| 513 // UpdateTilePriorities on layers that will be visible (and thus have valid | 517 // UpdateTilePriorities on layers that will be visible (and thus have valid |
| 514 // draw properties) and not because any ordering is required. | 518 // draw properties) and not because any ordering is required. |
| 515 typedef LayerIterator<LayerImpl> LayerIteratorType; | 519 typedef LayerIterator<LayerImpl> LayerIteratorType; |
| 516 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); | 520 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); |
| 517 for (LayerIteratorType it = | 521 for (LayerIteratorType it = |
| 518 LayerIteratorType::Begin(&render_surface_layer_list_); | 522 LayerIteratorType::Begin(&render_surface_layer_list_); |
| 519 it != end; | 523 it != end; |
| 520 ++it) { | 524 ++it) { |
| 521 if (occlusion_tracker) | 525 if (occlusion_tracker) |
| 522 occlusion_tracker->EnterLayer(it); | 526 occlusion_tracker->EnterLayer(it); |
| 523 | 527 |
| 524 LayerImpl* layer = *it; | 528 LayerImpl* layer = *it; |
| 525 const Occlusion& occlusion_in_content_space = | 529 const Occlusion& occlusion_in_content_space = |
| 526 occlusion_tracker ? occlusion_tracker->GetCurrentOcclusionForLayer( | 530 occlusion_tracker ? occlusion_tracker->GetCurrentOcclusionForLayer( |
| 527 layer->draw_transform()) | 531 layer->draw_transform()) |
| 528 : Occlusion(); | 532 : Occlusion(); |
| 529 | 533 |
| 530 if (it.represents_itself()) | 534 if (it.represents_itself()) { |
| 531 layer->UpdateTiles(occlusion_in_content_space); | 535 layer->UpdateTiles(occlusion_in_content_space, |
| 536 draw_properties_valid_for_tile_priority); |
| 537 } |
| 532 | 538 |
| 533 if (!it.represents_contributing_render_surface()) { | 539 if (!it.represents_contributing_render_surface()) { |
| 534 if (occlusion_tracker) | 540 if (occlusion_tracker) |
| 535 occlusion_tracker->LeaveLayer(it); | 541 occlusion_tracker->LeaveLayer(it); |
| 536 continue; | 542 continue; |
| 537 } | 543 } |
| 538 | 544 |
| 539 if (layer->mask_layer()) | 545 if (layer->mask_layer()) { |
| 540 layer->mask_layer()->UpdateTiles(occlusion_in_content_space); | 546 layer->mask_layer()->UpdateTiles( |
| 541 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) | 547 occlusion_in_content_space, |
| 548 draw_properties_valid_for_tile_priority); |
| 549 } |
| 550 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) { |
| 542 layer->replica_layer()->mask_layer()->UpdateTiles( | 551 layer->replica_layer()->mask_layer()->UpdateTiles( |
| 543 occlusion_in_content_space); | 552 occlusion_in_content_space, |
| 553 draw_properties_valid_for_tile_priority); |
| 554 } |
| 544 | 555 |
| 545 if (occlusion_tracker) | 556 if (occlusion_tracker) |
| 546 occlusion_tracker->LeaveLayer(it); | 557 occlusion_tracker->LeaveLayer(it); |
| 547 } | 558 } |
| 548 } | 559 } |
| 549 | 560 |
| 550 DCHECK(!needs_update_draw_properties_) << | 561 DCHECK(!needs_update_draw_properties_) << |
| 551 "CalcDrawProperties should not set_needs_update_draw_properties()"; | 562 "CalcDrawProperties should not set_needs_update_draw_properties()"; |
| 552 return true; | 563 return true; |
| 553 } | 564 } |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 | 1454 |
| 1444 void LayerTreeImpl::InputScrollAnimationFinished() { | 1455 void LayerTreeImpl::InputScrollAnimationFinished() { |
| 1445 layer_tree_host_impl_->ScrollEnd(); | 1456 layer_tree_host_impl_->ScrollEnd(); |
| 1446 } | 1457 } |
| 1447 | 1458 |
| 1448 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { | 1459 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { |
| 1449 return proxy()->blocking_main_thread_task_runner(); | 1460 return proxy()->blocking_main_thread_task_runner(); |
| 1450 } | 1461 } |
| 1451 | 1462 |
| 1452 } // namespace cc | 1463 } // namespace cc |
| OLD | NEW |