diff options
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 6 | ||||
-rw-r--r-- | src/gui/painting/qwindowsurface_s60.cpp | 17 |
3 files changed, 14 insertions, 12 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index e1155ad..06e47a7 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -541,7 +541,8 @@ void QSymbianControl::Draw(const TRect& r) const QS60WindowSurface *s60Surface = static_cast<QS60WindowSurface *>(qwidget->windowSurface()); CFbsBitmap *bitmap = s60Surface->symbianBitmap(); CWindowGc &gc = SystemGc(); - gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); + if (qwidget->d_func()->isOpaque) + gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); gc.BitBlt(r.iTl, bitmap, r); } else { surface->flush(qwidget, QRegion(qt_TRect2QRect(r)), QPoint()); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 20325c2..f78b5be 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -206,7 +206,8 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO if (q->testAttribute(Qt::WA_TranslucentBackground)) { RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow); TDisplayMode gotDM = (TDisplayMode)rwindow->SetRequiredDisplayMode(EColor16MA); - int erro = rwindow->SetTransparencyAlphaChannel(); + if (rwindow->SetTransparencyAlphaChannel() == KErrNone) + rwindow->SetBackgroundColor(~0); } } @@ -451,7 +452,8 @@ void QWidgetPrivate::s60UpdateIsOpaque() QTLWExtra *topExtra = topData(); RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow); TDisplayMode gotDM = (TDisplayMode)rwindow->SetRequiredDisplayMode(EColor16MA); - int erro = rwindow->SetTransparencyAlphaChannel(); + if (rwindow->SetTransparencyAlphaChannel() == KErrNone) + rwindow->SetBackgroundColor(~0); } else { QTLWExtra *topExtra = topData(); RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow); 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; |