| 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 resourceless_software_draw = (layer_tree_host_impl_->GetDrawMode() == |
| 513 DRAW_MODE_RESOURCELESS_SOFTWARE); |
| 514 |
| 512 // LayerIterator is used here instead of CallFunctionForSubtree to only | 515 // LayerIterator is used here instead of CallFunctionForSubtree to only |
| 513 // UpdateTilePriorities on layers that will be visible (and thus have valid | 516 // UpdateTilePriorities on layers that will be visible (and thus have valid |
| 514 // draw properties) and not because any ordering is required. | 517 // draw properties) and not because any ordering is required. |
| 515 typedef LayerIterator<LayerImpl> LayerIteratorType; | 518 typedef LayerIterator<LayerImpl> LayerIteratorType; |
| 516 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); | 519 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); |
| 517 for (LayerIteratorType it = | 520 for (LayerIteratorType it = |
| 518 LayerIteratorType::Begin(&render_surface_layer_list_); | 521 LayerIteratorType::Begin(&render_surface_layer_list_); |
| 519 it != end; | 522 it != end; |
| 520 ++it) { | 523 ++it) { |
| 521 if (occlusion_tracker) | 524 if (occlusion_tracker) |
| 522 occlusion_tracker->EnterLayer(it); | 525 occlusion_tracker->EnterLayer(it); |
| 523 | 526 |
| 524 LayerImpl* layer = *it; | 527 LayerImpl* layer = *it; |
| 525 const Occlusion& occlusion_in_content_space = | 528 const Occlusion& occlusion_in_content_space = |
| 526 occlusion_tracker ? occlusion_tracker->GetCurrentOcclusionForLayer( | 529 occlusion_tracker ? occlusion_tracker->GetCurrentOcclusionForLayer( |
| 527 layer->draw_transform()) | 530 layer->draw_transform()) |
| 528 : Occlusion(); | 531 : Occlusion(); |
| 529 | 532 |
| 530 if (it.represents_itself()) | 533 if (it.represents_itself()) { |
| 531 layer->UpdateTiles(occlusion_in_content_space); | 534 layer->UpdateTiles(occlusion_in_content_space, |
| 535 resourceless_software_draw); |
| 536 } |
| 532 | 537 |
| 533 if (!it.represents_contributing_render_surface()) { | 538 if (!it.represents_contributing_render_surface()) { |
| 534 if (occlusion_tracker) | 539 if (occlusion_tracker) |
| 535 occlusion_tracker->LeaveLayer(it); | 540 occlusion_tracker->LeaveLayer(it); |
| 536 continue; | 541 continue; |
| 537 } | 542 } |
| 538 | 543 |
| 539 if (layer->mask_layer()) | 544 if (layer->mask_layer()) { |
| 540 layer->mask_layer()->UpdateTiles(occlusion_in_content_space); | 545 layer->mask_layer()->UpdateTiles(occlusion_in_content_space, |
| 541 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) | 546 resourceless_software_draw); |
| 547 } |
| 548 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) { |
| 542 layer->replica_layer()->mask_layer()->UpdateTiles( | 549 layer->replica_layer()->mask_layer()->UpdateTiles( |
| 543 occlusion_in_content_space); | 550 occlusion_in_content_space, resourceless_software_draw); |
| 551 } |
| 544 | 552 |
| 545 if (occlusion_tracker) | 553 if (occlusion_tracker) |
| 546 occlusion_tracker->LeaveLayer(it); | 554 occlusion_tracker->LeaveLayer(it); |
| 547 } | 555 } |
| 548 } | 556 } |
| 549 | 557 |
| 550 DCHECK(!needs_update_draw_properties_) << | 558 DCHECK(!needs_update_draw_properties_) << |
| 551 "CalcDrawProperties should not set_needs_update_draw_properties()"; | 559 "CalcDrawProperties should not set_needs_update_draw_properties()"; |
| 552 return true; | 560 return true; |
| 553 } | 561 } |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 | 1451 |
| 1444 void LayerTreeImpl::InputScrollAnimationFinished() { | 1452 void LayerTreeImpl::InputScrollAnimationFinished() { |
| 1445 layer_tree_host_impl_->ScrollEnd(); | 1453 layer_tree_host_impl_->ScrollEnd(); |
| 1446 } | 1454 } |
| 1447 | 1455 |
| 1448 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { | 1456 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { |
| 1449 return proxy()->blocking_main_thread_task_runner(); | 1457 return proxy()->blocking_main_thread_task_runner(); |
| 1450 } | 1458 } |
| 1451 | 1459 |
| 1452 } // namespace cc | 1460 } // namespace cc |
| OLD | NEW |