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:
@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user