equal
deleted
inserted
replaced
348 } |
348 } |
349 |
349 |
350 if (Effect()) |
350 if (Effect()) |
351 { |
351 { |
352 TBool hasStoredContent = (IsDelayedEffectSource() || Freezed()) && (StoredRenderBuffer() || iCanvasVisualData->iStoredRenderBuffer); |
352 TBool hasStoredContent = (IsDelayedEffectSource() || Freezed()) && (StoredRenderBuffer() || iCanvasVisualData->iStoredRenderBuffer); |
353 |
353 TBool semiTranparentEffectActive = iEffectOpacity < 1.f; |
354 TBool semiTranparentEffectActive = Effect()->IsSemitransparent(); |
|
355 if ((iOpacity.Now() <= EPSILON && !semiTranparentEffectActive)) |
354 if ((iOpacity.Now() <= EPSILON && !semiTranparentEffectActive)) |
356 { |
355 { |
357 return ETrue; |
356 return ETrue; |
358 } |
357 } |
359 TBool childWindowEffectActive = EffectIsAppliedToChildren(); |
358 TBool childWindowEffectActive = EffectIsAppliedToChildren(); |
394 return; |
393 return; |
395 } |
394 } |
396 } |
395 } |
397 |
396 |
398 // Optimization |
397 // Optimization |
399 if (CanSkipDrawing()) |
398 if (!EffectActive() && CanSkipDrawing()) |
400 { |
399 { |
401 return; |
400 return; |
402 } |
401 } |
403 |
402 |
404 if ((IsDelayedEffectSource() || Freezed())) |
403 if ((IsDelayedEffectSource() || Freezed())) |
451 // Flag to know what we did |
450 // Flag to know what we did |
452 TBool didDrawEffect = EFalse; |
451 TBool didDrawEffect = EFalse; |
453 |
452 |
454 if (EffectActive()) |
453 if (EffectActive()) |
455 { |
454 { |
456 // Note that EHuiVisualFlagOpaqueHint improves performance a lot in cached effect drawing |
|
457 TBool transparent = EFalse; |
|
458 transparent |= (!(Flags() & EHuiVisualFlagOpaqueHint)); // Does not have opaque hint -> always transparent |
|
459 transparent |= iOpacity.Now() < 1.0f; // Opacity less than 1.0f -> always transparent |
|
460 |
|
461 TBool refreshCache = EFalse; |
455 TBool refreshCache = EFalse; |
462 TBool layer = EFalse; |
456 TBool layer = EFalse; |
463 if (EffectIsAppliedToChildren()) |
457 if (EffectIsAppliedToChildren()) |
464 { |
458 { |
465 refreshCache |= ChildTreeChanged(EHuiCanvasFlagExcludeFromParentEffect); |
459 refreshCache |= ChildTreeChanged(EHuiCanvasFlagExcludeFromParentEffect); |
477 |
471 |
478 if(Display()->RosterImpl().AlfEventWindow() == this) |
472 if(Display()->RosterImpl().AlfEventWindow() == this) |
479 { |
473 { |
480 refreshCache |= Display()->RosterImpl().NativeAppsContentChanged(); |
474 refreshCache |= Display()->RosterImpl().NativeAppsContentChanged(); |
481 } |
475 } |
482 didDrawEffect = Effect()->CachedDraw(aGc, area, refreshCache, !transparent, iCanvasVisualData->iPaintedRegion,layer ); |
476 Effectable()->EffectSetOpacityAdditive(0.0f, ETrue); |
483 |
477 // PrepareDraw will update iEffectOpacity to correct opacity for this effect frame |
|
478 if(Effect()->PrepareDrawL(aGc, area)) |
|
479 { |
|
480 // let's still check if effect is making visual fully transparent |
|
481 if(CanSkipDrawing()) |
|
482 { |
|
483 return; |
|
484 } |
|
485 // Note that EHuiVisualFlagOpaqueHint improves performance a lot in cached effect drawing |
|
486 TBool transparent = EFalse; |
|
487 transparent |= (!(Flags() & EHuiVisualFlagOpaqueHint)); // Does not have opaque hint -> always transparent |
|
488 transparent |= iOpacity.Now() < 1.0f; // Opacity less than 1.0f -> always transparent |
|
489 transparent |= iEffectOpacity < 1.0f; // effect opacity is less than 1.0f |
|
490 |
|
491 didDrawEffect = Effect()->CachedDraw(aGc, area, refreshCache, !transparent, iCanvasVisualData->iPaintedRegion, layer ); |
|
492 } |
484 } |
493 } |
485 |
494 |
486 if ( !didDrawEffect ) |
495 if ( !didDrawEffect ) |
487 { |
496 { |
488 DrawSelf(aGc, area); |
497 DrawSelf(aGc, area); |
1336 void CHuiCanvasVisual::DrawStoredVisualRenderBuffer(TInt aCanvasDrawMode) const |
1345 void CHuiCanvasVisual::DrawStoredVisualRenderBuffer(TInt aCanvasDrawMode) const |
1337 { |
1346 { |
1338 CHuiCanvasGc& gc = CanvasGc(); |
1347 CHuiCanvasGc& gc = CanvasGc(); |
1339 CHuiCanvasVisual* visual = NULL; |
1348 CHuiCanvasVisual* visual = NULL; |
1340 TBool transparent = EffectiveOpacity() < 1.0f; |
1349 TBool transparent = EffectiveOpacity() < 1.0f; |
1341 gc.SetDrawMode((THuiCanvasDrawMode)aCanvasDrawMode); |
1350 if(EffectActive()) |
|
1351 { |
|
1352 transparent |= iEffectOpacity < 1.0f; |
|
1353 } |
|
1354 gc.SetDrawMode((THuiCanvasDrawMode)aCanvasDrawMode); |
1342 if (transparent) |
1355 if (transparent) |
1343 { |
1356 { |
1344 gc.EnableEffectiveOpacity(ETrue); |
1357 gc.EnableEffectiveOpacity(ETrue); |
1345 visual = gc.Visual(); |
1358 visual = gc.Visual(); |
1346 gc.SetVisual(*this); |
1359 gc.SetVisual(*this); |
1382 } |
1395 } |
1383 |
1396 |
1384 THuiRealPoint dest_point = DisplayRect().iTl; |
1397 THuiRealPoint dest_point = DisplayRect().iTl; |
1385 CHuiCanvasRenderBuffer *stored = StoredRenderBuffer(); |
1398 CHuiCanvasRenderBuffer *stored = StoredRenderBuffer(); |
1386 TBool transparent = EffectiveOpacity() < 1.0f; |
1399 TBool transparent = EffectiveOpacity() < 1.0f; |
|
1400 if(EffectActive()) |
|
1401 { |
|
1402 transparent |= iEffectOpacity < 1.0f; |
|
1403 } |
1387 CHuiCanvasVisual* visual = NULL; |
1404 CHuiCanvasVisual* visual = NULL; |
1388 gc.SetDrawMode((THuiCanvasDrawMode)aCanvasDrawMode); |
1405 gc.SetDrawMode((THuiCanvasDrawMode)aCanvasDrawMode); |
1389 if (transparent) |
1406 if (transparent) |
1390 { |
1407 { |
1391 |
1408 |
1597 inactive |= Flags() & EHuiVisualFlagInactive; |
1614 inactive |= Flags() & EHuiVisualFlagInactive; |
1598 inactive |= Flags() & EHuiVisualFlagUnderOpaqueHint; |
1615 inactive |= Flags() & EHuiVisualFlagUnderOpaqueHint; |
1599 |
1616 |
1600 return rosterFrozen || inactive; |
1617 return rosterFrozen || inactive; |
1601 } |
1618 } |
|
1619 |
|
1620 TBool CHuiCanvasVisual::EffectReadyToDrawNextFrame() const |
|
1621 { |
|
1622 // if the visual is drawn ans a external content it is probably already inactive |
|
1623 if (Flags() & EHuiVisualFlagDrawOnlyAsExternalContent) |
|
1624 { |
|
1625 if (Display() && Display()->RosterImpl().IsDrawingExternalContent()) |
|
1626 { |
|
1627 return ETrue; |
|
1628 } |
|
1629 } |
|
1630 |
|
1631 // other checks to |
|
1632 TBool rdyToDraw = EFalse; |
|
1633 if(Display()->RosterImpl().AlfEventWindow() == this) |
|
1634 { |
|
1635 rdyToDraw |= ETrue; |
|
1636 } |
|
1637 |
|
1638 rdyToDraw |= (IsDelayedEffectSource() || Freezed()) && |
|
1639 (StoredRenderBuffer() || iCanvasVisualData->iStoredRenderBuffer); |
|
1640 rdyToDraw |= (Effect()->EffectFlags() & KHuiFxEnableBackgroundInAllLayers); |
|
1641 rdyToDraw |= EffectIsAppliedToChildren(); |
|
1642 rdyToDraw |= IsExternalContentDrawingEnabled() || IsExternalContentDrawingEnabled(ETrue); |
|
1643 rdyToDraw |= IsBackgroundDrawingEnabled(); |
|
1644 |
|
1645 rdyToDraw |= HasCommandBuffers(ETrue); |
|
1646 |
|
1647 // visual must be active (seen) and have content |
|
1648 return (!(Flags() & EHuiVisualFlagInactive) && rdyToDraw); |
|
1649 } |