From f30c66f9ac1bd5ab1582d845ffdae38f865684b9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 26 Oct 2008 02:01:26 +0200 Subject: [PATCH] Remove unused functionality. Remove unused methods, unused flags, always-false conditions, etc. --- src/main/symbian/SDL_main.cpp | 11 -------- src/video/symbian/SDL_epocvideo.cpp | 1 - src/video/symbian/dsa.cpp | 55 +++---------------------------------- symbian/include/internal/dsa.h | 21 ++------------ symbian/include/internal/epoc_sdl.h | 1 - 5 files changed, 7 insertions(+), 82 deletions(-) diff --git a/src/main/symbian/SDL_main.cpp b/src/main/symbian/SDL_main.cpp index 8e02606..a0f70e5 100644 --- a/src/main/symbian/SDL_main.cpp +++ b/src/main/symbian/SDL_main.cpp @@ -106,7 +106,6 @@ class CSdlAppServ : public CActive enum { EAppSrvDsaStatus, - EAppSrvStopThread }; CSdlAppServ(); void ConstructL(); @@ -166,11 +165,6 @@ void CSdlAppServ::RunL() { switch(iService) { - case CSdlAppServ::EAppSrvStopThread: - if(gEpocEnv->iDsa != NULL) - gEpocEnv->iDsa->SetSuspend(); - break; - case EAppSrvDsaStatus: if(gEpocEnv->iDsa != NULL) gEpocEnv->iDsa->Stop(); @@ -206,11 +200,6 @@ TBool EpocSdlEnv::IsDsaAvailable() return gEpocEnv->iDsa != NULL && gEpocEnv->iDsa->IsDsaAvailable(); } -void EpocSdlEnv::WaitDsaAvailable() -{ - gEpocEnv->iAppSrv->Request(CSdlAppServ::EAppSrvStopThread); -} - int EpocSdlEnv::AllocSurface(const TSize& aSize, TDisplayMode aMode) { return gEpocEnv->iDsa->AllocSurface(aSize, aMode); diff --git a/src/video/symbian/SDL_epocvideo.cpp b/src/video/symbian/SDL_epocvideo.cpp index 51e0126..4f7ea92 100644 --- a/src/video/symbian/SDL_epocvideo.cpp +++ b/src/video/symbian/SDL_epocvideo.cpp @@ -711,7 +711,6 @@ static void S60_DirectUpdate(_THIS, int numrects, SDL_Rect *rects) else { SDL_PauseAudio(1); - EpocSdlEnv::WaitDsaAvailable(); } } diff --git a/src/video/symbian/dsa.cpp b/src/video/symbian/dsa.cpp index 9e79700..f9eff5e 100644 --- a/src/video/symbian/dsa.cpp +++ b/src/video/symbian/dsa.cpp @@ -61,7 +61,6 @@ template void CBitmapSurface::UnlockHwSurface() { iBmp->UnlockHeap(); - T::SetUpdating(EFalse); Update(*iBmp); } @@ -90,7 +89,6 @@ class CDsaGles : public CDsa private: TUint8* LockSurface() { return NULL; } void UnlockHwSurface() {} - void Resume() {} void CreateSurfaceL(const TSize& aSize) {} }; @@ -103,7 +101,6 @@ class CDsaBase : public CDsa, public MDirectScreenAccess ~CDsaBase(); void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice); void Stop(); - void Resume(); void CompleteUpdate(); void DoBlt(CFbsBitmap& aBmp); @@ -129,12 +126,6 @@ void CDsaBase::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice) RestartL(); } -void CDsaBase::Resume() -{ - if(Stopped()) - Restart(RDirectScreenAccess::ETerminateRegion); -} - void CDsaBase::CompleteUpdate() { iDsa->ScreenDevice()->Update(); @@ -248,25 +239,6 @@ void CDsa::Free() { } -void CDsa::SetSuspend() -{ - iStateFlags |= ESdlThreadSuspend; -} - - -void CDsa::SetUpdating(TBool aUpdate) -{ - if(aUpdate) - iStateFlags |= EUpdating; - else - iStateFlags &= ~EUpdating; -} - -TBool CDsa::Stopped() const -{ - return (iStateFlags & ESdlThreadExplicitStop); -} - CDsa::~CDsa() { delete[] iLut256; @@ -297,7 +269,7 @@ int CDsa::SetPalette(int aFirst, int aCount, TUint32* aPalette) } CDsa::CDsa(RWsSession& aSession) : - iStateFlags(0), + iRunning(false), iSession(aSession) { @@ -313,11 +285,7 @@ RWsSession& CDsa::Session() TUint8* CDsa::LockHwSurface() { - if((iStateFlags & EUpdating) == 0) //else frame is skipped - { - return LockSurface(); - } - return NULL; + return LockSurface(); } int CDsa::AllocSurface(const TSize& aSize, TDisplayMode aMode) @@ -397,29 +365,14 @@ void CDsa::UpdateSwSurface() UnlockHwSurface(); //could be faster if does not use AO, but only check status before redraw, then no context switch needed } -void CDsa::DoStop() -{ - if(IsDsaAvailable()) - iStateFlags |= ESdlThreadExplicitStop; - Stop(); -} - void CDsa::Stop() { - iStateFlags &= ~ERunning; + iRunning = false; } void CDsa::Start() { - iStateFlags |= ERunning; - - iStateFlags &= ~ESdlThreadExplicitStop; - - if(iStateFlags & ESdlThreadSuspend) - { - Resume(); - iStateFlags &= ~ ESdlThreadSuspend; - } + iRunning = true; } RWindow* CDsa::Window() diff --git a/symbian/include/internal/dsa.h b/symbian/include/internal/dsa.h index e839ff4..adbfebb 100644 --- a/symbian/include/internal/dsa.h +++ b/symbian/include/internal/dsa.h @@ -26,23 +26,17 @@ class CDsa : public CBase TInt SetPalette(TInt aFirst, TInt aCount, TUint32* aPalette); TBool AddUpdateRect(const TUint8* aBits, const TRect& aUpdateRect, const TRect& aRect); void UpdateSwSurface(); - void SetSuspend(); - TBool Stopped() const; RWsSession& Session(); RWindow* Window(); CDsa* CreateGlesDsaL(); - void DoStop(); - virtual void Free(); virtual void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice); - virtual void SetUpdating(TBool aUpdate); virtual TUint8* LockSurface() = 0; virtual void UnlockHwSurface() = 0; - virtual void Resume() = 0; virtual void Stop(); virtual void DoBlt(CFbsBitmap& aBmp); @@ -52,15 +46,6 @@ class CDsa : public CBase CDsa(RWsSession& aSession); void Start(); - enum - { - ERunning = 0x1, - EUpdating = 0x2, - EUsePalette = 0x8, - ESdlThreadSuspend = 0x100, - ESdlThreadExplicitStop = 0x200 - }; - private: virtual void CreateSurfaceL(const TSize& aSize) = 0; @@ -71,8 +56,8 @@ class CDsa : public CBase void SetCopyFunction(); - TInt iStateFlags; - RWsSession& iSession; + bool iRunning; + RWsSession& iSession; TInt iTargetBpp; TInt iSourceBpp; @@ -94,7 +79,7 @@ inline TDisplayMode CDsa::DisplayMode() const inline TBool CDsa::IsDsaAvailable() const { - return iStateFlags & ERunning; + return iRunning; } #endif diff --git a/symbian/include/internal/epoc_sdl.h b/symbian/include/internal/epoc_sdl.h index 19371e5..2ffda81 100644 --- a/symbian/include/internal/epoc_sdl.h +++ b/symbian/include/internal/epoc_sdl.h @@ -49,7 +49,6 @@ class EpocSdlEnv static void UpdateSwSurface(); static TBool AddUpdateRect(TUint8* aAddress, const TRect& aUpdateRect, const TRect& aTargetRect); static TInt SetPalette(TInt aFirstcolor, TInt aColorCount, TUint32* aPalette); - static void WaitDsaAvailable(); static TInt AppendCleanupItem(const TSdlCleanupItem& aItem); static void RemoveCleanupItem(void* aItem); static void CleanupItems(); -- 2.11.4.GIT