uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp
changeset 25 f7f1ae431f74
parent 14 83d2d132aa58
child 31 1b6909418757
--- a/uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp	Fri May 14 16:46:13 2010 +0300
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp	Thu May 27 13:47:19 2010 +0300
@@ -987,9 +987,11 @@
             destinationRect.Move(-dx,-dy);
             
             TRgb oldPenColor = iCanvasGc->PenColor();
+            TReal32 oldOpacity = iCanvasGc->Opacity();
             if (cachedImage->iUseColorModulation)
                 {
                 iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));
                 }
             
             // Draw            
@@ -998,6 +1000,7 @@
             if (cachedImage->iUseColorModulation)
                 {
                 iCanvasGc->SetPenColor(oldPenColor);                        
+                iCanvasGc->SetOpacity(oldOpacity);
                 }
             }        
         }
@@ -1027,9 +1030,11 @@
             destinationRect.Move(-dx,-dy);
             
             TRgb oldPenColor = iCanvasGc->PenColor();
+            TReal32 oldOpacity = iCanvasGc->Opacity();
             if (cachedImage->iUseColorModulation)
                 {
-                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));    
                 }
             
             // Draw            
@@ -1038,6 +1043,7 @@
             if (cachedImage->iUseColorModulation)
                 {
                 iCanvasGc->SetPenColor(oldPenColor);                        
+                iCanvasGc->SetOpacity(oldOpacity);
                 }
             }
         }
@@ -1068,10 +1074,12 @@
             destinationRect.Move(-dx,-dy);
             
             TRgb oldPenColor = iCanvasGc->PenColor();
+            TReal32 oldOpacity = iCanvasGc->Opacity();
             if (cachedImage->iUseColorModulation)
                 {
                 DrawTextBrush( destinationRect );
-                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));    
                 }
     
             // Draw            
@@ -1079,7 +1087,8 @@
     
             if (cachedImage->iUseColorModulation)
                 {
-                iCanvasGc->SetPenColor(oldPenColor);                        
+                iCanvasGc->SetPenColor(oldPenColor);
+                iCanvasGc->SetOpacity(oldOpacity);                        
                 }
             }
         }
@@ -1114,10 +1123,12 @@
             destinationRect.Move(-dx,-dy);
             
             TRgb oldPenColor = iCanvasGc->PenColor();
+            TReal32 oldOpacity = iCanvasGc->Opacity();
             if (cachedImage->iUseColorModulation)
                 {
                 DrawTextBrush( destinationRect );
-                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));    
                 }
     
             // Draw            
@@ -1125,7 +1136,8 @@
     
             if (cachedImage->iUseColorModulation)
                 {
-                iCanvasGc->SetPenColor(oldPenColor);                        
+                iCanvasGc->SetPenColor(oldPenColor);
+                iCanvasGc->SetOpacity(oldOpacity);                        
                 }
             }    
         }
@@ -1160,10 +1172,12 @@
             destinationRect.Move(-dx,-dy);
             
             TRgb oldPenColor = iCanvasGc->PenColor();
+            TReal32 oldOpacity = iCanvasGc->Opacity();
             if (cachedImage->iUseColorModulation)
                 {
                 DrawTextBrush( destinationRect );
-                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));    
                 }
     
             // Draw            
@@ -1171,7 +1185,8 @@
     
             if (cachedImage->iUseColorModulation)
                 {
-                iCanvasGc->SetPenColor(oldPenColor);                        
+                iCanvasGc->SetPenColor(oldPenColor);
+                iCanvasGc->SetOpacity(oldOpacity);                        
                 }
             }    
         }
@@ -1205,9 +1220,11 @@
             destinationRect.Move(-dx,-dy);
             
             TRgb oldPenColor = iCanvasGc->PenColor();
+            TReal32 oldOpacity = iCanvasGc->Opacity();
             if (cachedImage->iUseColorModulation)
                 {
                 iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));
                 }
     
             // Draw            
@@ -1215,7 +1232,8 @@
     
             if (cachedImage->iUseColorModulation)
                 {
-                iCanvasGc->SetPenColor(oldPenColor);                        
+                iCanvasGc->SetPenColor(oldPenColor);
+                iCanvasGc->SetOpacity(oldOpacity);                        
                 }
             }    
         }
@@ -1248,9 +1266,11 @@
             destinationRect.Move(-dx,-dy);
             
             TRgb oldPenColor = iCanvasGc->PenColor();
+            TReal32 oldOpacity = iCanvasGc->Opacity();
             if (cachedImage->iUseColorModulation)
                 {
-                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));    
                 }
     
             // Draw            
@@ -1258,7 +1278,8 @@
     
             if (cachedImage->iUseColorModulation)
                 {
-                iCanvasGc->SetPenColor(oldPenColor);                        
+                iCanvasGc->SetPenColor(oldPenColor); 
+                iCanvasGc->SetOpacity(oldOpacity);                       
                 }
             }
         }
@@ -1292,10 +1313,12 @@
             destinationRect.Move(-dx,-dy);
             
             TRgb oldPenColor = iCanvasGc->PenColor();
+            TReal32 oldOpacity = iCanvasGc->Opacity();
             if (cachedImage->iUseColorModulation)
                 {
                 DrawTextBrush( destinationRect );
-                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));  
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));  
                 }
     
             // Draw            
@@ -1303,7 +1326,8 @@
     
             if (cachedImage->iUseColorModulation)
                 {
-                iCanvasGc->SetPenColor(oldPenColor);                        
+                iCanvasGc->SetPenColor(oldPenColor); 
+                iCanvasGc->SetOpacity(oldOpacity);                       
                 }
             }
         }
@@ -1341,10 +1365,12 @@
             destinationRect.Move(-dx,-dy);
             
             TRgb oldPenColor = iCanvasGc->PenColor();
+            TReal32 oldOpacity = iCanvasGc->Opacity();
             if (cachedImage->iUseColorModulation)
                 {
                 DrawTextBrush( destinationRect );
-                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor)); 
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));   
                 }
     
             // Draw            
@@ -1352,7 +1378,8 @@
     
             if (cachedImage->iUseColorModulation)
                 {
-                iCanvasGc->SetPenColor(oldPenColor);                        
+                iCanvasGc->SetPenColor(oldPenColor);
+                iCanvasGc->SetOpacity(oldOpacity);                        
                 }
             }
         }
@@ -1390,10 +1417,12 @@
             destinationRect.Move(-dx,-dy);
             
             TRgb oldPenColor = iCanvasGc->PenColor();
+            TReal32 oldOpacity = iCanvasGc->Opacity();
             if (cachedImage->iUseColorModulation)
                 {
                 DrawTextBrush( destinationRect );
-                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));  
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));  
                 }
     
             // Draw            
@@ -1401,7 +1430,8 @@
     
             if (cachedImage->iUseColorModulation)
                 {
-                iCanvasGc->SetPenColor(oldPenColor);                        
+                iCanvasGc->SetPenColor(oldPenColor);
+                iCanvasGc->SetOpacity(oldOpacity);                        
                 }
             }
         }
@@ -1876,12 +1906,15 @@
     if (aUpdateDisplay && renderbuffer && iCanvasGc->Gc())
         {
         THuiRealRect updatedRect = aUpdateRegion.BoundingRect();
-
+				  TInt w; 
+				  TInt h ;
         // Handle relative rotation
-        TRect displayArea = iVisual->Display()->VisibleArea();
-        TInt w = displayArea.Width();
-        TInt h = displayArea.Height();
-                
+        if (iVisual->Display())
+            {
+            TRect displayArea = iVisual->Display()->VisibleArea();
+            w = displayArea.Width();
+            h = displayArea.Height();
+            }
         // ...select right rotation...
         if (iRelativeOrientation == CHuiGc::EOrientationCW90)
             {