summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_s60.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2011-03-16 15:53:45 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2011-03-18 15:50:43 (GMT)
commit31514ab488c610056973318f5a950d925155d480 (patch)
treebfc9c2082edc5e6e5dbe1978c7bb61ff659d5aca /src/gui/kernel/qwidget_s60.cpp
parent59373dd338cb9428514b67c21d0e03b8dc189eef (diff)
downloadQt-31514ab488c610056973318f5a950d925155d480.zip
Qt-31514ab488c610056973318f5a950d925155d480.tar.gz
Qt-31514ab488c610056973318f5a950d925155d480.tar.bz2
Add flag for forcibly propagating backing store alpha to framebuffer
Previously, the following rules applies to the creation and blitting of the Symbian raster backing store: 1. Creation of backing store with an alpha channel: Backing store has an alpha channel only if !QWidget::isOpaque. 2. Pre-filling of backing store prior to paint loop: Backing store is filled with transparent pixels if !QWidget::isOpaque. 3. Blitting of backing store: CGraphicsContext::EDrawModeWriteAlpha is used (meaning that backing store alpha values are propagated into the frame buffer), if QWidget::isOpaque. In order for the direct camera viewfinder to be visible on DSA devices, alpha=0 must be written into the framebuffer in the region where the viewfinder will be displayed. This requires a backing store with an alpha channel (1), use of CGraphicsContext::EDrawModeWriteAlpha (3), but not pre-filling of the entire backing store (2). This patch adds a new enum value, QWExtra::BlitWriteAlpha, which can be used by camera backends to achieve the desired behaviour. Task-number: QTMOBILITY-1278 Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/gui/kernel/qwidget_s60.cpp')
-rw-r--r--src/gui/kernel/qwidget_s60.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 62d09fe..b65ae4d 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -805,9 +805,14 @@ void QWidgetPrivate::s60UpdateIsOpaque()
{
Q_Q(QWidget);
- if (!q->testAttribute(Qt::WA_WState_Created) || !q->testAttribute(Qt::WA_TranslucentBackground))
+ if (!q->testAttribute(Qt::WA_WState_Created))
return;
+ const bool writeAlpha = extraData()->nativePaintMode == QWExtra::BlitWriteAlpha;
+ if (!q->testAttribute(Qt::WA_TranslucentBackground) && !writeAlpha)
+ return;
+ const bool requireAlphaChannel = !isOpaque || writeAlpha;
+
createTLExtra();
RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
@@ -819,12 +824,11 @@ void QWidgetPrivate::s60UpdateIsOpaque()
return;
}
#endif
- if (!isOpaque) {
+ if (requireAlphaChannel) {
const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
if (window->SetTransparencyAlphaChannel() == KErrNone) {
window->SetBackgroundColor(TRgb(255, 255, 255, 0));
extra->topextra->nativeWindowTransparencyEnabled = 1;
-
if (extra->topextra->backingStore.data() && (
QApplicationPrivate::graphics_system_name == QLatin1String("openvg")
|| QApplicationPrivate::graphics_system_name == QLatin1String("opengl"))) {