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

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

Issue 745453002: Create an AcceleratedWidgetMac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 6 years, 1 month 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 8c4450628e7885b8275398a0659b4d9867022fd5..6d86088403511e81afd3567b168839f7720b0307 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -11,6 +11,7 @@
#include "base/id_map.h"
#include "base/lazy_instance.h"
#include "base/strings/string_number_conversions.h"
+#include "content/browser/compositor/gpu_process_transport_factory.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/browser/gpu/gpu_data_manager_impl.h"
#include "content/browser/gpu/gpu_process_host.h"
@@ -40,6 +41,11 @@ namespace {
#undef DestroyAll
#endif
+void OnSurfaceDisplayedCallback(int output_surface_id) {
+ content::ImageTransportFactory::GetInstance()->OnSurfaceDisplayed(
+ output_surface_id);
+}
+
base::LazyInstance<IDMap<GpuProcessHostUIShim> > g_hosts_by_id =
LAZY_INSTANCE_INITIALIZER;
@@ -261,13 +267,13 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(
DCHECK(IsDelegatedRendererEnabled());
gfx::AcceleratedWidget native_widget =
content::GpuSurfaceTracker::Get()->AcquireNativeWidget(params.surface_id);
- BrowserCompositorCALayerTreeMacGotAcceleratedFrame(
+ AcceleratedWidgetMacGotAcceleratedFrame(
native_widget,
params.surface_handle,
- params.surface_id,
params.latency_info,
params.size,
params.scale_factor,
+ base::Bind(&OnSurfaceDisplayedCallback, params.surface_id),
&ack_params.disable_throttling,
&ack_params.renderer_id);
Send(new AcceleratedSurfaceMsg_BufferPresented(params.route_id, ack_params));

Powered by Google App Engine
This is Rietveld 408576698