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

Unified Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

Issue 1416493010: Clean up Mac swap acknowledgement code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update latency info Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_process_host_ui_shim.cc
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index bd16b415de6df300e71e0a081beeb1124dca0438..fde15261b0c2dacf8f50277716cb473ab49fb8ea 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -43,13 +43,6 @@ namespace {
#undef DestroyAll
#endif
-#if defined(OS_MACOSX)
-void OnSurfaceDisplayedCallback(int output_surface_id) {
- content::ImageTransportFactory::GetInstance()->OnSurfaceDisplayed(
- output_surface_id);
-}
-#endif
-
base::LazyInstance<IDMap<GpuProcessHostUIShim> > g_hosts_by_id =
LAZY_INSTANCE_INITIALIZER;
@@ -247,9 +240,7 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(
bool should_not_show_frame =
content::ImageTransportFactory::GetInstance()
->SurfaceShouldNotShowFramesAfterSuspendForRecycle(params.surface_id);
- if (should_not_show_frame) {
- OnSurfaceDisplayedCallback(params.surface_id);
- } else {
+ if (!should_not_show_frame) {
gfx::AcceleratedWidget native_widget =
content::GpuSurfaceTracker::Get()->AcquireNativeWidget(
params.surface_id);
@@ -273,13 +264,16 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(
DLOG(ERROR) << "Unrecognized accelerated frame type.";
return;
}
- ui::AcceleratedWidgetMacGotAcceleratedFrame(
- native_widget, ca_context_id, io_surface, params.latency_info,
- params.size, params.scale_factor, params.damage_rect,
- base::Bind(&OnSurfaceDisplayedCallback, params.surface_id),
- &ack_params.disable_throttling, &ack_params.renderer_id,
- &ack_params.vsync_timebase, &ack_params.vsync_interval);
+
+ ui::AcceleratedWidgetMacGotFrame(native_widget, ca_context_id, io_surface,
+ params.size, params.scale_factor,
+ &ack_params.vsync_timebase,
+ &ack_params.vsync_interval);
}
+
+ content::ImageTransportFactory::GetInstance()->OnGpuSwapBuffersCompleted(
+ params.surface_id, params.latency_info, gfx::SwapResult::SWAP_ACK);
+
Send(new AcceleratedSurfaceMsg_BufferPresented(params.route_id, ack_params));
}
#endif

Powered by Google App Engine
This is Rietveld 408576698