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

Side by Side Diff: ui/aura/mus/window_compositor_frame_sink.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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/aura/mus/window_compositor_frame_sink.h" 5 #include "ui/aura/mus/window_compositor_frame_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/output/begin_frame_args.h"
8 #include "cc/output/compositor_frame_sink_client.h" 9 #include "cc/output/compositor_frame_sink_client.h"
9 #include "gpu/ipc/client/gpu_channel_host.h" 10 #include "gpu/ipc/client/gpu_channel_host.h"
10 11
11 namespace aura { 12 namespace aura {
12 13
13 // static 14 // static
14 std::unique_ptr<WindowCompositorFrameSink> WindowCompositorFrameSink::Create( 15 std::unique_ptr<WindowCompositorFrameSink> WindowCompositorFrameSink::Create(
15 scoped_refptr<cc::ContextProvider> context_provider, 16 scoped_refptr<cc::ContextProvider> context_provider,
16 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 17 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
17 std::unique_ptr<WindowCompositorFrameSinkBinding>* 18 std::unique_ptr<WindowCompositorFrameSinkBinding>*
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 113 }
113 114
114 void WindowCompositorFrameSink::WillDrawSurface() { 115 void WindowCompositorFrameSink::WillDrawSurface() {
115 // TODO(fsamuel, staraz): Implement this. 116 // TODO(fsamuel, staraz): Implement this.
116 } 117 }
117 118
118 void WindowCompositorFrameSink::OnNeedsBeginFrames(bool needs_begin_frames) { 119 void WindowCompositorFrameSink::OnNeedsBeginFrames(bool needs_begin_frames) {
119 compositor_frame_sink_->SetNeedsBeginFrame(needs_begin_frames); 120 compositor_frame_sink_->SetNeedsBeginFrame(needs_begin_frames);
120 } 121 }
121 122
123 void WindowCompositorFrameSink::OnDidFinishFrame(const cc::BeginFrameAck& ack) {
124 // If there was damage, SubmitCompositorFrame serves as ack.
125 if (!ack.has_damage)
126 compositor_frame_sink_->BeginFrameDidNotDraw(ack);
127 }
128
122 WindowCompositorFrameSinkBinding::~WindowCompositorFrameSinkBinding() {} 129 WindowCompositorFrameSinkBinding::~WindowCompositorFrameSinkBinding() {}
123 130
124 WindowCompositorFrameSinkBinding::WindowCompositorFrameSinkBinding( 131 WindowCompositorFrameSinkBinding::WindowCompositorFrameSinkBinding(
125 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink_request, 132 cc::mojom::MojoCompositorFrameSinkRequest compositor_frame_sink_request,
126 mojo::InterfacePtrInfo<cc::mojom::MojoCompositorFrameSinkClient> 133 mojo::InterfacePtrInfo<cc::mojom::MojoCompositorFrameSinkClient>
127 compositor_frame_sink_client) 134 compositor_frame_sink_client)
128 : compositor_frame_sink_request_(std::move(compositor_frame_sink_request)), 135 : compositor_frame_sink_request_(std::move(compositor_frame_sink_request)),
129 compositor_frame_sink_client_(std::move(compositor_frame_sink_client)) {} 136 compositor_frame_sink_client_(std::move(compositor_frame_sink_client)) {}
130 137
131 } // namespace aura 138 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/window_compositor_frame_sink.h ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698