Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2527283003: cc: Introduce BeginFrame sequence numbers and acknowledgements.
Patch Set: Address Brian's comments. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 30 matching lines...) Expand all
41 #include "cc/input/scrollbar_animation_controller.h" 41 #include "cc/input/scrollbar_animation_controller.h"
42 #include "cc/layers/append_quads_data.h" 42 #include "cc/layers/append_quads_data.h"
43 #include "cc/layers/heads_up_display_layer_impl.h" 43 #include "cc/layers/heads_up_display_layer_impl.h"
44 #include "cc/layers/layer_impl.h" 44 #include "cc/layers/layer_impl.h"
45 #include "cc/layers/layer_iterator.h" 45 #include "cc/layers/layer_iterator.h"
46 #include "cc/layers/painted_scrollbar_layer_impl.h" 46 #include "cc/layers/painted_scrollbar_layer_impl.h"
47 #include "cc/layers/render_surface_impl.h" 47 #include "cc/layers/render_surface_impl.h"
48 #include "cc/layers/scrollbar_layer_impl_base.h" 48 #include "cc/layers/scrollbar_layer_impl_base.h"
49 #include "cc/layers/surface_layer_impl.h" 49 #include "cc/layers/surface_layer_impl.h"
50 #include "cc/layers/viewport.h" 50 #include "cc/layers/viewport.h"
51 #include "cc/output/begin_frame_args.h"
51 #include "cc/output/compositor_frame.h" 52 #include "cc/output/compositor_frame.h"
52 #include "cc/output/compositor_frame_metadata.h" 53 #include "cc/output/compositor_frame_metadata.h"
53 #include "cc/output/compositor_frame_sink.h" 54 #include "cc/output/compositor_frame_sink.h"
54 #include "cc/output/copy_output_request.h" 55 #include "cc/output/copy_output_request.h"
55 #include "cc/quads/render_pass_draw_quad.h" 56 #include "cc/quads/render_pass_draw_quad.h"
56 #include "cc/quads/shared_quad_state.h" 57 #include "cc/quads/shared_quad_state.h"
57 #include "cc/quads/solid_color_draw_quad.h" 58 #include "cc/quads/solid_color_draw_quad.h"
58 #include "cc/quads/texture_draw_quad.h" 59 #include "cc/quads/texture_draw_quad.h"
59 #include "cc/raster/bitmap_raster_buffer_provider.h" 60 #include "cc/raster/bitmap_raster_buffer_provider.h"
60 #include "cc/raster/gpu_raster_buffer_provider.h" 61 #include "cc/raster/gpu_raster_buffer_provider.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 173 }
173 174
174 } // namespace 175 } // namespace
175 176
176 DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer, 177 DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer,
177 "Scheduling.%s.PendingTreeDuration"); 178 "Scheduling.%s.PendingTreeDuration");
178 179
179 LayerTreeHostImpl::FrameData::FrameData() 180 LayerTreeHostImpl::FrameData::FrameData()
180 : render_surface_layer_list(nullptr), 181 : render_surface_layer_list(nullptr),
181 has_no_damage(false), 182 has_no_damage(false),
182 may_contain_video(false) {} 183 may_contain_video(false),
184 begin_frame_source_id(0),
185 begin_frame_number(BeginFrameArgs::kInvalidFrameNumber),
186 latest_confirmed_frame(BeginFrameArgs::kInvalidFrameNumber) {}
183 187
184 LayerTreeHostImpl::FrameData::~FrameData() {} 188 LayerTreeHostImpl::FrameData::~FrameData() {}
185 189
186 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( 190 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create(
187 const LayerTreeSettings& settings, 191 const LayerTreeSettings& settings,
188 LayerTreeHostImplClient* client, 192 LayerTreeHostImplClient* client,
189 TaskRunnerProvider* task_runner_provider, 193 TaskRunnerProvider* task_runner_provider,
190 RenderingStatsInstrumentation* rendering_stats_instrumentation, 194 RenderingStatsInstrumentation* rendering_stats_instrumentation,
191 TaskGraphRunner* task_graph_runner, 195 TaskGraphRunner* task_graph_runner,
192 std::unique_ptr<MutatorHost> mutator_host, 196 std::unique_ptr<MutatorHost> mutator_host,
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 1655
1652 // Collect all resource ids in the render passes into a single array. 1656 // Collect all resource ids in the render passes into a single array.
1653 ResourceProvider::ResourceIdArray resources; 1657 ResourceProvider::ResourceIdArray resources;
1654 for (const auto& render_pass : frame->render_passes) { 1658 for (const auto& render_pass : frame->render_passes) {
1655 for (auto* quad : render_pass->quad_list) { 1659 for (auto* quad : render_pass->quad_list) {
1656 for (ResourceId resource_id : quad->resources) 1660 for (ResourceId resource_id : quad->resources)
1657 resources.push_back(resource_id); 1661 resources.push_back(resource_id);
1658 } 1662 }
1659 } 1663 }
1660 1664
1665 DCHECK_LT(BeginFrameArgs::kInvalidFrameNumber, frame->begin_frame_number);
1666 metadata.begin_frame_source_id = frame->begin_frame_source_id;
1667 metadata.begin_frame_number = frame->begin_frame_number;
1668 metadata.latest_confirmed_frame = frame->latest_confirmed_frame;
1661 1669
1662 CompositorFrame compositor_frame; 1670 CompositorFrame compositor_frame;
1663 compositor_frame.metadata = std::move(metadata); 1671 compositor_frame.metadata = std::move(metadata);
1664 resource_provider_->PrepareSendToParent(resources, 1672 resource_provider_->PrepareSendToParent(resources,
1665 &compositor_frame.resource_list); 1673 &compositor_frame.resource_list);
1666 compositor_frame.render_pass_list = std::move(frame->render_passes); 1674 compositor_frame.render_pass_list = std::move(frame->render_passes);
1667 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); 1675 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame));
1668 1676
1669 // The next frame should start by assuming nothing has changed, and changes 1677 // The next frame should start by assuming nothing has changed, and changes
1670 // are noted as they occur. 1678 // are noted as they occur.
(...skipping 2412 matching lines...) Expand 10 before | Expand all | Expand 10 after
4083 worker_context_visibility_ = 4091 worker_context_visibility_ =
4084 worker_context->CacheController()->ClientBecameVisible(); 4092 worker_context->CacheController()->ClientBecameVisible();
4085 } else { 4093 } else {
4086 worker_context->CacheController()->ClientBecameNotVisible( 4094 worker_context->CacheController()->ClientBecameNotVisible(
4087 std::move(worker_context_visibility_)); 4095 std::move(worker_context_visibility_));
4088 } 4096 }
4089 } 4097 }
4090 } 4098 }
4091 4099
4092 } // namespace cc 4100 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698