summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qwindowsurface_s60.cpp
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-04-24 09:58:44 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-04-28 14:42:22 (GMT)
commit6143217a8594c40d693e4ffceb914bc927f43b05 (patch)
treedb8f11c76e0921330f86da264886adf1d16e2d65 /src/gui/painting/qwindowsurface_s60.cpp
parentc4e2008731cd7c9df922921c52294f84205fccb9 (diff)
downloadQt-6143217a8594c40d693e4ffceb914bc927f43b05.zip
Qt-6143217a8594c40d693e4ffceb914bc927f43b05.tar.gz
Qt-6143217a8594c40d693e4ffceb914bc927f43b05.tar.bz2
More work on translucent windows.
One step closer to semi-transparent windows, but not there yet. This gets the transparent contents into the window, but the previous contents are not cleared so it keeps drawing the backing store on top of itself each time a Draw() is done. SetBackgroundColor() indicates to WSERV that our window is semi-transparent. We also make sure not to use 'EDrawModeWriteAlpha' when the widget is non-opaque since this actually changes the alpha channel on the frame buffer (not the window) so the gives undesired results. It's a faster draw mode though so we should use it where we can.
Diffstat (limited to 'src/gui/painting/qwindowsurface_s60.cpp')
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index d0c3e1c..50278ce 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -35,12 +35,17 @@ QS60WindowSurface::QS60WindowSurface(QWidget* widget)
d_ptr->bytes = 0;
d_ptr->bitmap = 0;
- TSize size(0, 0);
TDisplayMode mode = S60->screenDevice()->DisplayMode();
+ bool isOpaque = qt_widget_private(widget)->isOpaque;
+ if (mode == EColor16MA && isOpaque)
+ mode = EColor16MU; // Faster since 16MU -> 16MA is typically accelerated
+ else if (mode == EColor16MU && !isOpaque)
+ mode = EColor16MA; // Try for transparency anyway
- // We create empty CFbsBitmap here -> it will be resized in setGeometry
+
+ // We create empty CFbsBitmap here -> it will be resized in setGeometry
d_ptr->bitmap = new (ELeave) CFbsBitmap;
- User::LeaveIfError( d_ptr->bitmap->Create( size, mode ) );
+ User::LeaveIfError( d_ptr->bitmap->Create(TSize(0, 0), mode ) );
updatePaintDeviceOnBitmap();
@@ -143,12 +148,6 @@ void QS60WindowSurface::lockBitmapHeap()
// Get some values for QImage creation
TDisplayMode mode = bitmap->DisplayMode();
- QWidget *win = QS60WindowSurfacePrivate::lockedSurface->window();
- RWindowBase *rwin = win->winId()->DrawableWindow();
- TDisplayMode rwMode = rwin->DisplayMode();
-
- mode = rwMode;
-
if (mode == EColor16MA
&& qt_widget_private(QS60WindowSurfacePrivate::lockedSurface->window())->isOpaque)
mode = EColor16MU;