--- a/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp Tue May 25 13:39:57 2010 +0300
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp Wed Jun 09 10:41:25 2010 +0300
@@ -244,13 +244,13 @@
HandleBuffer(scannedRect, EScanBuffer, NULL);
// Note: this could be improved to take care of dirty rects
- if (Effect() && Display())
+ if (Effect() && Display() && CHuiEnv::Static()->MemoryLevel() != EHuiMemoryLevelLowest )
{
// If there is effect enabled, we cannot say anything about dirty area so
// we set whole screen dirty.
scannedRect = TRect(TPoint(0,0), Display()->VisibleArea().Size());
}
- else if (IsBackgroundDrawingEnabled() || IsExternalContentDrawingEnabled())
+ else if (IsExternalContentDrawingEnabled())
{
// If the visual has external content or draws background,
// set always the whole window area as a content.
@@ -349,6 +349,8 @@
if (Effect())
{
+ TBool hasStoredContent = (IsDelayedEffectSource() || Freezed()) && (StoredRenderBuffer() || iCanvasVisualData->iStoredRenderBuffer);
+
TBool semiTranparentEffectActive = Effect()->IsSemitransparent();
if ((iOpacity.Now() <= EPSILON && !semiTranparentEffectActive))
{
@@ -361,7 +363,8 @@
!HasCommandBuffers(ETrue /*include children*/) &&
!IsBackgroundDrawingEnabled() &&
!IsExternalContentDrawingEnabled()&&
- !IsExternalContentDrawingEnabled(ETrue /*include children*/))
+ !IsExternalContentDrawingEnabled(ETrue /*include children*/) &&
+ !hasStoredContent )
{
return ETrue;
}
@@ -456,26 +459,27 @@
transparent |= iOpacity.Now() < 1.0f; // Opacity less than 1.0f -> always transparent
TBool refreshCache = EFalse;
+ TBool layer = EFalse;
if (EffectIsAppliedToChildren())
{
refreshCache |= ChildTreeChanged(EHuiCanvasFlagExcludeFromParentEffect);
iCanvasVisualData->iPaintedRegion.Clear();
- CollectRecursivePaintedRegion(iCanvasVisualData->iPaintedRegion, EHuiCanvasFlagExcludeFromParentEffect);
+ layer = CollectRecursivePaintedRegion(iCanvasVisualData->iPaintedRegion, EHuiCanvasFlagExcludeFromParentEffect);
}
else
{
refreshCache |= Changed();
iCanvasVisualData->iPaintedRegion.Clear();
- CollectPaintedRegion(iCanvasVisualData->iPaintedRegion, 0);
+ layer = CollectPaintedRegion(iCanvasVisualData->iPaintedRegion, 0);
}
if(Display()->RosterImpl().AlfEventWindow() == this)
{
refreshCache |= Display()->RosterImpl().NativeAppsContentChanged();
}
- didDrawEffect = Effect()->CachedDraw(aGc, area, refreshCache, !transparent, iCanvasVisualData->iPaintedRegion);
+ didDrawEffect = Effect()->CachedDraw(aGc, area, refreshCache, !transparent, iCanvasVisualData->iPaintedRegion,layer );
}
@@ -547,8 +551,8 @@
#endif
TBool alfEventWindow = (Display()->RosterImpl().AlfEventWindow() == this);
TReal32 effectiveOpacity = EffectiveOpacity();
-
- if ((effectiveOpacity <= 0 || !HasCommandBuffers(ETrue)) && !alfEventWindow)
+ TBool hasStoredContent = (IsContentDrawingEnabled() && (IsDelayedEffectSource() || Freezed())) && (StoredRenderBuffer() || iCanvasVisualData->iStoredRenderBuffer);
+ if ((effectiveOpacity <= 0 || !HasCommandBuffers(ETrue)) && !alfEventWindow && !hasStoredContent)
{
// In case background drawing is enabled, and even if we don't have command buffers we still
// want to issue clear. If the background drawing is enabled here, it means that the
@@ -564,7 +568,7 @@
}
}
- if (IsContentDrawingEnabled() && (IsDelayedEffectSource() || Freezed()))
+ if (hasStoredContent)
{
// Select right draw mode
THuiCanvasDrawMode drawMode = (Flags() & EHuiVisualFlagOpaqueHint) ? EHuiCanvasDrawModeNormal : EHuiCanvasDrawModeBlend;
@@ -889,7 +893,12 @@
PrepareCache();
}
- SetChanged();
+ // don't call setchanged directly here, as it changes all
+ // the command buffers dirty. We don't want to do that
+ // as the drawing area might be significantly smaller in
+ // some cases
+ CHuiLayout::SetChanged();
+ Env().ContinueRefresh(ETrue);
Env().CanvasTextureCache().EnableTouchCountCheck(EFalse);
}
@@ -1525,7 +1534,7 @@
}
}
-void CHuiCanvasVisual::CollectPaintedRegion(TRegion& aPaintRegion, TInt aExcludeCanvasFlags) const
+TBool CHuiCanvasVisual::CollectPaintedRegion(TRegion& aPaintRegion, TInt aExcludeCanvasFlags) const
{
// Only our own painted areas.
TInt paintedAreaCount = PaintedAreaCount();
@@ -1534,12 +1543,13 @@
aPaintRegion.AddRect( CanvasPaintedArea(i).iPaintedRect.Round() );
}
aPaintRegion.Tidy();
+ return !iCanvasVisualData->iLayerExtent.IsEmpty();
}
-void CHuiCanvasVisual::CollectRecursivePaintedRegion(TRegion& aRecursivePaintRegion, TInt aExcludeCanvasFlags) const
+TBool CHuiCanvasVisual::CollectRecursivePaintedRegion(TRegion& aRecursivePaintRegion, TInt aExcludeCanvasFlags) const
{
// First our own painted areas...
- CollectPaintedRegion(aRecursivePaintRegion, aExcludeCanvasFlags);
+ TBool layer = CollectPaintedRegion(aRecursivePaintRegion, aExcludeCanvasFlags);
// ...then children (and their children).
const TInt count = Count();
@@ -1559,13 +1569,14 @@
if (visual->Flags() & EHuiVisualFlagWserv)
{
CHuiCanvasVisual* canvasVisual = (CHuiCanvasVisual*)visual;
- canvasVisual->CollectRecursivePaintedRegion(aRecursivePaintRegion, aExcludeCanvasFlags);
+ layer |= canvasVisual->CollectRecursivePaintedRegion(aRecursivePaintRegion, aExcludeCanvasFlags);
}
}
}
}
}
aRecursivePaintRegion.Tidy();
+ return layer;
}
EXPORT_C TRect CHuiCanvasVisual::CommandBufferCoverage(TInt aOrientation)