equal
deleted
inserted
replaced
58 { |
58 { |
59 } |
59 } |
60 |
60 |
61 CHuiRosterImpl::~CHuiRosterImpl() |
61 CHuiRosterImpl::~CHuiRosterImpl() |
62 { |
62 { |
|
63 if (iDisplay) |
|
64 { |
|
65 iDisplay->Env().RemoveMemoryLevelObserver(this); |
|
66 } |
|
67 |
63 FreezeVisibleContentL(EFalse); |
68 FreezeVisibleContentL(EFalse); |
64 |
69 |
65 delete iLongTapDetector; |
70 delete iLongTapDetector; |
66 iEntries.ResetAndDestroy(); |
71 iEntries.ResetAndDestroy(); |
67 iPointerDragObservers.Close(); |
72 iPointerDragObservers.Close(); |
528 |
533 |
529 CHuiDisplay* display = aDisplay ? aDisplay : iDisplay; |
534 CHuiDisplay* display = aDisplay ? aDisplay : iDisplay; |
530 |
535 |
531 ASSERT(display!=NULL); |
536 ASSERT(display!=NULL); |
532 |
537 |
533 if (iCanvasRenderBuffer && iCanvasGc) |
538 if (IsVisibleContentFrozen()) |
534 { |
539 { |
535 DrawSelfFrozen(aGc, display); |
540 DrawSelfFrozen(aGc, display); |
536 return; |
541 return; |
537 } |
542 } |
538 |
543 |
1619 } |
1624 } |
1620 |
1625 |
1621 |
1626 |
1622 void CHuiRosterImpl::FreezeVisibleContentL(TBool aEnable) |
1627 void CHuiRosterImpl::FreezeVisibleContentL(TBool aEnable) |
1623 { |
1628 { |
|
1629 iRosterIsFrozen = aEnable; |
|
1630 |
|
1631 if (aEnable && !iMonitorMemoryLevel && iDisplay) |
|
1632 { |
|
1633 iDisplay->Env().AddMemoryLevelObserver(this); |
|
1634 iMonitorMemoryLevel = ETrue; |
|
1635 } |
|
1636 |
1624 if (aEnable) |
1637 if (aEnable) |
1625 { |
1638 { |
1626 if (!iCanvasGc) |
1639 if (UseRenderBufferForFreeze()) |
1627 { |
1640 { |
1628 CHuiRenderPlugin& renderplugin = CHuiStatic::Renderer(); |
1641 if (!iCanvasGc) |
1629 iCanvasGc = renderplugin.CreateCanvasGcL(); |
1642 { |
1630 } |
1643 CHuiRenderPlugin& renderplugin = CHuiStatic::Renderer(); |
1631 if (!iCanvasRenderBuffer) |
1644 iCanvasGc = renderplugin.CreateCanvasGcL(); |
1632 { |
1645 } |
1633 iCanvasRenderBuffer = iCanvasGc->CreateRenderBufferL(TSize(0,0)); |
1646 if (!iCanvasRenderBuffer) |
1634 iCanvasRenderBuffer->InitializeL(CHuiStatic::Env().Display(0).VisibleArea().Size()); |
1647 { |
1635 iCanvasRenderBuffer->Copy(TPoint(0,0)); |
1648 iCanvasRenderBuffer = iCanvasGc->CreateRenderBufferL(TSize(0,0)); |
1636 iCanvasRenderBufferOrientation = CHuiStatic::Env().Display(0).Orientation(); |
1649 iCanvasRenderBuffer->InitializeL(CHuiStatic::Env().Display(0).VisibleArea().Size()); |
|
1650 iCanvasRenderBuffer->Copy(TPoint(0,0)); |
|
1651 iCanvasRenderBufferOrientation = CHuiStatic::Env().Display(0).Orientation(); |
|
1652 } |
1637 } |
1653 } |
1638 } |
1654 } |
1639 else |
1655 else |
1640 { |
1656 { |
1641 delete iCanvasGc; |
1657 delete iCanvasGc; |
1646 } |
1662 } |
1647 } |
1663 } |
1648 |
1664 |
1649 TBool CHuiRosterImpl::IsVisibleContentFrozen() const |
1665 TBool CHuiRosterImpl::IsVisibleContentFrozen() const |
1650 { |
1666 { |
1651 return ((iCanvasRenderBuffer != NULL) && (iCanvasGc != NULL)); |
1667 return iRosterIsFrozen; |
1652 } |
1668 } |
1653 |
1669 |
1654 void CHuiRosterImpl::EffectSetEffect(CHuiFxEffect* aEffect) |
1670 void CHuiRosterImpl::EffectSetEffect(CHuiFxEffect* aEffect) |
1655 { |
1671 { |
1656 if (iEffect) |
1672 if (iEffect) |
1705 |
1721 |
1706 TBool CHuiRosterImpl::EffectGetSource() const |
1722 TBool CHuiRosterImpl::EffectGetSource() const |
1707 { |
1723 { |
1708 return iIsInput1; |
1724 return iIsInput1; |
1709 } |
1725 } |
|
1726 |
|
1727 void CHuiRosterImpl::SetMemoryLevel(THuiMemoryLevel /*aLevel*/) |
|
1728 { |
|
1729 if ( IsVisibleContentFrozen() && !UseRenderBufferForFreeze() ) |
|
1730 { |
|
1731 // Release render buffer if we are not supposed to use. |
|
1732 delete iCanvasGc; |
|
1733 iCanvasGc = NULL; |
|
1734 delete iCanvasRenderBuffer; |
|
1735 iCanvasRenderBuffer = NULL; |
|
1736 } |
|
1737 } |
|
1738 |
|
1739 TBool CHuiRosterImpl::UseRenderBufferForFreeze() const |
|
1740 { |
|
1741 return !iDisplay || !( iDisplay->Env().MemoryLevel() <= EHuiMemoryLevelLowest ); |
|
1742 } |