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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 147493011: Use base::ScopedTypeRef for CGL types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again Created 6 years, 10 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
« no previous file with comments | « content/browser/renderer_host/display_link_mac.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index ea748cb61b325d809b857cdba545aec2fa1f5fc6..510dec1e135d990e89ed2b10e04093964c7e7f18 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -1310,7 +1310,8 @@ void RenderWidgetHostViewMac::CompositorSwapBuffers(
RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback;
if (frame_subscriber_->ShouldCaptureFrame(present_time,
&frame, &callback)) {
- CGLSetCurrentContext(compositing_iosurface_context_->cgl_context());
+ gfx::ScopedCGLSetCurrentContext scoped_set_current_context(
+ compositing_iosurface_context_->cgl_context());
compositing_iosurface_->SetIOSurfaceWithContextCurrent(
compositing_iosurface_context_, surface_handle, size,
surface_scale_factor);
@@ -1352,7 +1353,8 @@ void RenderWidgetHostViewMac::CompositorSwapBuffers(
// Make the context current and update the IOSurface with the handle
// passed in by the swap command.
- CGLSetCurrentContext(compositing_iosurface_context_->cgl_context());
+ gfx::ScopedCGLSetCurrentContext scoped_set_current_context(
+ compositing_iosurface_context_->cgl_context());
if (!compositing_iosurface_->SetIOSurfaceWithContextCurrent(
compositing_iosurface_context_, surface_handle, size,
surface_scale_factor)) {
@@ -1376,7 +1378,8 @@ void RenderWidgetHostViewMac::CompositorSwapBuffers(
compositing_iosurface_->CopyToVideoFrame(
gfx::Rect(size), frame,
base::Bind(callback, present_time));
- CGLSetCurrentContext(compositing_iosurface_context_->cgl_context());
+ DCHECK_EQ(CGLGetCurrentContext(),
+ compositing_iosurface_context_->cgl_context());
}
}
@@ -2911,7 +2914,7 @@ void RenderWidgetHostViewMac::TickPendingLatencyInfoDelay() {
NSRectFill(dirtyRect);
}
- CGLSetCurrentContext(
+ gfx::ScopedCGLSetCurrentContext scoped_set_current_context(
renderWidgetHostView_->compositing_iosurface_context_->cgl_context());
if (renderWidgetHostView_->DrawIOSurfaceWithoutCoreAnimation())
return;
« no previous file with comments | « content/browser/renderer_host/display_link_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698