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

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

Issue 1844053002: Add detached mode plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: And target 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 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // no longer attached to, do not pass the frame along to the widget. Just ack 242 // no longer attached to, do not pass the frame along to the widget. Just ack
243 // it to the GPU process immediately, so we can proceed to the next frame. 243 // it to the GPU process immediately, so we can proceed to the next frame.
244 bool should_not_show_frame = 244 bool should_not_show_frame =
245 content::ImageTransportFactory::GetInstance() 245 content::ImageTransportFactory::GetInstance()
246 ->SurfaceShouldNotShowFramesAfterSuspendForRecycle(params.surface_id); 246 ->SurfaceShouldNotShowFramesAfterSuspendForRecycle(params.surface_id);
247 if (!should_not_show_frame) { 247 if (!should_not_show_frame) {
248 gfx::AcceleratedWidget native_widget = 248 gfx::AcceleratedWidget native_widget =
249 content::GpuSurfaceTracker::Get()->AcquireNativeWidget( 249 content::GpuSurfaceTracker::Get()->AcquireNativeWidget(
250 params.surface_id); 250 params.surface_id);
251 base::ScopedCFTypeRef<IOSurfaceRef> io_surface; 251 base::ScopedCFTypeRef<IOSurfaceRef> io_surface;
252 CAContextID ca_context_id = params.ca_context_id;
253
254 DCHECK((params.ca_context_id == 0) ^ 252 DCHECK((params.ca_context_id == 0) ^
255 (params.io_surface.get() == MACH_PORT_NULL)); 253 (params.io_surface.get() == MACH_PORT_NULL));
256 if (params.io_surface.get()) { 254 if (params.io_surface.get()) {
257 io_surface.reset(IOSurfaceLookupFromMachPort(params.io_surface)); 255 io_surface.reset(IOSurfaceLookupFromMachPort(params.io_surface));
258 } 256 }
259 257
260 ui::AcceleratedWidgetMacGotFrame(native_widget, ca_context_id, io_surface, 258 ui::AcceleratedWidgetMacGotFrame(
261 params.size, params.scale_factor, 259 native_widget, params.ca_context_id, io_surface, params.use_detached,
262 &ack_params.vsync_timebase, 260 params.detached_ca_context_id, params.size, params.scale_factor,
263 &ack_params.vsync_interval); 261 &ack_params.vsync_timebase, &ack_params.vsync_interval);
264 } else { 262 } else {
265 TRACE_EVENT0("browser", "Skipping recycled surface frame"); 263 TRACE_EVENT0("browser", "Skipping recycled surface frame");
266 } 264 }
267 265
268 content::ImageTransportFactory::GetInstance()->OnGpuSwapBuffersCompleted( 266 content::ImageTransportFactory::GetInstance()->OnGpuSwapBuffersCompleted(
269 params.surface_id, params.latency_info, gfx::SwapResult::SWAP_ACK); 267 params.surface_id, params.latency_info, gfx::SwapResult::SWAP_ACK);
270 268
271 Send(new AcceleratedSurfaceMsg_BufferPresented(ack_params)); 269 Send(new AcceleratedSurfaceMsg_BufferPresented(ack_params));
272 } 270 }
273 #endif 271 #endif
(...skipping 14 matching lines...) Expand all
288 286
289 void GpuProcessHostUIShim::OnRemoveSubscription(int32_t process_id, 287 void GpuProcessHostUIShim::OnRemoveSubscription(int32_t process_id,
290 unsigned int target) { 288 unsigned int target) {
291 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); 289 RenderProcessHost* rph = RenderProcessHost::FromID(process_id);
292 if (rph) { 290 if (rph) {
293 rph->OnRemoveSubscription(target); 291 rph->OnRemoveSubscription(target);
294 } 292 }
295 } 293 }
296 294
297 } // namespace content 295 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/software_output_device_mac.mm ('k') | content/browser/renderer_host/render_widget_host_view_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698