| 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_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 } else if (it.represents_contributing_render_surface() && | 843 } else if (it.represents_contributing_render_surface() && |
| 844 it->render_surface()->contributes_to_drawn_surface()) { | 844 it->render_surface()->contributes_to_drawn_surface()) { |
| 845 RenderPassId contributing_render_pass_id = | 845 RenderPassId contributing_render_pass_id = |
| 846 it->render_surface()->GetRenderPassId(); | 846 it->render_surface()->GetRenderPassId(); |
| 847 RenderPass* contributing_render_pass = | 847 RenderPass* contributing_render_pass = |
| 848 frame->render_passes_by_id[contributing_render_pass_id]; | 848 frame->render_passes_by_id[contributing_render_pass_id]; |
| 849 AppendQuadsForRenderSurfaceLayer(target_render_pass, | 849 AppendQuadsForRenderSurfaceLayer(target_render_pass, |
| 850 *it, | 850 *it, |
| 851 contributing_render_pass, | 851 contributing_render_pass, |
| 852 &append_quads_data); | 852 &append_quads_data); |
| 853 } else if (it.represents_itself() && | 853 } else if (it.represents_itself() && !it->visible_layer_rect().IsEmpty()) { |
| 854 !it->visible_content_rect().IsEmpty()) { | |
| 855 bool occluded = | 854 bool occluded = |
| 856 it->draw_properties().occlusion_in_content_space.IsOccluded( | 855 it->draw_properties().occlusion_in_content_space.IsOccluded( |
| 857 it->visible_content_rect()); | 856 it->visible_layer_rect()); |
| 858 if (!occluded && it->WillDraw(draw_mode, resource_provider_.get())) { | 857 if (!occluded && it->WillDraw(draw_mode, resource_provider_.get())) { |
| 859 DCHECK_EQ(active_tree_, it->layer_tree_impl()); | 858 DCHECK_EQ(active_tree_, it->layer_tree_impl()); |
| 860 | 859 |
| 861 frame->will_draw_layers.push_back(*it); | 860 frame->will_draw_layers.push_back(*it); |
| 862 | 861 |
| 863 if (it->HasContributingDelegatedRenderPasses()) { | 862 if (it->HasContributingDelegatedRenderPasses()) { |
| 864 RenderPassId contributing_render_pass_id = | 863 RenderPassId contributing_render_pass_id = |
| 865 it->FirstContributingRenderPassId(); | 864 it->FirstContributingRenderPassId(); |
| 866 while (frame->render_passes_by_id.find(contributing_render_pass_id) != | 865 while (frame->render_passes_by_id.find(contributing_render_pass_id) != |
| 867 frame->render_passes_by_id.end()) { | 866 frame->render_passes_by_id.end()) { |
| 868 RenderPass* render_pass = | 867 RenderPass* render_pass = |
| 869 frame->render_passes_by_id[contributing_render_pass_id]; | 868 frame->render_passes_by_id[contributing_render_pass_id]; |
| 870 | 869 |
| 871 it->AppendQuads(render_pass, &append_quads_data); | 870 it->AppendQuads(render_pass, &append_quads_data); |
| 872 | 871 |
| 873 contributing_render_pass_id = | 872 contributing_render_pass_id = |
| 874 it->NextContributingRenderPassId(contributing_render_pass_id); | 873 it->NextContributingRenderPassId(contributing_render_pass_id); |
| 875 } | 874 } |
| 876 } | 875 } |
| 877 | 876 |
| 878 it->AppendQuads(target_render_pass, &append_quads_data); | 877 it->AppendQuads(target_render_pass, &append_quads_data); |
| 879 | 878 |
| 880 // For layers that represent themselves, add composite frame timing | 879 // For layers that represent themselves, add composite frame timing |
| 881 // requests if the visible rect intersects the requested rect. | 880 // requests if the visible rect intersects the requested rect. |
| 882 for (const auto& request : it->frame_timing_requests()) { | 881 for (const auto& request : it->frame_timing_requests()) { |
| 883 if (request.rect().Intersects(it->visible_content_rect())) { | 882 if (request.rect().Intersects(it->visible_layer_rect())) { |
| 884 frame->composite_events.push_back( | 883 frame->composite_events.push_back( |
| 885 FrameTimingTracker::FrameAndRectIds( | 884 FrameTimingTracker::FrameAndRectIds( |
| 886 active_tree_->source_frame_number(), request.id())); | 885 active_tree_->source_frame_number(), request.id())); |
| 887 } | 886 } |
| 888 } | 887 } |
| 889 } | 888 } |
| 890 | 889 |
| 891 ++layers_drawn; | 890 ++layers_drawn; |
| 892 } | 891 } |
| 893 | 892 |
| 894 rendering_stats_instrumentation_->AddVisibleContentArea( | 893 rendering_stats_instrumentation_->AddVisibleContentArea( |
| 895 append_quads_data.visible_content_area); | 894 append_quads_data.visible_layer_area); |
| 896 rendering_stats_instrumentation_->AddApproximatedVisibleContentArea( | 895 rendering_stats_instrumentation_->AddApproximatedVisibleContentArea( |
| 897 append_quads_data.approximated_visible_content_area); | 896 append_quads_data.approximated_visible_layer_area); |
| 898 rendering_stats_instrumentation_->AddCheckerboardedVisibleContentArea( | 897 rendering_stats_instrumentation_->AddCheckerboardedVisibleContentArea( |
| 899 append_quads_data.checkerboarded_visible_content_area); | 898 append_quads_data.checkerboarded_visible_layer_area); |
| 900 | 899 |
| 901 num_missing_tiles += append_quads_data.num_missing_tiles; | 900 num_missing_tiles += append_quads_data.num_missing_tiles; |
| 902 num_incomplete_tiles += append_quads_data.num_incomplete_tiles; | 901 num_incomplete_tiles += append_quads_data.num_incomplete_tiles; |
| 903 | 902 |
| 904 if (append_quads_data.num_missing_tiles) { | 903 if (append_quads_data.num_missing_tiles) { |
| 905 bool layer_has_animating_transform = | 904 bool layer_has_animating_transform = |
| 906 it->screen_space_transform_is_animating() || | 905 it->screen_space_transform_is_animating() || |
| 907 it->draw_transform_is_animating(); | 906 it->draw_transform_is_animating(); |
| 908 if (layer_has_animating_transform) | 907 if (layer_has_animating_transform) |
| 909 have_missing_animated_tiles = true; | 908 have_missing_animated_tiles = true; |
| (...skipping 2581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3491 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3490 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
| 3492 | 3491 |
| 3493 curve->UpdateTarget( | 3492 curve->UpdateTarget( |
| 3494 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3493 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
| 3495 .InSecondsF(), | 3494 .InSecondsF(), |
| 3496 new_target); | 3495 new_target); |
| 3497 | 3496 |
| 3498 return true; | 3497 return true; |
| 3499 } | 3498 } |
| 3500 } // namespace cc | 3499 } // namespace cc |
| OLD | NEW |