| 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_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" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 void GpuBrowserCompositorOutputSurface::BindFramebuffer() { | 79 void GpuBrowserCompositorOutputSurface::BindFramebuffer() { |
| 80 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 80 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void GpuBrowserCompositorOutputSurface::Reshape( | 83 void GpuBrowserCompositorOutputSurface::Reshape( |
| 84 const gfx::Size& size, | 84 const gfx::Size& size, |
| 85 float device_scale_factor, | 85 float device_scale_factor, |
| 86 const gfx::ColorSpace& color_space, | 86 const gfx::ColorSpace& color_space, |
| 87 bool has_alpha) { | 87 bool has_alpha, |
| 88 bool use_stencil) { |
| 88 context_provider()->ContextGL()->ResizeCHROMIUM( | 89 context_provider()->ContextGL()->ResizeCHROMIUM( |
| 89 size.width(), size.height(), device_scale_factor, has_alpha); | 90 size.width(), size.height(), device_scale_factor, has_alpha); |
| 90 } | 91 } |
| 91 | 92 |
| 92 void GpuBrowserCompositorOutputSurface::SwapBuffers( | 93 void GpuBrowserCompositorOutputSurface::SwapBuffers( |
| 93 cc::OutputSurfaceFrame frame) { | 94 cc::OutputSurfaceFrame frame) { |
| 94 GetCommandBufferProxy()->SetLatencyInfo(frame.latency_info); | 95 GetCommandBufferProxy()->SetLatencyInfo(frame.latency_info); |
| 95 | 96 |
| 96 gfx::Rect swap_rect = frame.sub_buffer_rect; | 97 gfx::Rect swap_rect = frame.sub_buffer_rect; |
| 97 gfx::Size surface_size = frame.size; | 98 gfx::Size surface_size = frame.size; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { | 138 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { |
| 138 ui::ContextProviderCommandBuffer* provider_command_buffer = | 139 ui::ContextProviderCommandBuffer* provider_command_buffer = |
| 139 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); | 140 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); |
| 140 gpu::CommandBufferProxyImpl* command_buffer_proxy = | 141 gpu::CommandBufferProxyImpl* command_buffer_proxy = |
| 141 provider_command_buffer->GetCommandBufferProxy(); | 142 provider_command_buffer->GetCommandBufferProxy(); |
| 142 DCHECK(command_buffer_proxy); | 143 DCHECK(command_buffer_proxy); |
| 143 return command_buffer_proxy; | 144 return command_buffer_proxy; |
| 144 } | 145 } |
| 145 | 146 |
| 146 } // namespace content | 147 } // namespace content |
| OLD | NEW |