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

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

Issue 2429173005: Mus+Ash: Replace (Server)WindowSurface with (Server)WindowCompositorFrameSink (Closed)
Patch Set: Rebased Created 4 years, 1 month 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"
11 #include "cc/quads/render_pass.h" 11 #include "cc/quads/render_pass.h"
12 #include "cc/quads/texture_draw_quad.h" 12 #include "cc/quads/texture_draw_quad.h"
13 #include "components/display_compositor/compositor_overlay_candidate_validator.h " 13 #include "components/display_compositor/compositor_overlay_candidate_validator.h "
14 #include "content/common/gpu/client/context_provider_command_buffer.h" 14 #include "content/common/gpu/client/context_provider_command_buffer.h"
15 #include "gpu/command_buffer/client/gles2_interface.h" 15 #include "gpu/command_buffer/client/gles2_interface.h"
16 #include "gpu/ipc/client/command_buffer_proxy_impl.h" 16 #include "gpu/ipc/client/command_buffer_proxy_impl.h"
17 #include "services/ui/public/cpp/compositor_frame_sink.h"
18 #include "services/ui/public/cpp/window.h" 17 #include "services/ui/public/cpp/window.h"
19 #include "services/ui/public/cpp/window_surface.h" 18 #include "services/ui/public/cpp/window_compositor_frame_sink.h"
20 19
21 namespace content { 20 namespace content {
22 21
23 MusBrowserCompositorOutputSurface::MusBrowserCompositorOutputSurface( 22 MusBrowserCompositorOutputSurface::MusBrowserCompositorOutputSurface(
24 ui::Window* window, 23 ui::Window* window,
25 scoped_refptr<ContextProviderCommandBuffer> context, 24 scoped_refptr<ContextProviderCommandBuffer> context,
26 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, 25 scoped_refptr<ui::CompositorVSyncManager> vsync_manager,
27 cc::SyntheticBeginFrameSource* begin_frame_source, 26 cc::SyntheticBeginFrameSource* begin_frame_source,
28 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> 27 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
29 overlay_candidate_validator) 28 overlay_candidate_validator)
30 : GpuBrowserCompositorOutputSurface(std::move(context), 29 : GpuBrowserCompositorOutputSurface(std::move(context),
31 std::move(vsync_manager), 30 std::move(vsync_manager),
32 begin_frame_source, 31 begin_frame_source,
33 std::move(overlay_candidate_validator)), 32 std::move(overlay_candidate_validator)),
34 ui_window_(window) { 33 ui_window_(window) {
35 ui_compositor_frame_sink_ = ui_window_->RequestCompositorFrameSink( 34 ui_compositor_frame_sink_ = ui_window_->RequestCompositorFrameSink(
36 ui::mojom::SurfaceType::DEFAULT, context); 35 ui::mojom::CompositorFrameSinkType::DEFAULT, context);
37 } 36 }
38 37
39 MusBrowserCompositorOutputSurface::~MusBrowserCompositorOutputSurface() {} 38 MusBrowserCompositorOutputSurface::~MusBrowserCompositorOutputSurface() {}
40 39
41 void MusBrowserCompositorOutputSurface::SwapBuffers( 40 void MusBrowserCompositorOutputSurface::SwapBuffers(
42 cc::OutputSurfaceFrame frame) { 41 cc::OutputSurfaceFrame frame) {
43 const gfx::Rect bounds(ui_window_->bounds().size()); 42 const gfx::Rect bounds(ui_window_->bounds().size());
44 cc::CompositorFrame ui_frame; 43 cc::CompositorFrame ui_frame;
45 ui_frame.metadata.latency_info = std::move(frame.latency_info); 44 ui_frame.metadata.latency_info = std::move(frame.latency_info);
46 // Reset latency_info to known empty state after moving contents. 45 // Reset latency_info to known empty state after moving contents.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 175
177 const gpu::Mailbox& MusBrowserCompositorOutputSurface::GetMailboxFromResourceId( 176 const gpu::Mailbox& MusBrowserCompositorOutputSurface::GetMailboxFromResourceId(
178 uint32_t id) { 177 uint32_t id) {
179 DCHECK_LT(id, mailboxes_.size()); 178 DCHECK_LT(id, mailboxes_.size());
180 DCHECK(std::find(free_resource_ids_.begin(), free_resource_ids_.end(), id) == 179 DCHECK(std::find(free_resource_ids_.begin(), free_resource_ids_.end(), id) ==
181 free_resource_ids_.end()); 180 free_resource_ids_.end());
182 return mailboxes_[id]; 181 return mailboxes_[id];
183 } 182 }
184 183
185 } // namespace content 184 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/mus_browser_compositor_output_surface.h ('k') | content/renderer/mus/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698