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, |
22 int surface_id, | 23 int surface_id, |
23 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 24 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
24 scoped_ptr<BrowserCompositorOverlayCandidateValidator> | 25 scoped_ptr<BrowserCompositorOverlayCandidateValidator> |
25 overlay_candidate_validator, | 26 overlay_candidate_validator, |
26 unsigned internalformat, | 27 unsigned internalformat, |
27 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager) | 28 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager) |
28 : GpuBrowserCompositorOutputSurface(context, | 29 : GpuBrowserCompositorOutputSurface(context, |
| 30 worker_context, |
29 vsync_manager, | 31 vsync_manager, |
30 overlay_candidate_validator.Pass()), | 32 overlay_candidate_validator.Pass()), |
31 internalformat_(internalformat), | 33 internalformat_(internalformat), |
32 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { | 34 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { |
33 capabilities_.uses_default_gl_framebuffer = false; | 35 capabilities_.uses_default_gl_framebuffer = false; |
34 capabilities_.flipped_output_surface = true; | 36 capabilities_.flipped_output_surface = true; |
35 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling | 37 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling |
36 // more closely with the previous surfaced behavior. | 38 // more closely with the previous surfaced behavior. |
37 // With a surface, swap buffer ack used to return early, before actually | 39 // With a surface, swap buffer ack used to return early, before actually |
38 // presenting the back buffer, enabling the browser compositor to run ahead. | 40 // presenting the back buffer, enabling the browser compositor to run ahead. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Even through the swap failed, this is a fixable error so we can pretend | 103 // Even through the swap failed, this is a fixable error so we can pretend |
102 // it succeeded to the rest of the system. | 104 // it succeeded to the rest of the system. |
103 result = gfx::SwapResult::SWAP_ACK; | 105 result = gfx::SwapResult::SWAP_ACK; |
104 output_surface_->RecreateBuffers(); | 106 output_surface_->RecreateBuffers(); |
105 } | 107 } |
106 GpuBrowserCompositorOutputSurface::OnSwapBuffersCompleted(latency_info, | 108 GpuBrowserCompositorOutputSurface::OnSwapBuffersCompleted(latency_info, |
107 result); | 109 result); |
108 } | 110 } |
109 | 111 |
110 } // namespace content | 112 } // namespace content |
OLD | NEW |