Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: gpu/ipc/service/pass_through_image_transport_surface.cc

Issue 1962493002: Make Mac swap code like other platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/ipc/service/image_transport_surface_overlay_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/service/gpu_command_buffer_stub.h" 12 #include "gpu/ipc/service/gpu_command_buffer_stub.h"
12 #include "ui/gfx/vsync_provider.h" 13 #include "ui/gfx/vsync_provider.h"
13 #include "ui/gl/gl_context.h" 14 #include "ui/gl/gl_context.h"
14 #include "ui/gl/gl_switches.h" 15 #include "ui/gl/gl_switches.h"
15 16
16 namespace gpu { 17 namespace gpu {
17 18
18 PassThroughImageTransportSurface::PassThroughImageTransportSurface( 19 PassThroughImageTransportSurface::PassThroughImageTransportSurface(
19 GpuChannelManager* /* manager */, 20 GpuChannelManager* /* manager */,
20 GpuCommandBufferStub* stub, 21 GpuCommandBufferStub* stub,
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void PassThroughImageTransportSurface::FinishSwapBuffers( 161 void PassThroughImageTransportSurface::FinishSwapBuffers(
161 std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info, 162 std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info,
162 gfx::SwapResult result) { 163 gfx::SwapResult result) {
163 base::TimeTicks swap_ack_time = base::TimeTicks::Now(); 164 base::TimeTicks swap_ack_time = base::TimeTicks::Now();
164 for (auto& latency : *latency_info) { 165 for (auto& latency : *latency_info) {
165 latency.AddLatencyNumberWithTimestamp( 166 latency.AddLatencyNumberWithTimestamp(
166 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0, 167 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0,
167 swap_ack_time, 1); 168 swap_ack_time, 1);
168 } 169 }
169 170
170 stub_->SendSwapBuffersCompleted(*latency_info, result); 171 GpuCommandBufferMsg_SwapBuffersCompleted_Params params;
172 params.latency_info = *latency_info;
173 params.result = result;
174 stub_->SendSwapBuffersCompleted(params);
171 } 175 }
172 176
173 void PassThroughImageTransportSurface::FinishSwapBuffersAsync( 177 void PassThroughImageTransportSurface::FinishSwapBuffersAsync(
174 std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info, 178 std::unique_ptr<std::vector<ui::LatencyInfo>> latency_info,
175 GLSurface::SwapCompletionCallback callback, 179 GLSurface::SwapCompletionCallback callback,
176 gfx::SwapResult result) { 180 gfx::SwapResult result) {
177 FinishSwapBuffers(std::move(latency_info), result); 181 FinishSwapBuffers(std::move(latency_info), result);
178 callback.Run(result); 182 callback.Run(result);
179 } 183 }
180 184
181 } // namespace gpu 185 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/image_transport_surface_overlay_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698