graphicsdeviceinterface/screendriver/sgeneric/scnew.cpp
changeset 45 36b2e23a8629
parent 36 01a6848ebfd7
child 116 171fae344dd4
equal deleted inserted replaced
36:01a6848ebfd7 45:36b2e23a8629
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    25 #include <hal.h>
    25 #include <hal.h>
    26 #include "ScreenInfo.h"
    26 #include "ScreenInfo.h"
    27 #include "scdraw.h"
    27 #include "scdraw.h"
    28 #include "scdraw.inl"
    28 #include "scdraw.inl"
    29 #include <graphics/gdi/gdiconsts.h>
    29 #include <graphics/gdi/gdiconsts.h>
    30 
    30 #include <graphics/suerror.h>
    31 
       
    32 /**
    31 /**
    33 Creates an instance of CFbsDrawDevice class.
    32 Creates an instance of CFbsDrawDevice class.
    34 @param aScreenNo Screen number
    33 @param aScreenNo Screen number
    35 @param aDispMode Display mode
    34 @param aDispMode Display mode
    36 @param aScreenInfo Screen parameters: video memory address and screen size
    35 @param aScreenInfo Screen parameters: video memory address and screen size
   339 void CScreenDeviceHelper::NotifyWhenAvailable(TRequestStatus& aStatus)
   338 void CScreenDeviceHelper::NotifyWhenAvailable(TRequestStatus& aStatus)
   340 	{
   339 	{
   341 	iSurfaceUpdateSession.NotifyWhenAvailable(aStatus);
   340 	iSurfaceUpdateSession.NotifyWhenAvailable(aStatus);
   342 	}
   341 	}
   343 
   342 
       
   343 void CScreenDeviceHelper::CancelUpdateNotification()
       
   344 	{
       
   345 	iSurfaceUpdateSession.CancelAllUpdateNotifications();
       
   346 	}
       
   347 
   344 /**
   348 /**
   345 Implementation of corresponding function in CDrawDevice, utilizing a tracked
   349 Implementation of corresponding function in CDrawDevice, utilizing a tracked
   346 update region. Updates the screen from the surface, if the update region is
   350 update region. Updates the screen from the surface, if the update region is
   347 not empty.
   351 not empty.
   348 */
   352 */
   349 void CScreenDeviceHelper::Update()
   353 void CScreenDeviceHelper::Update()
   350 	{
   354 	{
   351 	if (iUpdateRegion.IsEmpty())
   355 	TRequestStatus updateComplete = KRequestPending;
   352 		return;
   356 	Update(updateComplete);
   353 
   357 	User::WaitForRequest(updateComplete);
   354 	iSurfaceUpdateSession.SubmitUpdate(KAllScreens, iSurface, 0, &iUpdateRegion);
   358 	}
   355 	iUpdateRegion.Clear();
   359 
       
   360 void CScreenDeviceHelper::Update(TRequestStatus& aStatus)
       
   361 	{
       
   362 	if (!iUpdateRegion.IsEmpty())
       
   363 		{
       
   364 		iSurfaceUpdateSession.NotifyWhenAvailable(aStatus);
       
   365 		iSurfaceUpdateSession.SubmitUpdate(KAllScreens, iSurface, 0, &iUpdateRegion);
       
   366 		iUpdateRegion.Clear();
       
   367 		}
       
   368 	else
       
   369 		{
       
   370 		TRequestStatus* pComplete=&aStatus;
       
   371 		User::RequestComplete(pComplete,KErrNone);	    
       
   372 		}
   356 	}
   373 	}
   357 
   374 
   358 /**
   375 /**
   359 Implementation of corresponding function in CDrawDevice, utilizing a tracked
   376 Implementation of corresponding function in CDrawDevice, utilizing a tracked
   360 update region. Adds the given region to the update region and updates the
   377 update region. Adds the given region to the update region and updates the