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

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

Issue 1416363002: Mac: Always use surfaceless mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra diffs 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 9fed072ae4a6f9a37b8024b4f21de78ce16660ae..bd16b415de6df300e71e0a081beeb1124dca0438 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -25,6 +25,7 @@
#include "content/public/browser/browser_thread.h"
#if defined(OS_MACOSX)
+#include "content/browser/browser_io_surface_manager_mac.h"
#include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
#endif
@@ -252,10 +253,29 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(
gfx::AcceleratedWidget native_widget =
content::GpuSurfaceTracker::Get()->AcquireNativeWidget(
params.surface_id);
+ base::ScopedCFTypeRef<IOSurfaceRef> io_surface;
+ CAContextID ca_context_id = 0;
+
+ switch (ui::GetSurfaceHandleType(params.surface_handle)) {
+ case ui::kSurfaceHandleTypeIOSurface: {
+ IOSurfaceID io_surface_id =
+ ui::IOSurfaceIDFromSurfaceHandle(params.surface_handle);
+ io_surface.reset(
+ BrowserIOSurfaceManager::GetInstance()->AcquireIOSurface(
+ gfx::GenericSharedMemoryId(io_surface_id)));
ccameron 2015/10/22 22:16:49 Ensuring that this AcquireIOSurface works is the r
+ break;
+ }
+ case ui::kSurfaceHandleTypeCAContext: {
+ ca_context_id = ui::CAContextIDFromSurfaceHandle(params.surface_handle);
+ break;
+ }
+ default:
+ DLOG(ERROR) << "Unrecognized accelerated frame type.";
+ return;
+ }
ui::AcceleratedWidgetMacGotAcceleratedFrame(
- native_widget, params.surface_handle, params.latency_info, params.size,
- params.scale_factor,
- params.damage_rect,
+ 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);

Powered by Google App Engine
This is Rietveld 408576698