diff -r 01a6848ebfd7 -r 36b2e23a8629 graphicsdeviceinterface/screendriver/sbit/Cdsb.cpp --- a/graphicsdeviceinterface/screendriver/sbit/Cdsb.cpp Fri Apr 16 16:21:04 2010 +0300 +++ b/graphicsdeviceinterface/screendriver/sbit/Cdsb.cpp Mon May 03 13:44:32 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -17,7 +17,6 @@ #include #include - #ifdef SYMBIAN_GRAPHICS_GCE #undef __WINS__ #include "../sgeneric/scdraw.h" @@ -73,8 +72,6 @@ #ifdef SYMBIAN_GRAPHICS_GCE CScreenDeviceHelper iSurfaceUpdater; TUidPixelFormat iPixelFormat; - TBool iDsaBufferIsBusy; - TRequestStatus iDsaBufferAvailable; #endif TAcceleratedBitmapInfo iBitmapInfo; TUint32 iSettingsFlags; @@ -110,9 +107,6 @@ #ifndef __WINS__ iVideoAddress(NULL), #endif -#ifdef SYMBIAN_GRAPHICS_GCE - iDsaBufferIsBusy(EFalse), -#endif iBitmapInfo(), iSettingsFlags(ENone), iUpdateRect(), @@ -165,9 +159,13 @@ } __ASSERT_ALWAYS(aScreenRect.iTl.iX >= 0 && - aScreenRect.iTl.iY >= 0 && - aScreenRect.Width() <= screenWidth && - aScreenRect.Height() <= screenHeight, Panic(EPanicOutOfBounds)); + aScreenRect.iTl.iY >= 0 && + ((aScreenRect.Width() <= screenWidth && + aScreenRect.Height() <= screenHeight) + || + (aScreenRect.Width() <= screenHeight && + aScreenRect.Height() <= screenWidth)), + Panic(EPanicOutOfBounds)); __ASSERT_ALWAYS(aScreenRect.Width() > 0 && aScreenRect.Height() > 0, Panic(EPanicInvalidRect)); @@ -529,14 +527,7 @@ #else TUint8* pD = (TUint8*)iVideoAddress; const TUint dD = iDisplayOffsetLines; -#ifdef SYMBIAN_GRAPHICS_GCE - if (iDsaBufferIsBusy) - { - User::WaitForRequest(iDsaBufferAvailable); - __ASSERT_DEBUG(iDsaBufferAvailable != KRequestPending, Panic(EPanicIncompleteRequest)); - iDsaBufferIsBusy=EFalse; - } -#endif + for(TInt y=iUpdateRect.Height(); y>0; y--) { Mem::Move((void *)pD, (void *)pS, dS); @@ -546,17 +537,18 @@ #endif #ifdef SYMBIAN_GRAPHICS_GCE - iDsaBufferIsBusy=ETrue; + // update the region and complete notification on the client's TRequestStatus + // This means the backbuffer is held up until the surface update has completed + // notification. iSurfaceUpdater.UpdateRegion(iUpdateRect); - iDsaBufferAvailable = KRequestPending; - iSurfaceUpdater.NotifyWhenAvailable(iDsaBufferAvailable); - iSurfaceUpdater.Update(); + iSurfaceUpdater.Update(aComplete); +#else + // In the generic implementation, complete the request immediately to allow the client + // to render to the back buffer + TRequestStatus* pComplete=&aComplete; + User::RequestComplete(pComplete,KErrNone); #endif - // In the generic implementation, complete the request immediately to allow the client - // to render to the back buffer - TRequestStatus* pComplete=&aComplete; - User::RequestComplete(pComplete,KErrNone); } // @@ -606,15 +598,6 @@ TUint8* pS = iBitmapInfo.iAddress + offX + (offY*dS); TUint8* pD = (TUint8*)iVideoAddress + offX + (offY*dD); -#ifdef SYMBIAN_GRAPHICS_GCE - if (iDsaBufferIsBusy) - { - User::WaitForRequest(iDsaBufferAvailable); - __ASSERT_DEBUG(iDsaBufferAvailable != KRequestPending, Panic(EPanicIncompleteRequest)); - iDsaBufferIsBusy=EFalse; - } -#endif - for(TInt y=aScreenRect.Height(); y>0; y--) { Mem::Move((void *)pD, (void *)pS, bytesToCopy); @@ -624,16 +607,18 @@ #endif #ifdef SYMBIAN_GRAPHICS_GCE - iDsaBufferIsBusy=ETrue; + // update the region and complete notification on the client's TRequestStatus + // This means the backbuffer is held up until the surface update has completed + // notification. iSurfaceUpdater.UpdateRegion(iUpdateRect); - iDsaBufferAvailable = KRequestPending; - iSurfaceUpdater.NotifyWhenAvailable(iDsaBufferAvailable); - iSurfaceUpdater.Update(); + iSurfaceUpdater.Update(aComplete); +#else + // In the generic implementation, complete the request immediately to allow the client + // to render to the back buffer + TRequestStatus* pComplete=&aComplete; + User::RequestComplete(pComplete,KErrNone); #endif - // In the generic implementation, complete the request immediately. - TRequestStatus* pComplete=&aComplete; - User::RequestComplete(pComplete,KErrNone); } #ifdef __WINS__ @@ -728,6 +713,7 @@ } #endif + // // Close - Deallocate resources and cancel outstanding updates // @@ -735,6 +721,9 @@ { if(iCreated) { +#ifdef SYMBIAN_GRAPHICS_GCE + iSurfaceUpdater.CancelUpdateNotification(); +#endif User::Free(iBitmapInfo.iAddress); iBitmapInfo.iAddress = NULL; iCreated = EFalse;