| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 | 963 |
| 964 // When doing a resourceless software draw, we don't have control over the | 964 // When doing a resourceless software draw, we don't have control over the |
| 965 // surface the compositor draws to, so even though the frame may not be | 965 // surface the compositor draws to, so even though the frame may not be |
| 966 // complete, the previous frame has already been potentially lost, so an | 966 // complete, the previous frame has already been potentially lost, so an |
| 967 // incomplete frame is better than nothing, so this takes highest precidence. | 967 // incomplete frame is better than nothing, so this takes highest precidence. |
| 968 if (resourceless_software_draw_) | 968 if (resourceless_software_draw_) |
| 969 draw_result = DRAW_SUCCESS; | 969 draw_result = DRAW_SUCCESS; |
| 970 | 970 |
| 971 #if DCHECK_IS_ON() | 971 #if DCHECK_IS_ON() |
| 972 for (const auto& render_pass : frame->render_passes) { | 972 for (const auto& render_pass : frame->render_passes) { |
| 973 for (const auto& quad : render_pass->quad_list) | 973 for (auto* quad : render_pass->quad_list) |
| 974 DCHECK(quad->shared_quad_state); | 974 DCHECK(quad->shared_quad_state); |
| 975 } | 975 } |
| 976 DCHECK(frame->render_passes.back()->output_rect.origin().IsOrigin()); | 976 DCHECK(frame->render_passes.back()->output_rect.origin().IsOrigin()); |
| 977 #endif | 977 #endif |
| 978 | 978 |
| 979 if (!active_tree_->has_transparent_background()) { | 979 if (!active_tree_->has_transparent_background()) { |
| 980 frame->render_passes.back()->has_transparent_background = false; | 980 frame->render_passes.back()->has_transparent_background = false; |
| 981 AppendQuadsToFillScreen( | 981 AppendQuadsToFillScreen( |
| 982 active_tree_->RootScrollLayerDeviceViewportBounds(), | 982 active_tree_->RootScrollLayerDeviceViewportBounds(), |
| 983 frame->render_passes.back().get(), active_tree_->RootRenderSurface(), | 983 frame->render_passes.back().get(), active_tree_->RootRenderSurface(), |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1695 devtools_instrumentation::DidDrawFrame(id_); | 1695 devtools_instrumentation::DidDrawFrame(id_); |
| 1696 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( | 1696 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( |
| 1697 rendering_stats_instrumentation_->impl_thread_rendering_stats()); | 1697 rendering_stats_instrumentation_->impl_thread_rendering_stats()); |
| 1698 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); | 1698 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); |
| 1699 } | 1699 } |
| 1700 | 1700 |
| 1701 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { | 1701 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { |
| 1702 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) | 1702 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) |
| 1703 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); | 1703 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); |
| 1704 | 1704 |
| 1705 for (auto& it : video_frame_controllers_) | 1705 for (auto* it : video_frame_controllers_) |
| 1706 it->DidDrawFrame(); | 1706 it->DidDrawFrame(); |
| 1707 } | 1707 } |
| 1708 | 1708 |
| 1709 void LayerTreeHostImpl::FinishAllRendering() { | 1709 void LayerTreeHostImpl::FinishAllRendering() { |
| 1710 if (renderer_) | 1710 if (renderer_) |
| 1711 renderer_->Finish(); | 1711 renderer_->Finish(); |
| 1712 } | 1712 } |
| 1713 | 1713 |
| 1714 int LayerTreeHostImpl::RequestedMSAASampleCount() const { | 1714 int LayerTreeHostImpl::RequestedMSAASampleCount() const { |
| 1715 if (settings_.gpu_rasterization_msaa_sample_count == -1) { | 1715 if (settings_.gpu_rasterization_msaa_sample_count == -1) { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1848 | 1848 |
| 1849 if (is_likely_to_require_a_draw_) { | 1849 if (is_likely_to_require_a_draw_) { |
| 1850 // Optimistically schedule a draw. This will let us expect the tile manager | 1850 // Optimistically schedule a draw. This will let us expect the tile manager |
| 1851 // to complete its work so that we can draw new tiles within the impl frame | 1851 // to complete its work so that we can draw new tiles within the impl frame |
| 1852 // we are beginning now. | 1852 // we are beginning now. |
| 1853 SetNeedsRedraw(); | 1853 SetNeedsRedraw(); |
| 1854 } | 1854 } |
| 1855 | 1855 |
| 1856 Animate(); | 1856 Animate(); |
| 1857 | 1857 |
| 1858 for (auto& it : video_frame_controllers_) | 1858 for (auto* it : video_frame_controllers_) |
| 1859 it->OnBeginFrame(args); | 1859 it->OnBeginFrame(args); |
| 1860 } | 1860 } |
| 1861 | 1861 |
| 1862 void LayerTreeHostImpl::DidFinishImplFrame() { | 1862 void LayerTreeHostImpl::DidFinishImplFrame() { |
| 1863 current_begin_frame_tracker_.Finish(); | 1863 current_begin_frame_tracker_.Finish(); |
| 1864 } | 1864 } |
| 1865 | 1865 |
| 1866 void LayerTreeHostImpl::UpdateViewportContainerSizes() { | 1866 void LayerTreeHostImpl::UpdateViewportContainerSizes() { |
| 1867 LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer(); | 1867 LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer(); |
| 1868 LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer(); | 1868 LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer(); |
| (...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4028 return task_runner_provider_->HasImplThread(); | 4028 return task_runner_provider_->HasImplThread(); |
| 4029 } | 4029 } |
| 4030 | 4030 |
| 4031 bool LayerTreeHostImpl::CommitToActiveTree() const { | 4031 bool LayerTreeHostImpl::CommitToActiveTree() const { |
| 4032 // In single threaded mode we skip the pending tree and commit directly to the | 4032 // In single threaded mode we skip the pending tree and commit directly to the |
| 4033 // active tree. | 4033 // active tree. |
| 4034 return !task_runner_provider_->HasImplThread(); | 4034 return !task_runner_provider_->HasImplThread(); |
| 4035 } | 4035 } |
| 4036 | 4036 |
| 4037 } // namespace cc | 4037 } // namespace cc |
| OLD | NEW |