OLD | NEW |
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_surfaceless_browser_compositor_output_s
urface.h" | 5 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" |
6 | 6 |
7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
8 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor.h" | 8 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor.h" |
9 #include "content/browser/compositor/buffer_queue.h" | 9 #include "content/browser/compositor/buffer_queue.h" |
10 #include "content/browser/compositor/reflector_impl.h" | 10 #include "content/browser/compositor/reflector_impl.h" |
11 #include "content/browser/gpu/gpu_surface_tracker.h" | 11 #include "content/browser/gpu/gpu_surface_tracker.h" |
12 #include "content/common/gpu/client/context_provider_command_buffer.h" | 12 #include "content/common/gpu/client/context_provider_command_buffer.h" |
13 #include "content/common/gpu/client/gl_helper.h" | 13 #include "content/common/gpu/client/gl_helper.h" |
14 #include "gpu/GLES2/gl2extchromium.h" | 14 #include "gpu/GLES2/gl2extchromium.h" |
15 #include "gpu/command_buffer/client/gles2_interface.h" | 15 #include "gpu/command_buffer/client/gles2_interface.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 GpuSurfacelessBrowserCompositorOutputSurface:: | 19 GpuSurfacelessBrowserCompositorOutputSurface:: |
20 GpuSurfacelessBrowserCompositorOutputSurface( | 20 GpuSurfacelessBrowserCompositorOutputSurface( |
21 const scoped_refptr<ContextProviderCommandBuffer>& context, | 21 const scoped_refptr<ContextProviderCommandBuffer>& context, |
22 const scoped_refptr<ContextProviderCommandBuffer>& worker_context, | |
23 int surface_id, | 22 int surface_id, |
24 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 23 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
25 scoped_ptr<BrowserCompositorOverlayCandidateValidator> | 24 scoped_ptr<BrowserCompositorOverlayCandidateValidator> |
26 overlay_candidate_validator, | 25 overlay_candidate_validator, |
27 unsigned int target, | 26 unsigned int target, |
28 unsigned int internalformat, | 27 unsigned int internalformat, |
29 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager) | 28 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager) |
30 : GpuBrowserCompositorOutputSurface(context, | 29 : GpuBrowserCompositorOutputSurface(context, |
31 worker_context, | |
32 vsync_manager, | 30 vsync_manager, |
33 overlay_candidate_validator.Pass()), | 31 overlay_candidate_validator.Pass()), |
34 internalformat_(internalformat), | 32 internalformat_(internalformat), |
35 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { | 33 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { |
36 capabilities_.uses_default_gl_framebuffer = false; | 34 capabilities_.uses_default_gl_framebuffer = false; |
37 capabilities_.flipped_output_surface = true; | 35 capabilities_.flipped_output_surface = true; |
38 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling | 36 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling |
39 // more closely with the previous surfaced behavior. | 37 // more closely with the previous surfaced behavior. |
40 // With a surface, swap buffer ack used to return early, before actually | 38 // With a surface, swap buffer ack used to return early, before actually |
41 // presenting the back buffer, enabling the browser compositor to run ahead. | 39 // presenting the back buffer, enabling the browser compositor to run ahead. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 result); | 108 result); |
111 } | 109 } |
112 | 110 |
113 #if defined(OS_MACOSX) | 111 #if defined(OS_MACOSX) |
114 void GpuSurfacelessBrowserCompositorOutputSurface::OnSurfaceDisplayed() { | 112 void GpuSurfacelessBrowserCompositorOutputSurface::OnSurfaceDisplayed() { |
115 OnSwapBuffersComplete(); | 113 OnSwapBuffersComplete(); |
116 } | 114 } |
117 #endif | 115 #endif |
118 | 116 |
119 } // namespace content | 117 } // namespace content |
OLD | NEW |