| 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/compositor_frame.h" | |
| 10 #include "cc/output/output_surface_client.h" | 9 #include "cc/output/output_surface_client.h" |
| 10 #include "cc/output/output_surface_frame.h" |
| 11 #include "components/display_compositor/buffer_queue.h" | 11 #include "components/display_compositor/buffer_queue.h" |
| 12 #include "components/display_compositor/compositor_overlay_candidate_validator.h
" | 12 #include "components/display_compositor/compositor_overlay_candidate_validator.h
" |
| 13 #include "components/display_compositor/gl_helper.h" | 13 #include "components/display_compositor/gl_helper.h" |
| 14 #include "content/browser/compositor/reflector_impl.h" | 14 #include "content/browser/compositor/reflector_impl.h" |
| 15 #include "content/common/gpu/client/context_provider_command_buffer.h" | 15 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 16 #include "gpu/GLES2/gl2extchromium.h" | 16 #include "gpu/GLES2/gl2extchromium.h" |
| 17 #include "gpu/command_buffer/client/gles2_interface.h" | 17 #include "gpu/command_buffer/client/gles2_interface.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const { | 62 const { |
| 63 return true; | 63 return true; |
| 64 } | 64 } |
| 65 | 65 |
| 66 unsigned GpuSurfacelessBrowserCompositorOutputSurface::GetOverlayTextureId() | 66 unsigned GpuSurfacelessBrowserCompositorOutputSurface::GetOverlayTextureId() |
| 67 const { | 67 const { |
| 68 return buffer_queue_->current_texture_id(); | 68 return buffer_queue_->current_texture_id(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers( | 71 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers( |
| 72 cc::CompositorFrame frame) { | 72 cc::OutputSurfaceFrame frame) { |
| 73 DCHECK(buffer_queue_); | 73 DCHECK(buffer_queue_); |
| 74 DCHECK(reshape_size_ == frame.gl_frame_data->size); | 74 DCHECK(reshape_size_ == frame.size); |
| 75 // TODO(ccameron): What if a swap comes again before OnGpuSwapBuffersCompleted | 75 // TODO(ccameron): What if a swap comes again before OnGpuSwapBuffersCompleted |
| 76 // happens, we'd see the wrong swap size there? | 76 // happens, we'd see the wrong swap size there? |
| 77 swap_size_ = reshape_size_; | 77 swap_size_ = reshape_size_; |
| 78 buffer_queue_->SwapBuffers(frame.gl_frame_data->sub_buffer_rect); | 78 buffer_queue_->SwapBuffers(frame.sub_buffer_rect); |
| 79 GpuBrowserCompositorOutputSurface::SwapBuffers(std::move(frame)); | 79 GpuBrowserCompositorOutputSurface::SwapBuffers(std::move(frame)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void GpuSurfacelessBrowserCompositorOutputSurface::BindFramebuffer() { | 82 void GpuSurfacelessBrowserCompositorOutputSurface::BindFramebuffer() { |
| 83 DCHECK(buffer_queue_); | 83 DCHECK(buffer_queue_); |
| 84 buffer_queue_->BindFramebuffer(); | 84 buffer_queue_->BindFramebuffer(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 GLenum GpuSurfacelessBrowserCompositorOutputSurface:: | 87 GLenum GpuSurfacelessBrowserCompositorOutputSurface:: |
| 88 GetFramebufferCopyTextureFormat() { | 88 GetFramebufferCopyTextureFormat() { |
| (...skipping 25 matching lines...) Expand all 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 |