equal
deleted
inserted
replaced
75 #endif |
75 #endif |
76 #ifndef HUIFX_EFFECTCACHE_ENABLED |
76 #ifndef HUIFX_EFFECTCACHE_ENABLED |
77 return EFalse; |
77 return EFalse; |
78 #endif |
78 #endif |
79 } |
79 } |
|
80 |
|
81 TBool CHuiFxEngine::FxmlUsesInput1(CHuiFxEffect& aEffect) |
|
82 { |
|
83 RArray<THuiFxVisualSrcType> array; |
|
84 aEffect.FxmlVisualInputs(array); |
|
85 |
|
86 TInt c = array.Count(); |
|
87 for(TInt i = 0; i<c; i++) |
|
88 { |
|
89 THuiFxVisualSrcType val = array[i]; |
|
90 if (val == EVisualSrcInput1) |
|
91 { |
|
92 array.Close(); |
|
93 return ETrue; |
|
94 } |
|
95 } |
|
96 array.Close(); |
|
97 return EFalse; |
|
98 } |
|
99 |
80 |
100 |
81 EXPORT_C void CHuiFxEngine::RegisterEffectL(const TDesC &aFileName) |
101 EXPORT_C void CHuiFxEngine::RegisterEffectL(const TDesC &aFileName) |
82 { |
102 { |
83 #ifdef HUIFX_EFFECTCACHE_ENABLED |
103 #ifdef HUIFX_EFFECTCACHE_ENABLED |
84 const TDesC *filename = &aFileName; |
104 const TDesC *filename = &aFileName; |
148 parser->ParseL( aFileName, iExtRect ); |
168 parser->ParseL( aFileName, iExtRect ); |
149 #endif |
169 #endif |
150 #ifdef HUIFX_EFFECTCACHE_ENABLED |
170 #ifdef HUIFX_EFFECTCACHE_ENABLED |
151 CHuiFxEffectCacheEffectNode *node = new (ELeave) CHuiFxEffectCacheEffectNode(aFileName, aEffect, aVisual, &iExtRect, this); |
171 CHuiFxEffectCacheEffectNode *node = new (ELeave) CHuiFxEffectCacheEffectNode(aFileName, aEffect, aVisual, &iExtRect, this); |
152 node->SetEffectEndObserver( aEffectEndObserver, aHandle ); |
172 node->SetEffectEndObserver( aEffectEndObserver, aHandle ); |
153 aFlags |= KHuiFxDelayRunUntilFirstFrameHasBeenDrawn; |
|
154 node->SetEffectFlags( aFlags ); |
173 node->SetEffectFlags( aFlags ); |
155 CleanupStack::PushL(node); |
174 CleanupStack::PushL(node); |
156 iCache->FindOrCreateL(node); // takes ownership |
175 iCache->FindOrCreateL(node); // takes ownership |
157 CleanupStack::Pop(); |
176 CleanupStack::Pop(); |
158 #endif |
177 #endif |
204 if (aGroup != KErrNotFound) |
223 if (aGroup != KErrNotFound) |
205 { |
224 { |
206 aFlags |= KHuiFxWaitGroupSyncronization; |
225 aFlags |= KHuiFxWaitGroupSyncronization; |
207 node->SetEffectGroup(aGroup); |
226 node->SetEffectGroup(aGroup); |
208 } |
227 } |
209 aFlags |= KHuiFxDelayRunUntilFirstFrameHasBeenDrawn; |
|
210 node->SetEffectFlags( aFlags ); |
228 node->SetEffectFlags( aFlags ); |
211 |
229 |
212 CleanupStack::PushL(node); |
230 CleanupStack::PushL(node); |
213 iCache->FindOrCreateL(node); // takes ownership |
231 iCache->FindOrCreateL(node); // takes ownership |
214 CleanupStack::Pop(); |
232 CleanupStack::Pop(); |
312 #ifdef HUIFX_TRACE |
330 #ifdef HUIFX_TRACE |
313 RDebug::Print(_L("CHuiFxEngine::AddEffectL - 0x%x "), aEffect); |
331 RDebug::Print(_L("CHuiFxEngine::AddEffectL - 0x%x "), aEffect); |
314 #endif // #ifdef HUIFX_TRACE |
332 #endif // #ifdef HUIFX_TRACE |
315 |
333 |
316 iActiveEffects.AppendL(aEffect); |
334 iActiveEffects.AppendL(aEffect); |
|
335 |
|
336 // Performance improvement, but this would be better to be a special hint param in the fxml |
|
337 if (aEffect && FxmlUsesInput1(*aEffect)) |
|
338 { |
|
339 TInt flags = aEffect->EffectFlags(); |
|
340 flags |= KHuiFxOpaqueHint; |
|
341 aEffect->SetEffectFlags(flags); |
|
342 } |
317 } |
343 } |
318 |
344 |
319 EXPORT_C void CHuiFxEngine::RemoveEffect(CHuiFxEffect* aEffect) |
345 EXPORT_C void CHuiFxEngine::RemoveEffect(CHuiFxEffect* aEffect) |
320 { |
346 { |
321 #ifdef HUIFX_TRACE |
347 #ifdef HUIFX_TRACE |