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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 checkerboarded_needs_raster_content_area += | 966 checkerboarded_needs_raster_content_area += |
967 append_quads_data.checkerboarded_needs_raster_content_area; | 967 append_quads_data.checkerboarded_needs_raster_content_area; |
968 if (append_quads_data.num_missing_tiles > 0) { | 968 if (append_quads_data.num_missing_tiles > 0) { |
969 have_missing_animated_tiles |= | 969 have_missing_animated_tiles |= |
970 !layer->was_ever_ready_since_last_transform_animation() || | 970 !layer->was_ever_ready_since_last_transform_animation() || |
971 layer->screen_space_transform_is_animating(); | 971 layer->screen_space_transform_is_animating(); |
972 } else { | 972 } else { |
973 layer->set_was_ever_ready_since_last_transform_animation(true); | 973 layer->set_was_ever_ready_since_last_transform_animation(true); |
974 } | 974 } |
975 } | 975 } |
| 976 frame->embedded_surfaces.insert(frame->embedded_surfaces.end(), |
| 977 append_quads_data.embedded_surfaces.begin(), |
| 978 append_quads_data.embedded_surfaces.end()); |
976 } | 979 } |
977 | 980 |
978 // If CommitToActiveTree() is true, then we wait to draw until | 981 // If CommitToActiveTree() is true, then we wait to draw until |
979 // NotifyReadyToDraw. That means we're in as good shape as is possible now, | 982 // NotifyReadyToDraw. That means we're in as good shape as is possible now, |
980 // so there's no reason to stop the draw now (and this is not supported by | 983 // so there's no reason to stop the draw now (and this is not supported by |
981 // SingleThreadProxy). | 984 // SingleThreadProxy). |
982 if (have_missing_animated_tiles && !CommitToActiveTree()) | 985 if (have_missing_animated_tiles && !CommitToActiveTree()) |
983 draw_result = DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; | 986 draw_result = DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; |
984 | 987 |
985 // When we require high res to draw, abort the draw (almost) always. This does | 988 // When we require high res to draw, abort the draw (almost) always. This does |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 // contents of its texture are updated as the last thing before the frame is | 1700 // contents of its texture are updated as the last thing before the frame is |
1698 // drawn. | 1701 // drawn. |
1699 if (active_tree_->hud_layer()) { | 1702 if (active_tree_->hud_layer()) { |
1700 TRACE_EVENT0("cc", "DrawLayers.UpdateHudTexture"); | 1703 TRACE_EVENT0("cc", "DrawLayers.UpdateHudTexture"); |
1701 active_tree_->hud_layer()->UpdateHudTexture(draw_mode, | 1704 active_tree_->hud_layer()->UpdateHudTexture(draw_mode, |
1702 resource_provider_.get()); | 1705 resource_provider_.get()); |
1703 } | 1706 } |
1704 | 1707 |
1705 CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); | 1708 CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); |
1706 metadata.may_contain_video = frame->may_contain_video; | 1709 metadata.may_contain_video = frame->may_contain_video; |
| 1710 metadata.embedded_surfaces = std::move(frame->embedded_surfaces); |
1707 active_tree()->FinishSwapPromises(&metadata); | 1711 active_tree()->FinishSwapPromises(&metadata); |
1708 for (auto& latency : metadata.latency_info) { | 1712 for (auto& latency : metadata.latency_info) { |
1709 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", | 1713 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", |
1710 TRACE_ID_DONT_MANGLE(latency.trace_id()), | 1714 TRACE_ID_DONT_MANGLE(latency.trace_id()), |
1711 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, | 1715 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, |
1712 "step", "SwapBuffers"); | 1716 "step", "SwapBuffers"); |
1713 // Only add the latency component once for renderer swap, not the browser | 1717 // Only add the latency component once for renderer swap, not the browser |
1714 // swap. | 1718 // swap. |
1715 if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 0, | 1719 if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, 0, |
1716 nullptr)) { | 1720 nullptr)) { |
(...skipping 2576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4293 } | 4297 } |
4294 | 4298 |
4295 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) { | 4299 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) { |
4296 if (is_wheel_scroll) | 4300 if (is_wheel_scroll) |
4297 has_scrolled_by_wheel_ = true; | 4301 has_scrolled_by_wheel_ = true; |
4298 else | 4302 else |
4299 has_scrolled_by_touch_ = true; | 4303 has_scrolled_by_touch_ = true; |
4300 } | 4304 } |
4301 | 4305 |
4302 } // namespace cc | 4306 } // namespace cc |
OLD | NEW |