uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp
branchRCL_3
changeset 12 f93c875b566e
parent 7 88b23e2e82e1
child 13 3a60ebea00d0
equal deleted inserted replaced
10:7c5dd702d6d3 12:f93c875b566e
   340     }
   340     }
   341     
   341     
   342     
   342     
   343 TBool CHuiCanvasVisual::CanSkipDrawing() const
   343 TBool CHuiCanvasVisual::CanSkipDrawing() const
   344     {
   344     {
       
   345     if(Display()->RosterImpl().AlfEventWindow() == this)
       
   346          {
       
   347          return EFalse;
       
   348          }
       
   349     
   345     if (Effect())
   350     if (Effect())
   346         {
   351         {
   347         TBool semiTranparentEffectActive = Effect()->IsSemitransparent();
   352         TBool semiTranparentEffectActive = Effect()->IsSemitransparent();
   348         if ((iOpacity.Now() <= EPSILON && !semiTranparentEffectActive))
   353         if ((iOpacity.Now() <= EPSILON && !semiTranparentEffectActive))
   349             {
   354             {
   463             refreshCache |= Changed();            
   468             refreshCache |= Changed();            
   464 
   469 
   465             iCanvasVisualData->iPaintedRegion.Clear();
   470             iCanvasVisualData->iPaintedRegion.Clear();
   466             CollectPaintedRegion(iCanvasVisualData->iPaintedRegion, 0);
   471             CollectPaintedRegion(iCanvasVisualData->iPaintedRegion, 0);
   467             }
   472             }
   468         
   473 
       
   474         if(Display()->RosterImpl().AlfEventWindow() == this)
       
   475             {
       
   476             refreshCache |= Display()->RosterImpl().NativeAppsContentChanged();
       
   477             }
   469         didDrawEffect = Effect()->CachedDraw(aGc, area, refreshCache, !transparent, iCanvasVisualData->iPaintedRegion);
   478         didDrawEffect = Effect()->CachedDraw(aGc, area, refreshCache, !transparent, iCanvasVisualData->iPaintedRegion);
   470         
   479         
   471         }
   480         }
   472     
   481     
   473     if ( !didDrawEffect )
   482     if ( !didDrawEffect )
   534     if ( Tracking() )
   543     if ( Tracking() )
   535         {
   544         {
   536         RDebug::Print(_L("CHuiCanvasVisual::DrawSelf - tracked visual"));
   545         RDebug::Print(_L("CHuiCanvasVisual::DrawSelf - tracked visual"));
   537         }
   546         }
   538 #endif		
   547 #endif		
   539       
   548     TBool alfEventWindow = (Display()->RosterImpl().AlfEventWindow() == this);
   540     TReal32 effectiveOpacity = EffectiveOpacity();
   549     TReal32 effectiveOpacity = EffectiveOpacity();
   541         
   550         
   542     if (effectiveOpacity <= 0 || !HasCommandBuffers(ETrue))
   551     if ((effectiveOpacity <= 0 || !HasCommandBuffers(ETrue)) && !alfEventWindow)
   543         {
   552         {
   544         // In case background drawing is enabled, and even if we don't have command buffers we still
   553         // In case background drawing is enabled, and even if we don't have command buffers we still
   545         // want to issue clear. If the background drawing is enabled here, it means that the
   554         // want to issue clear. If the background drawing is enabled here, it means that the
   546         // window bound to this visual has a background surface. If we dont do the clear, the
   555         // window bound to this visual has a background surface. If we dont do the clear, the
   547         // surface will be covered by the Alf surface, ie. the underlying surface is not visible
   556         // surface will be covered by the Alf surface, ie. the underlying surface is not visible
   570             DrawStoredVisualRenderBuffer(drawMode);
   579             DrawStoredVisualRenderBuffer(drawMode);
   571             return;
   580             return;
   572             }
   581             }
   573         }    
   582         }    
   574 
   583 
       
   584     if(alfEventWindow)
       
   585          {
       
   586          Display()->RosterImpl().DrawNativeAppsContent(aGc, Display());
       
   587          return;
       
   588          }
       
   589     
   575     // Use 'under opaque' hint to optimize drawing.
   590     // Use 'under opaque' hint to optimize drawing.
   576     // See comment from CHuiCanvasVisual::Draw for further details. 
   591     // See comment from CHuiCanvasVisual::Draw for further details. 
   577     const TBool drawVisualContent = !( Flags() & EHuiVisualFlagUnderOpaqueHint );
   592     const TBool drawVisualContent = !( Flags() & EHuiVisualFlagUnderOpaqueHint );
   578 
   593 
   579     // Canvas clipping is done in DrawSelf instead of Draw so that canvas clipping does not clip effects 
   594     // Canvas clipping is done in DrawSelf instead of Draw so that canvas clipping does not clip effects 
   995                     // By default assume opaque
  1010                     // By default assume opaque
   996                     background.iPaintType = EHuiCanvasPaintTypeOpaque;                                                 
  1011                     background.iPaintType = EHuiCanvasPaintTypeOpaque;                                                 
   997                     }                    
  1012                     }                    
   998 
  1013 
   999                 background.iPaintedRect = backgroundItems[aIndex].Rect();
  1014                 background.iPaintedRect = backgroundItems[aIndex].Rect();
       
  1015                 backgroundItems.Close();
  1000                 return background;
  1016                 return background;
  1001                 }
  1017                 }
  1002             else
  1018             else
  1003                 {
  1019                 {
  1004                 return iCanvasVisualData->iCanvasPainter->PaintedArea(aIndex - backgroundItemCount);
  1020                 return iCanvasVisualData->iCanvasPainter->PaintedArea(aIndex - backgroundItemCount);