Fix image format use in cocoa plugin
authorGunnar Sletta <gunnar.sletta@nokia.com>
Thu, 1 Dec 2011 10:06:13 +0000 (11:06 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 1 Dec 2011 11:34:16 +0000 (12:34 +0100)
The screen should be opaque. It is used to create the
default pixmap data which should be RGB32 on mac.

The backing store uses premultiplied in the resize but
initializes with non premultiplied. Unify this to all
premultiplied

Change-Id: I7d17d492fcff30b555a768da852ff9be0a9d96aa
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/plugins/platforms/cocoa/qcocoabackingstore.mm
src/plugins/platforms/cocoa/qcocoaintegration.mm

index 5a59fb5..0cde196 100644 (file)
@@ -63,7 +63,7 @@ QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
     const QRect geo = window->geometry();
     NSRect rect = NSMakeRect(geo.x(),geo.y(),geo.width(),geo.height());
 
-    m_image = new QImage(window->geometry().size(),QImage::Format_ARGB32);
+    m_image = new QImage(window->geometry().size(),QImage::Format_ARGB32_Premultiplied);
 }
 
 QCocoaBackingStore::~QCocoaBackingStore()
index 353ed0f..445f67f 100644 (file)
@@ -70,7 +70,7 @@ QCocoaScreen::QCocoaScreen(int screenIndex)
     NSRect rect = [m_screen frame];
     m_geometry = QRect(rect.origin.x,rect.origin.y,rect.size.width,rect.size.height);
 
-    m_format = QImage::Format_ARGB32;
+    m_format = QImage::Format_RGB32;
 
     m_depth = NSBitsPerPixelFromDepth([m_screen depth]);