uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp
branchRCL_3
changeset 5 433cbbb6a04b
parent 3 d8a3531bc6b8
child 6 10534483575f
--- a/uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp	Mon Feb 22 17:57:49 2010 +0200
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp	Fri Mar 12 15:47:04 2010 +0200
@@ -48,6 +48,7 @@
 #include <uiacceltk/huidisplaybackgrounditem.h>
 #include "huiskinbackroundlayout.h"
 #include "HuiFxEngine.h"
+#include "huiextension.h"
 
 const TUid KHuiInternalFbsBitmapBufferGcUid = {0x2000e5a3}; 
 
@@ -932,6 +933,7 @@
 		
 		if (iForegroundTexture)
 		    {
+		    UpdateForegroundTexture(dirtyRect);
 		    DrawForegroundTexture();
 		    }
 		
@@ -1620,6 +1622,30 @@
     return iForegroundTexture;
     }
 
+void CHuiDisplay::UpdateForegroundTexture(const TRect& aRect)
+    {
+    if (iForegroundTexture && iForegroundBitmap && !aRect.IsEmpty())
+        {
+        TRAP_IGNORE(DoUpdateForegroundTextureL(aRect));
+        }
+    }
+
+void CHuiDisplay::DoUpdateForegroundTextureL(const TRect& aRect)
+    {
+    // First try to upload with faster mechanism
+    THuiTexturePartialBitmapUploadParams params;
+    params.iErrorCode = KErrNotSupported;
+    params.iRect = aRect;
+    params.iBitmap = iForegroundBitmap;
+    TAny* ptr = &params;
+    
+    MHuiTexture* texture = iForegroundTexture;
+    texture->TextureExtension(KHuiTexturePartialBitmapUploadUid, &ptr);
+    if ( params.iErrorCode != KErrNone )
+        {    
+        iForegroundTexture->UploadL(*iForegroundBitmap, NULL);
+        }
+    }
 
 void CHuiDisplay::DrawForegroundTexture()
     {