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" | |
8 #include "cc/output/output_surface_client.h" | 7 #include "cc/output/output_surface_client.h" |
| 8 #include "cc/output/output_surface_frame.h" |
9 #include "components/display_compositor/compositor_overlay_candidate_validator.h
" | 9 #include "components/display_compositor/compositor_overlay_candidate_validator.h
" |
10 #include "content/browser/gpu/gpu_surface_tracker.h" | 10 #include "content/browser/gpu/gpu_surface_tracker.h" |
11 #include "content/common/gpu/client/context_provider_command_buffer.h" | 11 #include "content/common/gpu/client/context_provider_command_buffer.h" |
12 #include "gpu/GLES2/gl2extchromium.h" | 12 #include "gpu/GLES2/gl2extchromium.h" |
13 #include "gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h" | 13 #include "gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h" |
14 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" | 14 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" |
15 #include "ui/base/cocoa/remote_layer_api.h" | 15 #include "ui/base/cocoa/remote_layer_api.h" |
16 #include "ui/compositor/compositor.h" | 16 #include "ui/compositor/compositor.h" |
17 #include "ui/display/types/display_snapshot.h" | 17 #include "ui/display/types/display_snapshot.h" |
18 #include "ui/gfx/mac/io_surface.h" | 18 #include "ui/gfx/mac/io_surface.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 std::move(overlay_candidate_validator), | 66 std::move(overlay_candidate_validator), |
67 GL_TEXTURE_RECTANGLE_ARB, | 67 GL_TEXTURE_RECTANGLE_ARB, |
68 GL_RGBA, | 68 GL_RGBA, |
69 gfx::BufferFormat::RGBA_8888, | 69 gfx::BufferFormat::RGBA_8888, |
70 gpu_memory_buffer_manager), | 70 gpu_memory_buffer_manager), |
71 widget_(widget), | 71 widget_(widget), |
72 remote_layers_(new RemoteLayers) {} | 72 remote_layers_(new RemoteLayers) {} |
73 | 73 |
74 GpuOutputSurfaceMac::~GpuOutputSurfaceMac() {} | 74 GpuOutputSurfaceMac::~GpuOutputSurfaceMac() {} |
75 | 75 |
76 void GpuOutputSurfaceMac::SwapBuffers(cc::CompositorFrame frame) { | 76 void GpuOutputSurfaceMac::SwapBuffers(cc::OutputSurfaceFrame frame) { |
77 GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(std::move(frame)); | 77 GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(std::move(frame)); |
78 | 78 |
79 if (should_show_frames_state_ == | 79 if (should_show_frames_state_ == |
80 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED) { | 80 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED) { |
81 should_show_frames_state_ = SHOULD_SHOW_FRAMES; | 81 should_show_frames_state_ = SHOULD_SHOW_FRAMES; |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 void GpuOutputSurfaceMac::OnGpuSwapBuffersCompleted( | 85 void GpuOutputSurfaceMac::OnGpuSwapBuffersCompleted( |
86 const std::vector<ui::LatencyInfo>& latency_info, | 86 const std::vector<ui::LatencyInfo>& latency_info, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED; | 134 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED; |
135 } | 135 } |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 bool GpuOutputSurfaceMac::SurfaceIsSuspendForRecycle() const { | 139 bool GpuOutputSurfaceMac::SurfaceIsSuspendForRecycle() const { |
140 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; | 140 return should_show_frames_state_ == SHOULD_NOT_SHOW_FRAMES_SUSPENDED; |
141 } | 141 } |
142 | 142 |
143 } // namespace content | 143 } // namespace content |
OLD | NEW |