| 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 } | 92 } |
| 93 | 93 |
| 94 void GpuSurfacelessBrowserCompositorOutputSurface::Reshape( | 94 void GpuSurfacelessBrowserCompositorOutputSurface::Reshape( |
| 95 const gfx::Size& size, | 95 const gfx::Size& size, |
| 96 float scale_factor, | 96 float scale_factor, |
| 97 const gfx::ColorSpace& color_space, | 97 const gfx::ColorSpace& color_space, |
| 98 bool alpha) { | 98 bool alpha) { |
| 99 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor, color_space, | 99 GpuBrowserCompositorOutputSurface::Reshape(size, scale_factor, color_space, |
| 100 alpha); | 100 alpha); |
| 101 DCHECK(buffer_queue_); | 101 DCHECK(buffer_queue_); |
| 102 // TODO(ccameron): Plumb the color profile to the output GpuMemoryBuffer. | 102 buffer_queue_->Reshape(SurfaceSize(), scale_factor, color_space); |
| 103 // https://crbug.com/622133 | |
| 104 buffer_queue_->Reshape(SurfaceSize(), scale_factor); | |
| 105 } | 103 } |
| 106 | 104 |
| 107 void GpuSurfacelessBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( | 105 void GpuSurfacelessBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( |
| 108 const std::vector<ui::LatencyInfo>& latency_info, | 106 const std::vector<ui::LatencyInfo>& latency_info, |
| 109 gfx::SwapResult result, | 107 gfx::SwapResult result, |
| 110 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { | 108 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) { |
| 111 bool force_swap = false; | 109 bool force_swap = false; |
| 112 if (result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) { | 110 if (result == gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS) { |
| 113 // Even through the swap failed, this is a fixable error so we can pretend | 111 // Even through the swap failed, this is a fixable error so we can pretend |
| 114 // it succeeded to the rest of the system. | 112 // it succeeded to the rest of the system. |
| 115 result = gfx::SwapResult::SWAP_ACK; | 113 result = gfx::SwapResult::SWAP_ACK; |
| 116 buffer_queue_->RecreateBuffers(); | 114 buffer_queue_->RecreateBuffers(); |
| 117 force_swap = true; | 115 force_swap = true; |
| 118 } | 116 } |
| 119 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( | 117 GpuBrowserCompositorOutputSurface::OnGpuSwapBuffersCompleted( |
| 120 latency_info, result, params_mac); | 118 latency_info, result, params_mac); |
| 121 if (force_swap) | 119 if (force_swap) |
| 122 client_->SetNeedsRedrawRect(gfx::Rect(SurfaceSize())); | 120 client_->SetNeedsRedrawRect(gfx::Rect(SurfaceSize())); |
| 123 } | 121 } |
| 124 | 122 |
| 125 } // namespace content | 123 } // namespace content |
| OLD | NEW |