| 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 "gpu/ipc/service/pass_through_image_transport_surface.h" | 5 #include "gpu/ipc/service/pass_through_image_transport_surface.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "gpu/ipc/common/gpu_messages.h" | 11 #include "gpu/ipc/common/gpu_messages.h" |
| 12 #include "gpu/ipc/service/gpu_command_buffer_stub.h" | 12 #include "gpu/ipc/service/gpu_command_buffer_stub.h" |
| 13 #include "ui/gfx/vsync_provider.h" | 13 #include "ui/gfx/vsync_provider.h" |
| 14 #include "ui/gl/gl_context.h" | 14 #include "ui/gl/gl_context.h" |
| 15 #include "ui/gl/gl_switches.h" | 15 #include "ui/gl/gl_switches.h" |
| 16 | 16 |
| 17 namespace gpu { | 17 namespace gpu { |
| 18 | 18 |
| 19 PassThroughImageTransportSurface::PassThroughImageTransportSurface( | 19 PassThroughImageTransportSurface::PassThroughImageTransportSurface( |
| 20 GpuChannelManager* /* manager */, | |
| 21 GpuCommandBufferStub* stub, | 20 GpuCommandBufferStub* stub, |
| 22 gl::GLSurface* surface) | 21 gl::GLSurface* surface) |
| 23 : GLSurfaceAdapter(surface), | 22 : GLSurfaceAdapter(surface), |
| 24 stub_(stub->AsWeakPtr()), | 23 stub_(stub->AsWeakPtr()), |
| 25 did_set_swap_interval_(false), | 24 did_set_swap_interval_(false), |
| 26 weak_ptr_factory_(this) {} | 25 weak_ptr_factory_(this) {} |
| 27 | 26 |
| 28 bool PassThroughImageTransportSurface::Initialize( | 27 bool PassThroughImageTransportSurface::Initialize( |
| 29 gl::GLSurface::Format format) { | 28 gl::GLSurface::Format format) { |
| 30 // The surface is assumed to have already been initialized. | 29 // The surface is assumed to have already been initialized. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 188 |
| 190 void PassThroughImageTransportSurface::FinishSwapBuffersAsync( | 189 void PassThroughImageTransportSurface::FinishSwapBuffersAsync( |
| 191 std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info, | 190 std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info, |
| 192 GLSurface::SwapCompletionCallback callback, | 191 GLSurface::SwapCompletionCallback callback, |
| 193 gfx::SwapResult result) { | 192 gfx::SwapResult result) { |
| 194 FinishSwapBuffers(std::move(latency_info), result); | 193 FinishSwapBuffers(std::move(latency_info), result); |
| 195 callback.Run(result); | 194 callback.Run(result); |
| 196 } | 195 } |
| 197 | 196 |
| 198 } // namespace gpu | 197 } // namespace gpu |
| OLD | NEW |