uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp
branchRCL_3
changeset 34 3a60ebea00d0
parent 24 f93c875b566e
child 63 e1987ab3768a
--- a/uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp	Tue May 25 13:39:57 2010 +0300
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp	Wed Jun 09 10:41:25 2010 +0300
@@ -1906,8 +1906,8 @@
     if (aUpdateDisplay && renderbuffer && iCanvasGc->Gc())
         {
         THuiRealRect updatedRect = aUpdateRegion.BoundingRect();
-				  TInt w; 
-				  TInt h ;
+        TInt w = 0; 
+		TInt h = 0;
         // Handle relative rotation
         if (iVisual->Display())
             {
@@ -2136,6 +2136,15 @@
         }
     }
 
+static TRect CalculateClipRect(CHuiCanvasRenderBuffer* aRenderbuffer)
+    {
+    const TInt KHuiDefaultSize = 2048;
+    return 
+        aRenderbuffer && aRenderbuffer->IsInitialized() ? 
+        TRect( aRenderbuffer->Size() ) :
+        TRect( TSize( KHuiDefaultSize, KHuiDefaultSize ) );
+    }
+
 void CHuiCanvasWsHwGc::BindRenderBuffer(CHuiCanvasRenderBuffer* aRenderbuffer, const TRegion& aUpdateRegion)
     {
     // Disable effective opacity when rendering to a buffer
@@ -2158,15 +2167,15 @@
     
     // Set new clipping region which does not clip anything. 
     // We want always draw aUpdateRegion fully to the aRenderbuffer. 
-    TRect displayArea = iCanvasGc->Gc()->DisplayArea(); 
-    
-    iCanvasGc->Gc()->SetClip(displayArea); // this call does not transform region anymore
+            
+    iCanvasGc->Gc()->SetClip(CalculateClipRect(aRenderbuffer)); // this call does not transform region anymore
     
     // We use translation to get screen coordinates to match render buffer coordinates
     iCanvasGc->PushTransformationMatrix();
     iCanvasGc->Translate(x, y, 0.f);
         
     // Handle relative rotation
+    TRect displayArea = iCanvasGc->Gc()->DisplayArea();
     TInt w = displayArea.Width();
     TInt h = displayArea.Height();