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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 typedef LayerIterator<LayerImpl> LayerIteratorType; | 513 typedef LayerIterator<LayerImpl> LayerIteratorType; |
514 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); | 514 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); |
515 for (LayerIteratorType it = | 515 for (LayerIteratorType it = |
516 LayerIteratorType::Begin(&render_surface_layer_list_); | 516 LayerIteratorType::Begin(&render_surface_layer_list_); |
517 it != end; | 517 it != end; |
518 ++it) { | 518 ++it) { |
519 if (occlusion_tracker) | 519 if (occlusion_tracker) |
520 occlusion_tracker->EnterLayer(it); | 520 occlusion_tracker->EnterLayer(it); |
521 | 521 |
522 LayerImpl* layer = *it; | 522 LayerImpl* layer = *it; |
| 523 const Occlusion& occlusion_in_content_space = |
| 524 occlusion_tracker ? occlusion_tracker->GetCurrentOcclusionForLayer( |
| 525 layer->draw_transform()) |
| 526 : Occlusion(); |
| 527 |
523 if (it.represents_itself()) | 528 if (it.represents_itself()) |
524 layer->UpdateTiles(occlusion_tracker.get()); | 529 layer->UpdateTiles(occlusion_in_content_space); |
525 | 530 |
526 if (!it.represents_contributing_render_surface()) { | 531 if (!it.represents_contributing_render_surface()) { |
527 if (occlusion_tracker) | 532 if (occlusion_tracker) |
528 occlusion_tracker->LeaveLayer(it); | 533 occlusion_tracker->LeaveLayer(it); |
529 continue; | 534 continue; |
530 } | 535 } |
531 | 536 |
532 if (layer->mask_layer()) | 537 if (layer->mask_layer()) |
533 layer->mask_layer()->UpdateTiles(occlusion_tracker.get()); | 538 layer->mask_layer()->UpdateTiles(occlusion_in_content_space); |
534 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) | 539 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) |
535 layer->replica_layer()->mask_layer()->UpdateTiles( | 540 layer->replica_layer()->mask_layer()->UpdateTiles( |
536 occlusion_tracker.get()); | 541 occlusion_in_content_space); |
537 | 542 |
538 if (occlusion_tracker) | 543 if (occlusion_tracker) |
539 occlusion_tracker->LeaveLayer(it); | 544 occlusion_tracker->LeaveLayer(it); |
540 } | 545 } |
541 } | 546 } |
542 | 547 |
543 DCHECK(!needs_update_draw_properties_) << | 548 DCHECK(!needs_update_draw_properties_) << |
544 "CalcDrawProperties should not set_needs_update_draw_properties()"; | 549 "CalcDrawProperties should not set_needs_update_draw_properties()"; |
545 return true; | 550 return true; |
546 } | 551 } |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 | 1438 |
1434 void LayerTreeImpl::InputScrollAnimationFinished() { | 1439 void LayerTreeImpl::InputScrollAnimationFinished() { |
1435 layer_tree_host_impl_->ScrollEnd(); | 1440 layer_tree_host_impl_->ScrollEnd(); |
1436 } | 1441 } |
1437 | 1442 |
1438 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { | 1443 BlockingTaskRunner* LayerTreeImpl::BlockingMainThreadTaskRunner() const { |
1439 return proxy()->blocking_main_thread_task_runner(); | 1444 return proxy()->blocking_main_thread_task_runner(); |
1440 } | 1445 } |
1441 | 1446 |
1442 } // namespace cc | 1447 } // namespace cc |
OLD | NEW |