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

Unified Diff: gpu/ipc/service/image_transport_surface_overlay_mac.mm

Issue 1918723002: Mac fullscreen low power: Plumb through to AcceleratedWidgetMac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@plumb
Patch Set: Fix widget test Created 4 years, 8 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: gpu/ipc/service/image_transport_surface_overlay_mac.mm
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
index 207e24b176ec6ba33dd56e0b89af47cf8d0cf55f..b75f200523d5e8375bd2973a056acc321db21e75 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -107,6 +107,11 @@ bool ImageTransportSurfaceOverlayMac::Initialize(
ca_context_.reset([
[CAContext contextWithCGSConnection:connection_id options:@{}] retain]);
[ca_context_ setLayer:ca_layer_tree_coordinator_->GetCALayerForDisplay()];
+
+ fullscreen_low_power_ca_context_.reset([
+ [CAContext contextWithCGSConnection:connection_id options:@{}] retain]);
+ [fullscreen_low_power_ca_context_ setLayer:
+ ca_layer_tree_coordinator_->GetFullscreenLowPowerLayerForDisplay()];
}
return true;
}
@@ -144,6 +149,8 @@ void ImageTransportSurfaceOverlayMac::BufferPresented(
void ImageTransportSurfaceOverlayMac::SendAcceleratedSurfaceBuffersSwapped(
gpu::SurfaceHandle surface_handle,
CAContextID ca_context_id,
+ bool fullscreen_low_power_ca_context_valid,
+ CAContextID fullscreen_low_power_ca_context_id,
const gfx::ScopedRefCountedIOSurfaceMachPort& io_surface,
const gfx::Size& size,
float scale_factor,
@@ -153,7 +160,8 @@ void ImageTransportSurfaceOverlayMac::SendAcceleratedSurfaceBuffersSwapped(
"GLImpl", static_cast<int>(gfx::GetGLImplementation()),
"width", size.width());
manager_->delegate()->SendAcceleratedSurfaceBuffersSwapped(
- surface_handle, ca_context_id, io_surface, size, scale_factor,
+ surface_handle, ca_context_id, fullscreen_low_power_ca_context_valid,
+ fullscreen_low_power_ca_context_id, io_surface, size, scale_factor,
std::move(latency_info));
}
@@ -191,18 +199,22 @@ gfx::SwapResult ImageTransportSurfaceOverlayMac::SwapBuffersInternal(
// Send acknowledgement to the browser.
CAContextID ca_context_id = 0;
+ CAContextID fullscreen_low_power_ca_context_id = 0;
gfx::ScopedRefCountedIOSurfaceMachPort io_surface_mach_port;
if (use_remote_layer_api_) {
ca_context_id = [ca_context_ contextId];
+ fullscreen_low_power_ca_context_id =
+ [fullscreen_low_power_ca_context_ contextId];
} else {
IOSurfaceRef io_surface =
ca_layer_tree_coordinator_->GetIOSurfaceForDisplay();
if (io_surface)
io_surface_mach_port.reset(IOSurfaceCreateMachPort(io_surface));
}
- SendAcceleratedSurfaceBuffersSwapped(handle_, ca_context_id,
- io_surface_mach_port, pixel_size_,
- scale_factor_, std::move(latency_info_));
+ SendAcceleratedSurfaceBuffersSwapped(
+ handle_, ca_context_id, fullscreen_low_power_layer_valid,
+ fullscreen_low_power_ca_context_id, io_surface_mach_port, pixel_size_,
+ scale_factor_, std::move(latency_info_));
// Reset all state for the next frame.
latency_info_.clear();
« no previous file with comments | « gpu/ipc/service/image_transport_surface_overlay_mac.h ('k') | ui/accelerated_widget_mac/accelerated_widget_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698