windowing/windowserver/nga/SERVER/openwfc/wnredraw.cpp
changeset 36 01a6848ebfd7
parent 0 5d03bc08d59c
equal deleted inserted replaced
0:5d03bc08d59c 36:01a6848ebfd7
     1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1995-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".
   250 			}
   250 			}
   251 		}
   251 		}
   252 
   252 
   253 	for (CWsSpriteBase * sprite = iWsWin->iSpriteList; sprite; sprite = sprite->Next())
   253 	for (CWsSpriteBase * sprite = iWsWin->iSpriteList; sprite; sprite = sprite->Next())
   254 		{
   254 		{
       
   255         TBool hasRedrawBegun = EFalse;
   255 		STACK_REGION redrawRegion;
   256 		STACK_REGION redrawRegion;
   256 		sprite->CalcRedrawRegion(aRegion, redrawRegion);
   257 		sprite->CalcRedrawRegion(aRegion, redrawRegion);
   257 		if(redrawRegion.CheckError() || !redrawRegion.IsEmpty())
   258 		if(redrawRegion.CheckError() || !redrawRegion.IsEmpty())
   258 			{
   259 			{
   259 			if (sprite->IsFlashingEnabled() || sprite->IsDirty() || sprite->HasAnimation())
   260 			if (sprite->IsFlashingEnabled() || sprite->IsDirty() || sprite->HasAnimation())
   260 				{
   261 				{
   261 				AnnotateSpriteRedrawStart(*iWsWin, *sprite, redrawRegion);
   262                 if (sprite->IsDirty() || sprite->HasAnimation())
       
   263                     {
       
   264                     AnnotateSpriteRedrawStart(*iWsWin, *sprite, redrawRegion);
       
   265                     hasRedrawBegun = ETrue;
       
   266                     }
   262 				
   267 				
   263 				if(sprite->HasAnimation())
   268 				if(sprite->HasAnimation())
   264 					{
   269 					{
   265 					CWsAnim* anim = static_cast<CWsSprite*>(sprite)->iAnim;
   270 					CWsAnim* anim = static_cast<CWsSprite*>(sprite)->iAnim;
   266 					WS_ASSERT_DEBUG(anim,EWsPanicAnim);
   271 					WS_ASSERT_DEBUG(anim,EWsPanicAnim);
   274 						return;
   279 						return;
   275 						}
   280 						}
   276 					}
   281 					}
   277 				
   282 				
   278 				//...call Redraw on the sprite
   283 				//...call Redraw on the sprite
   279 				aGc->Reset();
   284 				if (hasRedrawBegun)
       
   285 				    {
       
   286                     aGc->Reset();
       
   287 				    }
   280 				sprite->Redraw(aGc, redrawRegion);
   288 				sprite->Redraw(aGc, redrawRegion);
   281 				
   289 				
   282 				AnnotateSpriteRedrawEnd(*iWsWin, *sprite);
   290 				if (hasRedrawBegun)
       
   291 				    {
       
   292                     AnnotateSpriteRedrawEnd(*iWsWin, *sprite);
       
   293 				    }
   283 				}
   294 				}
   284 			}
   295 			}
   285 		redrawRegion.Close();
   296 		redrawRegion.Close();
   286 		}
   297 		}
   287 	}
   298 	}