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

Unified Diff: content/browser/compositor/browser_compositor_view_mac.mm

Issue 454243002: Make GPU back-pressure work with remote CALayers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix flashes Created 6 years, 4 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/compositor/browser_compositor_view_mac.mm
diff --git a/content/browser/compositor/browser_compositor_view_mac.mm b/content/browser/compositor/browser_compositor_view_mac.mm
index 32e8bfab8c85626209e0e868327c94895c7a6fd4..9feeefaa09248d8a0aad1bfa8ca029a3cf0f10c4 100644
--- a/content/browser/compositor/browser_compositor_view_mac.mm
+++ b/content/browser/compositor/browser_compositor_view_mac.mm
@@ -6,7 +6,9 @@
#include "base/debug/trace_event.h"
#include "base/lazy_instance.h"
+#include "content/browser/gpu/gpu_process_host_ui_shim.h"
#include "content/browser/compositor/browser_compositor_view_private_mac.h"
+#include "content/common/gpu/gpu_messages.h"
////////////////////////////////////////////////////////////////////////////////
// BrowserCompositorViewMac
@@ -76,12 +78,25 @@ void BrowserCompositorViewMac::GotAcceleratedFrame(
gfx::AcceleratedWidget widget,
uint64 surface_handle, int surface_id,
const std::vector<ui::LatencyInfo>& latency_info,
- gfx::Size pixel_size, float scale_factor) {
+ gfx::Size pixel_size, float scale_factor,
+ int gpu_host_id, int gpu_route_id) {
BrowserCompositorViewMacInternal* internal_view =
BrowserCompositorViewMacInternal::FromAcceleratedWidget(widget);
+ int renderer_id = 0;
if (internal_view) {
internal_view->GotAcceleratedFrame(
surface_handle, surface_id, latency_info, pixel_size, scale_factor);
+ renderer_id = internal_view->GetRendererID();
+ }
+
+ // Acknowledge the swap, now that it has been processed.
+ AcceleratedSurfaceMsg_BufferPresented_Params ack_params;
+ ack_params.sync_point = 0;
+ ack_params.renderer_id = renderer_id;
+ GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id);
+ if (ui_shim) {
+ ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(
+ gpu_route_id, ack_params));
}
}

Powered by Google App Engine
This is Rietveld 408576698