Ensure the openGLContext is current before trying to reshape the viewport

Make sure to call ensureGLContext before calling OpenGL functions

BUG=webrtc:7751

Review-Url: https://codereview.webrtc.org/2916583005
Cr-Commit-Position: refs/heads/master@{#18511}
This commit is contained in:
adam.fedor
2017-06-09 05:16:10 -07:00
committed by Commit Bot
parent b1f2ff900e
commit fee994c367

View File

@ -77,6 +77,7 @@ static CVReturn OnDisplayLinkFired(CVDisplayLinkRef displayLink,
- (void)reshape {
[super reshape];
NSRect frame = [self frame];
[self ensureGLContext];
CGLLockContext([[self openGLContext] CGLContextObj]);
glViewport(0, 0, frame.size.width, frame.size.height);
CGLUnlockContext([[self openGLContext] CGLContextObj]);