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

Side by Side Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

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, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 params.surface_handle); 249 params.surface_handle);
250 base::ScopedCFTypeRef<IOSurfaceRef> io_surface; 250 base::ScopedCFTypeRef<IOSurfaceRef> io_surface;
251 CAContextID ca_context_id = params.ca_context_id; 251 CAContextID ca_context_id = params.ca_context_id;
252 252
253 DCHECK((params.ca_context_id == 0) ^ 253 DCHECK((params.ca_context_id == 0) ^
254 (params.io_surface.get() == MACH_PORT_NULL)); 254 (params.io_surface.get() == MACH_PORT_NULL));
255 if (params.io_surface.get()) { 255 if (params.io_surface.get()) {
256 io_surface.reset(IOSurfaceLookupFromMachPort(params.io_surface)); 256 io_surface.reset(IOSurfaceLookupFromMachPort(params.io_surface));
257 } 257 }
258 258
259 ui::AcceleratedWidgetMacGotFrame(native_widget, ca_context_id, io_surface, 259 ui::AcceleratedWidgetMacGotFrame(
260 params.size, params.scale_factor, 260 native_widget, ca_context_id,
261 &ack_params.vsync_timebase, 261 params.fullscreen_low_power_ca_context_valid,
262 &ack_params.vsync_interval); 262 params.fullscreen_low_power_ca_context_id, io_surface, params.size,
263 params.scale_factor, &ack_params.vsync_timebase,
264 &ack_params.vsync_interval);
263 } else { 265 } else {
264 TRACE_EVENT0("browser", "Skipping recycled surface frame"); 266 TRACE_EVENT0("browser", "Skipping recycled surface frame");
265 } 267 }
266 268
267 content::ImageTransportFactory::GetInstance()->OnGpuSwapBuffersCompleted( 269 content::ImageTransportFactory::GetInstance()->OnGpuSwapBuffersCompleted(
268 params.surface_handle, params.latency_info, gfx::SwapResult::SWAP_ACK); 270 params.surface_handle, params.latency_info, gfx::SwapResult::SWAP_ACK);
269 271
270 Send(new AcceleratedSurfaceMsg_BufferPresented(ack_params)); 272 Send(new AcceleratedSurfaceMsg_BufferPresented(ack_params));
271 } 273 }
272 #endif 274 #endif
273 275
274 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( 276 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived(
275 const gpu::VideoMemoryUsageStats& video_memory_usage_stats) { 277 const gpu::VideoMemoryUsageStats& video_memory_usage_stats) {
276 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( 278 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats(
277 video_memory_usage_stats); 279 video_memory_usage_stats);
278 } 280 }
279 281
280 } // namespace content 282 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698