| 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" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/output/output_surface_client.h" | 10 #include "cc/output/output_surface_client.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 const gfx::Size& size, | 92 const gfx::Size& size, |
| 93 float scale_factor, | 93 float scale_factor, |
| 94 bool alpha) { | 94 bool alpha) { |
| 95 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor, alpha); | 95 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor, alpha); |
| 96 DCHECK(output_surface_); | 96 DCHECK(output_surface_); |
| 97 output_surface_->Reshape(SurfaceSize(), scale_factor); | 97 output_surface_->Reshape(SurfaceSize(), scale_factor); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void GpuSurfacelessBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( | 100 void GpuSurfacelessBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( |
| 101 const std::vector<ui::LatencyInfo>& latency_info, | 101 const std::vector<ui::LatencyInfo>& latency_info, |
| 102 gfx::SwapResult result) { | 102 gfx::SwapResult result, |
| 103 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { |
| 103 bool force_swap = false; | 104 bool force_swap = false; |
| 104 if (result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) { | 105 if (result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) { |
| 105 // Even through the swap failed, this is a fixable error so we can pretend | 106 // Even through the swap failed, this is a fixable error so we can pretend |
| 106 // it succeeded to the rest of the system. | 107 // it succeeded to the rest of the system. |
| 107 result = gfx::SwapResult::SWAP_ACK; | 108 result = gfx::SwapResult::SWAP_ACK; |
| 108 output_surface_->RecreateBuffers(); | 109 output_surface_->RecreateBuffers(); |
| 109 force_swap = true; | 110 force_swap = true; |
| 110 } | 111 } |
| 111 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted(latency_info, | 112 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( |
| 112 result); | 113 latency_info, result, params_mac); |
| 113 if (force_swap) | 114 if (force_swap) |
| 114 client_->SetNeedsRedrawRect(gfx::Rect(SurfaceSize())); | 115 client_->SetNeedsRedrawRect(gfx::Rect(SurfaceSize())); |
| 115 } | 116 } |
| 116 | 117 |
| 117 } // namespace content | 118 } // namespace content |
| OLD | NEW |