37 #include "HuiFxEffectParser.h" |
37 #include "HuiFxEffectParser.h" |
38 #include "alflogger.h" |
38 #include "alflogger.h" |
39 #include "HuiCmdBufferBrush.h" |
39 #include "HuiCmdBufferBrush.h" |
40 #include "huicanvasrenderbuffer.h" |
40 #include "huicanvasrenderbuffer.h" |
41 |
41 |
|
42 #include "huiextension.h" |
|
43 |
42 struct CHuiVisual::THuiVisualPrivateData |
44 struct CHuiVisual::THuiVisualPrivateData |
43 { |
45 { |
44 public: // Functions |
46 public: // Functions |
45 // Constructor: initialize the data |
47 // Constructor: initialize the data |
46 THuiVisualPrivateData() : iTacticons(), iDropShadow(NULL) |
48 THuiVisualPrivateData() : iTacticons(), iDropShadow(NULL) |
65 TInt iEventType; |
67 TInt iEventType; |
66 }; |
68 }; |
67 |
69 |
68 // Data |
70 // Data |
69 RArray<TTacticon> iTacticons; |
71 RArray<TTacticon> iTacticons; |
70 CHuiDropShadow* iDropShadow; |
72 CHuiDropShadow* iDropShadow; |
71 TRect iPreviousDrawnTvOut; |
|
72 CHuiFxEffect* iEffect; |
73 CHuiFxEffect* iEffect; |
73 CHuiFxEffectParser* iEffectParser; |
74 CHuiFxEffectParser* iEffectParser; |
74 MHuiEffectable *iEffectable; |
75 MHuiEffectable *iEffectable; |
75 CHuiCanvasRenderBuffer* iStoredRenderBuffer; |
76 CHuiCanvasRenderBuffer* iStoredRenderBuffer; |
76 TBool iStoredRenderBufferModificationsEnabled; |
77 TBool iStoredRenderBufferModificationsEnabled; |
216 for(TInt i = 0; i < Env().Displays().Count(); ++i) |
217 for(TInt i = 0; i < Env().Displays().Count(); ++i) |
217 { |
218 { |
218 CHuiDisplay* display = &Env().Display(i); |
219 CHuiDisplay* display = &Env().Display(i); |
219 if (&(display->Roster()) == &roster) |
220 if (&(display->Roster()) == &roster) |
220 { |
221 { |
221 const TRect& previousDirtyRect = display->IsDisplayTypeTvOut() ? iVisualData->iPreviousDrawnTvOut : iPreviousDrawn; |
222 const TRect& previousDirtyRect = iPreviousDrawn; |
222 TRect empty; |
223 TRect empty; |
223 display->CombineAndAddDirtyRegion(previousDirtyRect, empty); |
224 display->CombineAndAddDirtyRegion(previousDirtyRect, empty); |
224 } |
225 } |
225 } |
226 } |
226 } |
227 } |
688 } |
689 } |
689 |
690 |
690 |
691 |
691 EXPORT_C THuiRealRect CHuiVisual::DisplayRect() const __SOFTFP |
692 EXPORT_C THuiRealRect CHuiVisual::DisplayRect() const __SOFTFP |
692 { |
693 { |
|
694 // if this visual is wserv owned, we can take some shortcuts |
|
695 // when calculating the displayrect (ie. none of the "advanced" |
|
696 // functionality is used |
|
697 if (iFlags & EHuiVisualFlagWserv) |
|
698 { |
|
699 TReal x = iPos.iX.iInterpolationStartValue; |
|
700 TReal y = iPos.iY.iInterpolationStartValue; |
|
701 TReal width = iSize.iX.iInterpolationStartValue; |
|
702 TReal height = iSize.iY.iInterpolationStartValue; |
|
703 |
|
704 const CHuiVisual* iter = this; |
|
705 while(iter) |
|
706 { |
|
707 // Move up in the tree. |
|
708 iter = iter->iLayout; |
|
709 if(iter) |
|
710 { |
|
711 x+=iter->iPos.iX.iInterpolationStartValue; |
|
712 y+=iter->iPos.iY.iInterpolationStartValue; |
|
713 } |
|
714 } |
|
715 |
|
716 iDisplayRect.iTl.iX = x; |
|
717 iDisplayRect.iTl.iY = y; |
|
718 iDisplayRect.iBr.iX = x+width; |
|
719 iDisplayRect.iBr.iY = y+height; |
|
720 return iDisplayRect; |
|
721 } |
693 // Recalculate and cache as necessary. |
722 // Recalculate and cache as necessary. |
694 TBool recalculationNeeded = ETrue; |
723 TBool recalculationNeeded = ETrue; |
695 |
724 |
696 TUint frameno = 0; // CHuiStatic::FrameCount() is called before used |
725 TUint frameno = 0; // CHuiStatic::FrameCount() is called before used |
697 const TBool calledDuringDraw = Env().CurrentDisplay() ? ETrue : EFalse; |
726 const TBool calledDuringDraw = Env().CurrentDisplay() ? ETrue : EFalse; |
1481 dirty = TRect(HUI_ROUND_FLOAT_TO_INT(displayRect.iTl.iX), HUI_ROUND_FLOAT_TO_INT(displayRect.iTl.iY), |
1510 dirty = TRect(HUI_ROUND_FLOAT_TO_INT(displayRect.iTl.iX), HUI_ROUND_FLOAT_TO_INT(displayRect.iTl.iY), |
1482 HUI_ROUND_FLOAT_TO_INT(displayRect.iBr.iX), HUI_ROUND_FLOAT_TO_INT(displayRect.iBr.iY)); |
1511 HUI_ROUND_FLOAT_TO_INT(displayRect.iBr.iX), HUI_ROUND_FLOAT_TO_INT(displayRect.iBr.iY)); |
1483 ExpandRectWithContent(dirty); |
1512 ExpandRectWithContent(dirty); |
1484 } |
1513 } |
1485 |
1514 |
1486 TRect& previousDrawn = display->IsDisplayTypeTvOut() ? iVisualData->iPreviousDrawnTvOut : iPreviousDrawn; |
1515 TRect& previousDrawn = iPreviousDrawn; |
1487 |
1516 |
1488 // CombineAndAddDirtyRegion modifies "dirty" param by transforming it. |
1517 // CombineAndAddDirtyRegion modifies "dirty" param by transforming it. |
1489 // "previousDrawn" is supposed to be already transformed. |
1518 // "previousDrawn" is supposed to be already transformed. |
1490 display->CombineAndAddDirtyRegion(previousDrawn, dirty); |
1519 display->CombineAndAddDirtyRegion(previousDrawn, dirty); |
1491 |
1520 |
2151 void CHuiVisual::SetEffectParser( CHuiFxEffectParser* aEffectParser ) |
2180 void CHuiVisual::SetEffectParser( CHuiFxEffectParser* aEffectParser ) |
2152 { |
2181 { |
2153 delete iVisualData->iEffectParser; |
2182 delete iVisualData->iEffectParser; |
2154 iVisualData->iEffectParser = aEffectParser; |
2183 iVisualData->iEffectParser = aEffectParser; |
2155 } |
2184 } |
|
2185 |
|
2186 TInt CHuiVisual::QueryCanvasFlags() |
|
2187 { |
|
2188 THuiVisualQueryParams p; |
|
2189 p.iQueryType = THuiVisualQueryParams::EQueryCanvasFlags; |
|
2190 p.iValue = 0; |
|
2191 p.iResult = KErrNotSupported; |
|
2192 TAny* ptr = &p; |
|
2193 |
|
2194 VisualExtension(KHuiVisualQueryUid, &ptr); |
|
2195 |
|
2196 // If visual does not support this extension, assume 0 |
|
2197 |
|
2198 return ( p.iResult == KErrNone ) ? p.iValue : 0; |
|
2199 } |
|
2200 |
|
2201 TBool CHuiVisual::QueryExternalContentDrawingEnabled() |
|
2202 { |
|
2203 THuiVisualQueryParams p; |
|
2204 p.iQueryType = THuiVisualQueryParams::EQueryExternalContentDrawingEnabled; |
|
2205 p.iValue = 0; |
|
2206 p.iResult = KErrNotSupported; |
|
2207 TAny* ptr = &p; |
|
2208 |
|
2209 VisualExtension(KHuiVisualQueryUid, &ptr); |
|
2210 |
|
2211 // If visual does not support this extension, assume |
|
2212 // that visual does not have external content drawing enabled. |
|
2213 |
|
2214 return ( p.iResult == KErrNone ) && p.iValue; |
|
2215 } |
|
2216 |
|
2217 TBool CHuiVisual::QueryHasDrawableContent() |
|
2218 { |
|
2219 THuiVisualQueryParams p; |
|
2220 p.iQueryType = THuiVisualQueryParams::EQueryHasDrawableContent; |
|
2221 p.iValue = 0; |
|
2222 p.iResult = KErrNotSupported; |
|
2223 TAny* ptr = &p; |
|
2224 |
|
2225 VisualExtension(KHuiVisualQueryUid, &ptr); |
|
2226 |
|
2227 // If visual does not support this extension, assume |
|
2228 // that it has something to draw. |
|
2229 |
|
2230 return p.iValue || ( p.iResult != KErrNone ); |
|
2231 } |