Commit 8000a99e by Corentin Wallez

WindowSurfaceCGL: make resizing work correctly.

Previously the code didn't resize the depth buffer. Also adds a magic setNeedsDisplay call when resizing a CALayer. BUG=angleproject:1233 Change-Id: Id1906312f58d474e95a1b5ebfc15eff4344cd126 Reviewed-on: https://chromium-review.googlesource.com/318450 Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 5faa15bf
...@@ -112,6 +112,9 @@ ...@@ -112,6 +112,9 @@
if ([self frame].size.width != texture.width || [self frame].size.height != texture.height) if ([self frame].size.width != texture.width || [self frame].size.height != texture.height)
{ {
[self setFrame:CGRectMake(0, 0, texture.width, texture.height)]; [self setFrame:CGRectMake(0, 0, texture.width, texture.height)];
// Without this, the OSX compositor / window system doesn't see the resize.
[self setNeedsDisplay];
} }
// TODO(cwallez) support 2.1 contexts too that don't have blitFramebuffer nor the // TODO(cwallez) support 2.1 contexts too that don't have blitFramebuffer nor the
...@@ -251,6 +254,10 @@ egl::Error WindowSurfaceCGL::swap() ...@@ -251,6 +254,10 @@ egl::Error WindowSurfaceCGL::swap()
mStateManager->bindTexture(GL_TEXTURE_2D, texture.texture); mStateManager->bindTexture(GL_TEXTURE_2D, texture.texture);
mFunctions->texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, mFunctions->texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA,
GL_UNSIGNED_BYTE, nullptr); GL_UNSIGNED_BYTE, nullptr);
mStateManager->bindRenderbuffer(GL_RENDERBUFFER, mDSRenderbuffer);
mFunctions->renderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, width, height);
texture.width = width; texture.width = width;
texture.height = height; texture.height = height;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment