uiacceltk/hitchcock/coretoolkit/src/HuiRosterImpl.cpp
branchRCL_3
changeset 20 31fccae4f8a7
parent 19 e5af45d51884
equal deleted inserted replaced
19:e5af45d51884 20:31fccae4f8a7
   498         // drawing so the whole operation gets correct opacity. However there is possibility
   498         // drawing so the whole operation gets correct opacity. However there is possibility
   499         // that complex effect fxml would assume transparency to be handled *before*
   499         // that complex effect fxml would assume transparency to be handled *before*
   500         // some other part of the effect, so this workaround won't work correctly in those cases. 
   500         // some other part of the effect, so this workaround won't work correctly in those cases. 
   501         // To get those working, propably whole opacity effect handling should be re-written 
   501         // To get those working, propably whole opacity effect handling should be re-written 
   502         // differently.
   502         // differently.
   503         if (iEffect->IsSemitransparent() || iEffectOpacity < 1.f)
   503         CHuiRosterImpl* nonconst = const_cast<CHuiRosterImpl*>(this);
   504             {
   504         nonconst->Effectable()->EffectSetOpacityAdditive(0.0f, ETrue);
   505             iEffect->ForceCachedRenderTargetUsage(ETrue);
   505         // PrepareDraw will update iEffectOpacity to correct opacity for this effect frame
   506             }        
   506         if(iEffect->PrepareDrawL(aGc, displayRect))
   507         RRegion dummy;
   507             {
   508         didDrawEffect = iEffect->CachedDraw(aGc, displayRect, refreshCache, opaque, dummy, EFalse, iEffectOpacity*255);        
   508             if (iEffectOpacity < 1.f)
   509         dummy.Close();
   509                 {
       
   510                 iEffect->ForceCachedRenderTargetUsage(ETrue);
       
   511                 }        
       
   512 
       
   513             RRegion dummy;
       
   514             didDrawEffect = iEffect->CachedDraw(aGc, displayRect, refreshCache, opaque, dummy, EFalse, iEffectOpacity*255);        
       
   515             dummy.Close();
       
   516             }
   510         }
   517         }
   511     
   518     
   512     if (!didDrawEffect)
   519     if (!didDrawEffect)
   513         {
   520         {
   514         DrawSelf(aGc, aDisplay);
   521         DrawSelf(aGc, aDisplay);
  1829         }
  1836         }
  1830     iEffect = aEffect;
  1837     iEffect = aEffect;
  1831     SetChanged();
  1838     SetChanged();
  1832     }
  1839     }
  1833 
  1840 
  1834 TReal32 CHuiRosterImpl::EffectOpacityTarget() const
  1841 TReal32 CHuiRosterImpl::EffectOpacity() const
  1835     {
  1842     {
  1836     return iEffectOpacity; 
  1843     return iEffectOpacity; 
  1837     }
  1844     }
  1838 
  1845 
  1839 void CHuiRosterImpl::EffectSetOpacity(TReal32 aOpacity)
  1846 void CHuiRosterImpl::EffectSetOpacityAdditive(TReal32 aOpacity, TBool /*aReplace*/)
  1840     {
  1847     {
  1841     iEffectOpacity = aOpacity;
  1848     iEffectOpacity = aOpacity;
  1842     }
  1849     }
  1843 
  1850 
  1844 void CHuiRosterImpl::EffectDrawSelf( CHuiGc &aGc, const TRect & aDisplayRect) const
  1851 void CHuiRosterImpl::EffectDrawSelf( CHuiGc &aGc, const TRect & aDisplayRect) const
  1873     }
  1880     }
  1874 
  1881 
  1875 TBool CHuiRosterImpl::EffectGetSource() const
  1882 TBool CHuiRosterImpl::EffectGetSource() const
  1876     {
  1883     {
  1877     return iIsInput1;
  1884     return iIsInput1;
       
  1885     }
       
  1886 
       
  1887 TBool CHuiRosterImpl::EffectReadyToDrawNextFrame() const
       
  1888     {
       
  1889     return ETrue;
  1878     }
  1890     }
  1879 
  1891 
  1880 void CHuiRosterImpl::SetMemoryLevel(THuiMemoryLevel /*aLevel*/)
  1892 void CHuiRosterImpl::SetMemoryLevel(THuiMemoryLevel /*aLevel*/)
  1881     {
  1893     {
  1882     if ( IsVisibleContentFrozen() && !UseRenderBufferForFreeze() )
  1894     if ( IsVisibleContentFrozen() && !UseRenderBufferForFreeze() )