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

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

Issue 1097223002: Mac: Fix black flashing during tab switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wait for swap to draw frames Created 5 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
« no previous file with comments | « content/browser/compositor/test/no_transport_image_transport_factory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // On Mac with delegated rendering, accelerated surfaces are not necessarily 281 // On Mac with delegated rendering, accelerated surfaces are not necessarily
282 // associated with a RenderWidgetHostViewBase. 282 // associated with a RenderWidgetHostViewBase.
283 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; 283 AcceleratedSurfaceMsg_BufferPresented_Params ack_params;
284 DCHECK(IsDelegatedRendererEnabled()); 284 DCHECK(IsDelegatedRendererEnabled());
285 285
286 // If the frame was intended for an NSView that the gfx::AcceleratedWidget is 286 // If the frame was intended for an NSView that the gfx::AcceleratedWidget is
287 // no longer attached to, do not pass the frame along to the widget. Just ack 287 // no longer attached to, do not pass the frame along to the widget. Just ack
288 // it to the GPU process immediately, so we can proceed to the next frame. 288 // it to the GPU process immediately, so we can proceed to the next frame.
289 bool should_not_show_frame = 289 bool should_not_show_frame =
290 content::ImageTransportFactory::GetInstance() 290 content::ImageTransportFactory::GetInstance()
291 ->SurfaceShouldNotShowFramesAfterRecycle(params.surface_id); 291 ->SurfaceShouldNotShowFramesAfterSuspendForRecycle(params.surface_id);
292 if (should_not_show_frame) { 292 if (should_not_show_frame) {
293 OnSurfaceDisplayedCallback(params.surface_id); 293 OnSurfaceDisplayedCallback(params.surface_id);
294 } else { 294 } else {
295 gfx::AcceleratedWidget native_widget = 295 gfx::AcceleratedWidget native_widget =
296 content::GpuSurfaceTracker::Get()->AcquireNativeWidget( 296 content::GpuSurfaceTracker::Get()->AcquireNativeWidget(
297 params.surface_id); 297 params.surface_id);
298 ui::AcceleratedWidgetMacGotAcceleratedFrame( 298 ui::AcceleratedWidgetMacGotAcceleratedFrame(
299 native_widget, params.surface_handle, params.latency_info, params.size, 299 native_widget, params.surface_handle, params.latency_info, params.size,
300 params.scale_factor, 300 params.scale_factor,
301 base::Bind(&OnSurfaceDisplayedCallback, params.surface_id), 301 base::Bind(&OnSurfaceDisplayedCallback, params.surface_id),
(...skipping 27 matching lines...) Expand all
329 329
330 void GpuProcessHostUIShim::OnRemoveSubscription( 330 void GpuProcessHostUIShim::OnRemoveSubscription(
331 int32 process_id, unsigned int target) { 331 int32 process_id, unsigned int target) {
332 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); 332 RenderProcessHost* rph = RenderProcessHost::FromID(process_id);
333 if (rph) { 333 if (rph) {
334 rph->OnRemoveSubscription(target); 334 rph->OnRemoveSubscription(target);
335 } 335 }
336 } 336 }
337 337
338 } // namespace content 338 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/test/no_transport_image_transport_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698