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 |