| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "cc/output/output_surface_client.h" | 9 #include "cc/output/output_surface_client.h" |
| 10 #include "cc/output/output_surface_frame.h" | 10 #include "cc/output/output_surface_frame.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 gpu::SurfaceHandle surface_handle, | 24 gpu::SurfaceHandle surface_handle, |
| 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 unsigned int target, | 28 unsigned int target, |
| 29 unsigned int internalformat, | 29 unsigned int internalformat, |
| 30 gfx::BufferFormat format, | 30 gfx::BufferFormat format, |
| 31 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) | 31 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) |
| 32 : GpuBrowserCompositorOutputSurface(std::move(context), | 32 : GpuBrowserCompositorOutputSurface(std::move(context), |
| 33 update_vsync_parameters_callback, | 33 update_vsync_parameters_callback, |
| 34 std::move(overlay_candidate_validator)), | 34 std::move(overlay_candidate_validator), |
| 35 true /* support_stencil */), |
| 35 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { | 36 gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { |
| 36 capabilities_.uses_default_gl_framebuffer = false; | 37 capabilities_.uses_default_gl_framebuffer = false; |
| 37 capabilities_.flipped_output_surface = true; | 38 capabilities_.flipped_output_surface = true; |
| 38 capabilities_.supports_stencil = true; | |
| 39 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling | 39 // Set |max_frames_pending| to 2 for surfaceless, which aligns scheduling |
| 40 // more closely with the previous surfaced behavior. | 40 // more closely with the previous surfaced behavior. |
| 41 // With a surface, swap buffer ack used to return early, before actually | 41 // With a surface, swap buffer ack used to return early, before actually |
| 42 // presenting the back buffer, enabling the browser compositor to run ahead. | 42 // presenting the back buffer, enabling the browser compositor to run ahead. |
| 43 // Surfaceless implementation acks at the time of actual buffer swap, which | 43 // Surfaceless implementation acks at the time of actual buffer swap, which |
| 44 // shifts the start of the new frame forward relative to the old | 44 // shifts the start of the new frame forward relative to the old |
| 45 // implementation. | 45 // implementation. |
| 46 capabilities_.max_frames_pending = 2; | 46 capabilities_.max_frames_pending = 2; |
| 47 | 47 |
| 48 gl_helper_.reset(new display_compositor::GLHelper( | 48 gl_helper_.reset(new display_compositor::GLHelper( |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 force_swap = true; | 114 force_swap = true; |
| 115 } | 115 } |
| 116 buffer_queue_->PageFlipComplete(); | 116 buffer_queue_->PageFlipComplete(); |
| 117 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( | 117 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( |
| 118 latency_info, result, params_mac); | 118 latency_info, result, params_mac); |
| 119 if (force_swap) | 119 if (force_swap) |
| 120 client_->SetNeedsRedrawRect(gfx::Rect(swap_size_)); | 120 client_->SetNeedsRedrawRect(gfx::Rect(swap_size_)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace content | 123 } // namespace content |
| OLD | NEW |