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

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

Issue 2643623004: content: Add overdraw feedback support for X11 ChromeOS builds. (Closed)
Patch Set: add todo Created 3 years, 11 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 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 "gpu/command_buffer/client/context_support.h" 16 #include "gpu/command_buffer/client/context_support.h"
17 #include "gpu/command_buffer/client/gles2_interface.h" 17 #include "gpu/command_buffer/client/gles2_interface.h"
18 #include "gpu/ipc/client/command_buffer_proxy_impl.h" 18 #include "gpu/ipc/client/command_buffer_proxy_impl.h"
19 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" 19 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
20 20
21 namespace content { 21 namespace content {
22 22
23 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface( 23 GpuBrowserCompositorOutputSurface::GpuBrowserCompositorOutputSurface(
24 scoped_refptr<ui::ContextProviderCommandBuffer> context, 24 scoped_refptr<ui::ContextProviderCommandBuffer> context,
25 const UpdateVSyncParametersCallback& update_vsync_parameters_callback, 25 const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
26 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> 26 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
27 overlay_candidate_validator) 27 overlay_candidate_validator,
28 bool support_stencil)
28 : BrowserCompositorOutputSurface(std::move(context), 29 : BrowserCompositorOutputSurface(std::move(context),
29 update_vsync_parameters_callback, 30 update_vsync_parameters_callback,
30 std::move(overlay_candidate_validator)), 31 std::move(overlay_candidate_validator)),
31 weak_ptr_factory_(this) { 32 weak_ptr_factory_(this) {
32 if (capabilities_.uses_default_gl_framebuffer) { 33 if (capabilities_.uses_default_gl_framebuffer) {
33 capabilities_.flipped_output_surface = 34 capabilities_.flipped_output_surface =
34 context_provider()->ContextCapabilities().flips_vertically; 35 context_provider()->ContextCapabilities().flips_vertically;
35 } 36 }
37 // TODO(reveman): Check context as there's no guarantee we support this
38 // even if we request it.
39 capabilities_.supports_stencil = support_stencil;
36 } 40 }
37 41
38 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() { 42 GpuBrowserCompositorOutputSurface::~GpuBrowserCompositorOutputSurface() {
39 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback( 43 GetCommandBufferProxy()->SetUpdateVSyncParametersCallback(
40 UpdateVSyncParametersCallback()); 44 UpdateVSyncParametersCallback());
41 } 45 }
42 46
43 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( 47 void GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted(
44 const std::vector<ui::LatencyInfo>& latency_info, 48 const std::vector<ui::LatencyInfo>& latency_info,
45 gfx::SwapResult result, 49 gfx::SwapResult result,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { 142 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() {
139 ui::ContextProviderCommandBuffer* provider_command_buffer = 143 ui::ContextProviderCommandBuffer* provider_command_buffer =
140 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); 144 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get());
141 gpu::CommandBufferProxyImpl* command_buffer_proxy = 145 gpu::CommandBufferProxyImpl* command_buffer_proxy =
142 provider_command_buffer->GetCommandBufferProxy(); 146 provider_command_buffer->GetCommandBufferProxy();
143 DCHECK(command_buffer_proxy); 147 DCHECK(command_buffer_proxy);
144 return command_buffer_proxy; 148 return command_buffer_proxy;
145 } 149 }
146 150
147 } // namespace content 151 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698