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". |
338 void CScreenDeviceHelper::NotifyWhenAvailable(TRequestStatus& aStatus) |
338 void CScreenDeviceHelper::NotifyWhenAvailable(TRequestStatus& aStatus) |
339 { |
339 { |
340 iSurfaceUpdateSession.NotifyWhenAvailable(aStatus); |
340 iSurfaceUpdateSession.NotifyWhenAvailable(aStatus); |
341 } |
341 } |
342 |
342 |
|
343 void CScreenDeviceHelper::CancelUpdateNotification() |
|
344 { |
|
345 iSurfaceUpdateSession.CancelAllUpdateNotifications(); |
|
346 } |
|
347 |
343 /** |
348 /** |
344 Implementation of corresponding function in CDrawDevice, utilizing a tracked |
349 Implementation of corresponding function in CDrawDevice, utilizing a tracked |
345 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 |
346 not empty. |
351 not empty. |
347 */ |
352 */ |
348 void CScreenDeviceHelper::Update() |
353 void CScreenDeviceHelper::Update() |
349 { |
354 { |
350 if (iUpdateRegion.IsEmpty()) |
355 TRequestStatus updateComplete = KRequestPending; |
351 return; |
356 Update(updateComplete); |
352 |
357 User::WaitForRequest(updateComplete); |
353 iSurfaceUpdateSession.SubmitUpdate(KAllScreens, iSurface, 0, &iUpdateRegion); |
358 } |
354 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 } |
355 } |
373 } |
356 |
374 |
357 /** |
375 /** |
358 Implementation of corresponding function in CDrawDevice, utilizing a tracked |
376 Implementation of corresponding function in CDrawDevice, utilizing a tracked |
359 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 |