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

Side by Side Diff: content/browser/renderer_host/compositing_iosurface_layer_mac.mm

Issue 231863002: Mac: Recreate browser-side GL contexts on GPU switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove prototype Created 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer_host/compositing_iosurface_layer_mac.h" 5 #include "content/browser/renderer_host/compositing_iosurface_layer_mac.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 #include <OpenGL/gl.h> 8 #include <OpenGL/gl.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 24 matching lines...) Expand all
35 if (renderWidgetHostView_->compositing_iosurface_ && 35 if (renderWidgetHostView_->compositing_iosurface_ &&
36 [self respondsToSelector:(@selector(setContentsScale:))]) { 36 [self respondsToSelector:(@selector(setContentsScale:))]) {
37 [self setContentsScale: 37 [self setContentsScale:
38 renderWidgetHostView_->compositing_iosurface_->scale_factor()]; 38 renderWidgetHostView_->compositing_iosurface_->scale_factor()];
39 } 39 }
40 } 40 }
41 return self; 41 return self;
42 } 42 }
43 43
44 - (void)disableCompositing{ 44 - (void)disableCompositing{
45 // Disable the fade-out animation as the layer is removed.
46 ScopedCAActionDisabler disabler;
47 [self removeFromSuperlayer];
ccameron 2014/04/09 22:06:01 This was always done by the caller, so it was redu
48 renderWidgetHostView_ = nil; 45 renderWidgetHostView_ = nil;
49 } 46 }
50 47
51 - (void)gotNewFrame { 48 - (void)gotNewFrame {
52 if (context_ && context_->is_vsync_disabled()) { 49 if (context_ && context_->is_vsync_disabled()) {
53 // If vsync is disabled, draw immediately and don't bother trying to use 50 // If vsync is disabled, draw immediately and don't bother trying to use
54 // the isAsynchronous property to ensure smooth animation. 51 // the isAsynchronous property to ensure smooth animation.
55 [self setNeedsDisplay]; 52 [self setNeedsDisplay];
56 [self displayIfNeeded]; 53 [self displayIfNeeded];
57 54
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 renderWidgetHostView_->SendPendingLatencyInfoToHost(); 147 renderWidgetHostView_->SendPendingLatencyInfoToHost();
151 renderWidgetHostView_->SendPendingSwapAck(); 148 renderWidgetHostView_->SendPendingSwapAck();
152 149
153 [super drawInCGLContext:glContext 150 [super drawInCGLContext:glContext
154 pixelFormat:pixelFormat 151 pixelFormat:pixelFormat
155 forLayerTime:timeInterval 152 forLayerTime:timeInterval
156 displayTime:timeStamp]; 153 displayTime:timeStamp];
157 } 154 }
158 155
159 @end 156 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698