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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 return buffer_queue_->current_texture_id(); | 66 return buffer_queue_->current_texture_id(); |
67 } | 67 } |
68 | 68 |
69 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers( | 69 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers( |
70 cc::OutputSurfaceFrame frame) { | 70 cc::OutputSurfaceFrame frame) { |
71 DCHECK(buffer_queue_); | 71 DCHECK(buffer_queue_); |
72 DCHECK(reshape_size_ == frame.size); | 72 DCHECK(reshape_size_ == frame.size); |
73 // TODO(ccameron): What if a swap comes again before OnGpuSwapBuffersCompleted | 73 // TODO(ccameron): What if a swap comes again before OnGpuSwapBuffersCompleted |
74 // happens, we'd see the wrong swap size there? | 74 // happens, we'd see the wrong swap size there? |
75 swap_size_ = reshape_size_; | 75 swap_size_ = reshape_size_; |
76 buffer_queue_->SwapBuffers(frame.sub_buffer_rect); | 76 buffer_queue_->SwapBuffers(frame.sub_buffer_rect ? *frame.sub_buffer_rect |
| 77 : gfx::Rect(swap_size_)); |
77 GpuBrowserCompositorOutputSurface::SwapBuffers(std::move(frame)); | 78 GpuBrowserCompositorOutputSurface::SwapBuffers(std::move(frame)); |
78 } | 79 } |
79 | 80 |
80 void GpuSurfacelessBrowserCompositorOutputSurface::BindFramebuffer() { | 81 void GpuSurfacelessBrowserCompositorOutputSurface::BindFramebuffer() { |
81 DCHECK(buffer_queue_); | 82 DCHECK(buffer_queue_); |
82 buffer_queue_->BindFramebuffer(); | 83 buffer_queue_->BindFramebuffer(); |
83 } | 84 } |
84 | 85 |
85 GLenum GpuSurfacelessBrowserCompositorOutputSurface:: | 86 GLenum GpuSurfacelessBrowserCompositorOutputSurface:: |
86 GetFramebufferCopyTextureFormat() { | 87 GetFramebufferCopyTextureFormat() { |
(...skipping 26 matching lines...) Expand all Loading... |
113 force_swap = true; | 114 force_swap = true; |
114 } | 115 } |
115 buffer_queue_->PageFlipComplete(); | 116 buffer_queue_->PageFlipComplete(); |
116 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( | 117 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( |
117 latency_info, result, params_mac); | 118 latency_info, result, params_mac); |
118 if (force_swap) | 119 if (force_swap) |
119 client_->SetNeedsRedrawRect(gfx::Rect(swap_size_)); | 120 client_->SetNeedsRedrawRect(gfx::Rect(swap_size_)); |
120 } | 121 } |
121 | 122 |
122 } // namespace content | 123 } // namespace content |
OLD | NEW |