summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qioscontext.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/ios/qioscontext.mm')
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm
index 87bcc01d04..0c4bee1ef0 100644
--- a/src/plugins/platforms/ios/qioscontext.mm
+++ b/src/plugins/platforms/ios/qioscontext.mm
@@ -151,17 +151,17 @@ GLuint QIOSContext::defaultFramebufferObject(QPlatformSurface *surface) const
connect(window, SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*)));
}
- // Ensure that the FBO's buffers match the size of the window
+ // Ensure that the FBO's buffers match the size of the layer
QIOSWindow *platformWindow = static_cast<QIOSWindow *>(surface);
- if (framebufferObject.renderbufferWidth != platformWindow->effectiveWidth() ||
- framebufferObject.renderbufferHeight != platformWindow->effectiveHeight()) {
+ UIView *view = reinterpret_cast<UIView *>(platformWindow->winId());
+ CAEAGLLayer *layer = static_cast<CAEAGLLayer *>(view.layer);
+ if (framebufferObject.renderbufferWidth != (layer.frame.size.width * layer.contentsScale) ||
+ framebufferObject.renderbufferHeight != (layer.frame.size.height * layer.contentsScale)) {
[EAGLContext setCurrentContext:m_eaglContext];
glBindFramebuffer(GL_FRAMEBUFFER, framebufferObject.handle);
glBindRenderbuffer(GL_RENDERBUFFER, framebufferObject.colorRenderbuffer);
- UIView *view = reinterpret_cast<UIView *>(platformWindow->winId());
- CAEAGLLayer *layer = static_cast<CAEAGLLayer *>(view.layer);
[m_eaglContext renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer];
glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &framebufferObject.renderbufferWidth);
@@ -200,7 +200,7 @@ void QIOSContext::windowDestroyed(QObject *object)
QFunctionPointer QIOSContext::getProcAddress(const QByteArray& functionName)
{
- return reinterpret_cast<QFunctionPointer>(dlsym(RTLD_NEXT, functionName.constData()));
+ return QFunctionPointer(dlsym(RTLD_DEFAULT, functionName.constData()));
}
#include "moc_qioscontext.cpp"