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

Side by Side Diff: content/browser/compositor/mus_browser_compositor_output_surface.cc

Issue 2582823002: WIP: Surface Synchronization System
Patch Set: Only create ClientSurfaceEmbedder if window is visible. Trash it otherwise. Created 3 years, 10 months 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/browser/compositor/mus_browser_compositor_output_surface.h" 5 #include "content/browser/compositor/mus_browser_compositor_output_surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/output_surface_frame.h" 10 #include "cc/output/output_surface_frame.h"
(...skipping 18 matching lines...) Expand all
29 const UpdateVSyncParametersCallback& update_vsync_parameters_callback, 29 const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
30 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> 30 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
31 overlay_candidate_validator) 31 overlay_candidate_validator)
32 : GpuBrowserCompositorOutputSurface(std::move(context), 32 : GpuBrowserCompositorOutputSurface(std::move(context),
33 update_vsync_parameters_callback, 33 update_vsync_parameters_callback,
34 std::move(overlay_candidate_validator), 34 std::move(overlay_candidate_validator),
35 false /* support_stencil */), 35 false /* support_stencil */),
36 window_(window), 36 window_(window),
37 begin_frame_source_(nullptr) { 37 begin_frame_source_(nullptr) {
38 aura::WindowPortMus* window_port = aura::WindowPortMus::Get(window_); 38 aura::WindowPortMus* window_port = aura::WindowPortMus::Get(window_);
39 cc::FrameSinkId frame_sink_id(window_port->server_id(), 0);
40 fprintf(stderr, ">>>>MusBrowserCompositorOutputSurface %s\n",
41 frame_sink_id.ToString().c_str());
39 DCHECK(window_port); 42 DCHECK(window_port);
40 compositor_frame_sink_ = window_port->RequestCompositorFrameSink( 43 compositor_frame_sink_ = window_port->RequestCompositorFrameSink(
41 context, gpu_memory_buffer_manager); 44 context, gpu_memory_buffer_manager);
42 compositor_frame_sink_->BindToClient(this); 45 compositor_frame_sink_->BindToClient(this);
43 } 46 }
44 47
45 MusBrowserCompositorOutputSurface::~MusBrowserCompositorOutputSurface() {} 48 MusBrowserCompositorOutputSurface::~MusBrowserCompositorOutputSurface() {}
46 49
47 cc::BeginFrameSource* MusBrowserCompositorOutputSurface::GetBeginFrameSource() { 50 cc::BeginFrameSource* MusBrowserCompositorOutputSurface::GetBeginFrameSource() {
48 return begin_frame_source_; 51 return begin_frame_source_;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 186
184 const gpu::Mailbox& MusBrowserCompositorOutputSurface::GetMailboxFromResourceId( 187 const gpu::Mailbox& MusBrowserCompositorOutputSurface::GetMailboxFromResourceId(
185 uint32_t id) { 188 uint32_t id) {
186 DCHECK_LT(id, mailboxes_.size()); 189 DCHECK_LT(id, mailboxes_.size());
187 DCHECK(std::find(free_resource_ids_.begin(), free_resource_ids_.end(), id) == 190 DCHECK(std::find(free_resource_ids_.begin(), free_resource_ids_.end(), id) ==
188 free_resource_ids_.end()); 191 free_resource_ids_.end());
189 return mailboxes_[id]; 192 return mailboxes_[id];
190 } 193 }
191 194
192 } // namespace content 195 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698