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

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

Issue 2511273002: Decouple BrowserCompositorOutputSurface from BeginFrameSource. (Closed)
Patch Set: Another attempt to fix the crash 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 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 "content/browser/compositor/gpu_browser_compositor_output_surface.h" 5 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "cc/output/output_surface_client.h" 10 #include "cc/output/output_surface_client.h"
11 #include "cc/output/output_surface_frame.h" 11 #include "cc/output/output_surface_frame.h"
12 #include "components/display_compositor/compositor_overlay_candidate_validator.h " 12 #include "components/display_compositor/compositor_overlay_candidate_validator.h "
13 #include "content/browser/compositor/reflector_impl.h" 13 #include "content/browser/compositor/reflector_impl.h"
14 #include "content/browser/compositor/reflector_texture.h" 14 #include "content/browser/compositor/reflector_texture.h"
15 #include "content/browser/renderer_host/render_widget_host_impl.h" 15 #include "content/browser/renderer_host/render_widget_host_impl.h"
16 #include "content/common/gpu/client/context_provider_command_buffer.h" 16 #include "content/common/gpu/client/context_provider_command_buffer.h"
17 #include "gpu/command_buffer/client/context_support.h" 17 #include "gpu/command_buffer/client/context_support.h"
18 #include "gpu/command_buffer/client/gles2_interface.h" 18 #include "gpu/command_buffer/client/gles2_interface.h"
19 #include "gpu/ipc/client/command_buffer_proxy_impl.h" 19 #include "gpu/ipc/client/command_buffer_proxy_impl.h"
20 20
21 namespace content { 21 namespace content {
22 22
23 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface( 23 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface(
24 scoped_refptr<ContextProviderCommandBuffer> context, 24 scoped_refptr<ContextProviderCommandBuffer> context,
25 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, 25 scoped_refptr<ui::CompositorVSyncManager> vsync_manager,
26 cc::SyntheticBeginFrameSource* begin_frame_source,
27 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> 26 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
28 overlay_candidate_validator) 27 overlay_candidate_validator)
29 : BrowserCompositorOutputSurface(std::move(context), 28 : BrowserCompositorOutputSurface(std::move(context),
30 std::move(vsync_manager), 29 std::move(vsync_manager),
31 begin_frame_source,
32 std::move(overlay_candidate_validator)), 30 std::move(overlay_candidate_validator)),
33 weak_ptr_factory_(this) { 31 weak_ptr_factory_(this) {
34 if (capabilities_.uses_default_gl_framebuffer) { 32 if (capabilities_.uses_default_gl_framebuffer) {
35 capabilities_.flipped_output_surface = 33 capabilities_.flipped_output_surface =
36 context_provider()->ContextCapabilities().flips_vertically; 34 context_provider()->ContextCapabilities().flips_vertically;
37 } 35 }
38 } 36 }
39 37
40 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() = 38 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() =
41 default; 39 default;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 ContextProviderCommandBuffer* provider_command_buffer = 137 ContextProviderCommandBuffer* provider_command_buffer =
140 static_cast<content::ContextProviderCommandBuffer*>( 138 static_cast<content::ContextProviderCommandBuffer*>(
141 context_provider_.get()); 139 context_provider_.get());
142 gpu::CommandBufferProxyImpl* command_buffer_proxy = 140 gpu::CommandBufferProxyImpl* command_buffer_proxy =
143 provider_command_buffer->GetCommandBufferProxy(); 141 provider_command_buffer->GetCommandBufferProxy();
144 DCHECK(command_buffer_proxy); 142 DCHECK(command_buffer_proxy);
145 return command_buffer_proxy; 143 return command_buffer_proxy;
146 } 144 }
147 145
148 } // namespace content 146 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698