From d08436fbe0bd8da16aec2a0936c7d768e4045bfa Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 21 Sep 2009 13:12:56 +0100 Subject: Removed hack in QSymbianControl for blitting a transparent bitmap in place of the backing store region --- src/3rdparty/phonon/mmf/videoplayer.cpp | 22 ++-------------------- src/gui/kernel/qapplication_s60.cpp | 13 ------------- src/gui/kernel/qt_s60_p.h | 29 ----------------------------- 3 files changed, 2 insertions(+), 62 deletions(-) diff --git a/src/3rdparty/phonon/mmf/videoplayer.cpp b/src/3rdparty/phonon/mmf/videoplayer.cpp index cc56671..7b4626c 100644 --- a/src/3rdparty/phonon/mmf/videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/videoplayer.cpp @@ -30,8 +30,6 @@ along with this library. If not, see . #include "objectdump.h" #endif -#include // for QSymbianControl - QT_BEGIN_NAMESPACE using namespace Phonon; @@ -405,28 +403,12 @@ void MMF::VideoPlayer::getNativeWindowSystemHandles() VideoOutput& output = videoOutput(); CCoeControl* const control = output.winId(); - - // Inform control that it needs to brush rather than blit the backing store - QSymbianControl* const symbianControl = static_cast(control); - //symbianControl->setBlit(0xff00ff00); // opaque green - //symbianControl->setBlit(0x0000ff00); // transparent green - symbianControl->setBlit(0x00000000); // transparent black - + CCoeEnv* const coeEnv = control->ControlEnv(); m_wsSession = &(coeEnv->WsSession()); m_screenDevice = coeEnv->ScreenDevice(); m_window = control->DrawableWindow(); - -/* - // Set background window color - RWindow *const window = static_cast(m_window); - const TDisplayMode displayMode = static_cast(window->SetRequiredDisplayMode(EColor16MA)); - //const TInt err = window->SetTransparencyAlphaChannel(); - //if (err == KErrNone) - window->SetBackgroundColor(TRgb(255, 0, 255, 255)); - window->Invalidate(); // force a redraw -*/ - + #ifdef _DEBUG QScopedPointer dumper(new ObjectDump::QDumper); dumper->setPrefix("Phonon::MMF"); // to aid searchability of logs diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index e3f3376..4c96a2a 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -666,14 +666,6 @@ void QSymbianControl::Draw(const TRect& r) const if (qwidget->d_func()->isOpaque) gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); - if(m_bitmap.data()) { - //gc.BitBlt(r.iTl, m_bitmap.data(), TRect(TPoint(), r.Size())); - - gc.SetBrushColor(TRgb(0, 0, 0, 0)); - gc.SetBrushStyle(CGraphicsContext::ESolidBrush); - gc.Clear(r); - } - else gc.BitBlt(r.iTl, bitmap, r); } else { surface->flush(qwidget, QRegion(qt_TRect2QRect(r)), QPoint()); @@ -709,11 +701,6 @@ void QSymbianControl::SizeChanged() if (!slowResize && tlwExtra) tlwExtra->inTopLevelResize = false; } - - if(m_bitmap.data()) { - m_bitmap->Resize(Size()); - fillBitmap(); - } } } diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 5331504..5870e2c 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -146,8 +146,6 @@ public: void sendInputEvent(QWidget *widget, QInputEvent *inputEvent); void setIgnoreFocusChanged(bool enabled) { m_ignoreFocusChanged = enabled; } void CancelLongTapTimer(); - - void setBlit(TUint32 color); protected: void Draw(const TRect& aRect) const; @@ -161,41 +159,14 @@ private: TKeyResponse sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent); void sendMouseEvent(QWidget *widget, QMouseEvent *mEvent); void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ); - - void fillBitmap(); private: QWidget *qwidget; bool m_ignoreFocusChanged; QLongTapTimer* m_longTapDetector; bool m_previousEventLongTap; - - QScopedPointer m_bitmap; - TUint32 m_color; }; - - -inline void QSymbianControl::setBlit(TUint32 color) -{ - m_bitmap.reset( q_check_ptr(new CFbsBitmap) ); // CBase derived object needs check on new - qt_symbian_throwIfError( m_bitmap->Create(Size(), EColor16MA) ); - - // Not sure if bitmap pixel data is zero-initialized, so do it here to make sure - m_color = color; - fillBitmap(); -} - -inline void QSymbianControl::fillBitmap() -{ - TUint32* ptr = m_bitmap->DataAddress(); - for(int y=0; y