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

Unified Diff: talk/app/webrtc/objc/RTCEAGLVideoView.m

Issue 1347013002: RTCEAGLVideoView: Fix GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT error. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Reworked patch based on enableSetNeedsDisplay Created 5 years, 3 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/objc/RTCEAGLVideoView.m
diff --git a/talk/app/webrtc/objc/RTCEAGLVideoView.m b/talk/app/webrtc/objc/RTCEAGLVideoView.m
index 61040ba1025c2f23eed07f916df93d36b2955d76..961d809b47fc016866ca744492851a958a5d266c 100644
--- a/talk/app/webrtc/objc/RTCEAGLVideoView.m
+++ b/talk/app/webrtc/objc/RTCEAGLVideoView.m
@@ -137,6 +137,7 @@
_glkView.drawableMultisample = GLKViewDrawableMultisampleNone;
_glkView.delegate = self;
_glkView.layer.masksToBounds = YES;
+ _glkView.enableSetNeedsDisplay = NO;
[self addSubview:_glkView];
// Listen to application state in order to clean up OpenGL before app goes
@@ -158,13 +159,7 @@
__weak RTCEAGLVideoView* weakSelf = self;
_timer = [[RTCDisplayLinkTimer alloc] initWithTimerHandler:^{
RTCEAGLVideoView* strongSelf = weakSelf;
- // Don't render if frame hasn't changed.
- if (strongSelf.glRenderer.lastDrawnFrame == strongSelf.i420Frame) {
- return;
- }
- // This tells the GLKView that it's dirty, which will then call the
- // GLKViewDelegate method implemented below.
- [strongSelf.glkView setNeedsDisplay];
+ [strongSelf displayLinkTimerDidFire];
}];
[self setupGL];
}
@@ -213,6 +208,21 @@
#pragma mark - Private
+- (void)displayLinkTimerDidFire {
+ // Don't render if frame hasn't changed.
+ if (_glRenderer.lastDrawnFrame == self.i420Frame) {
+ return;
+ }
+
+ // Only call -[GLKView display] if the drawable size is
+ // non-empty. Calling display will make the GLKView setup it's
magjed_webrtc 2015/09/18 09:24:14 nit: s/it's/its/g
+ // render buffer if necessary, but that will fail with error
+ // GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT if size is empty.
+ if (self.bounds.size.width > 0 && self.bounds.size.height > 0) {
+ [_glkView display];
magjed_webrtc 2015/09/18 09:24:14 It looks like you changed setNeedsDisplay to displ
+ }
+}
+
- (void)setupGL {
self.i420Frame = nil;
[_glRenderer setupGL];
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698