| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_output_surface_mac.h" | 5 #include "content/browser/compositor/gpu_output_surface_mac.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" |
| 7 #include "components/display_compositor/compositor_overlay_candidate_validator.h
" | 8 #include "components/display_compositor/compositor_overlay_candidate_validator.h
" |
| 8 #include "content/browser/gpu/gpu_surface_tracker.h" | 9 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 9 #include "content/common/gpu/client/context_provider_command_buffer.h" | 10 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 10 #include "gpu/GLES2/gl2extchromium.h" | 11 #include "gpu/GLES2/gl2extchromium.h" |
| 11 #include "gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h" | 12 #include "gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h" |
| 12 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" | 13 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" |
| 13 #include "ui/base/cocoa/remote_layer_api.h" | 14 #include "ui/base/cocoa/remote_layer_api.h" |
| 14 #include "ui/gfx/mac/io_surface.h" | 15 #include "ui/gfx/mac/io_surface.h" |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 std::move(vsync_manager), | 60 std::move(vsync_manager), |
| 60 begin_frame_source, | 61 begin_frame_source, |
| 61 std::move(overlay_candidate_validator), | 62 std::move(overlay_candidate_validator), |
| 62 GL_TEXTURE_RECTANGLE_ARB, | 63 GL_TEXTURE_RECTANGLE_ARB, |
| 63 GL_RGBA, | 64 GL_RGBA, |
| 64 gpu_memory_buffer_manager), | 65 gpu_memory_buffer_manager), |
| 65 remote_layers_(new RemoteLayers) {} | 66 remote_layers_(new RemoteLayers) {} |
| 66 | 67 |
| 67 GpuOutputSurfaceMac::~GpuOutputSurfaceMac() {} | 68 GpuOutputSurfaceMac::~GpuOutputSurfaceMac() {} |
| 68 | 69 |
| 69 void GpuOutputSurfaceMac::SwapBuffers(cc::CompositorFrame* frame) { | 70 void GpuOutputSurfaceMac::SwapBuffers(cc::CompositorFrame frame) { |
| 70 GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(frame); | 71 GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(std::move(frame)); |
| 71 | 72 |
| 72 if (should_show_frames_state_ == | 73 if (should_show_frames_state_ == |
| 73 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED) { | 74 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED) { |
| 74 should_show_frames_state_ = SHOULD_SHOW_FRAMES; | 75 should_show_frames_state_ = SHOULD_SHOW_FRAMES; |
| 75 } | 76 } |
| 76 } | 77 } |
| 77 | 78 |
| 78 void GpuOutputSurfaceMac::OnGpuSwapBuffersCompleted( | 79 void GpuOutputSurfaceMac::OnGpuSwapBuffersCompleted( |
| 79 const std::vector<ui::LatencyInfo>& latency_info, | 80 const std::vector<ui::LatencyInfo>& latency_info, |
| 80 gfx::SwapResult result, | 81 gfx::SwapResult result, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED; | 130 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED; |
| 130 } | 131 } |
| 131 } | 132 } |
| 132 } | 133 } |
| 133 | 134 |
| 134 bool GpuOutputSurfaceMac::SurfaceIsSuspendForRecycle() const { | 135 bool GpuOutputSurfaceMac::SurfaceIsSuspendForRecycle() const { |
| 135 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; | 136 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; |
| 136 } | 137 } |
| 137 | 138 |
| 138 } // namespace content | 139 } // namespace content |
| OLD | NEW |