104 TRACER("void CGlxHdmiSurfaceUpdater::ReleaseContent()"); |
105 TRACER("void CGlxHdmiSurfaceUpdater::ReleaseContent()"); |
105 if ( iGlxDecoderAO ) |
106 if ( iGlxDecoderAO ) |
106 { |
107 { |
107 iGlxDecoderAO->Cancel(); |
108 iGlxDecoderAO->Cancel(); |
108 } |
109 } |
109 // Delete the animation timer |
110 |
110 if(iAnimationTimer && iAnimationTimer->IsActive()) |
111 if ( iDecodedBitmap ) |
111 { |
112 { |
112 iAnimationTimer->Cancel(); |
113 delete iDecodedBitmap; |
113 delete iAnimationTimer; |
114 iDecodedBitmap= NULL; |
114 } |
115 } |
115 for (TInt i=0; i<= iFrameCount-1; i++) |
116 |
116 { |
117 if(iSurfBufferAO && iSurfBufferAO->IsActive()) |
117 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ReleaseContent(). Releasing AnimBitmaps %d", i); |
118 { |
118 delete(iDecodedBitmap[i]); |
119 iSurfBufferAO->Cancel(); |
119 iDecodedBitmap[i] = NULL; |
120 } |
120 } |
121 |
121 if ( iSurfBufferAO->IsActive() ) |
|
122 { |
|
123 iSurfBufferAO->Cancel(); |
|
124 } |
|
125 if ( iImageDecoder ) |
122 if ( iImageDecoder ) |
126 { |
123 { |
127 delete iImageDecoder; |
124 delete iImageDecoder; |
128 iImageDecoder = NULL; |
125 iImageDecoder = NULL; |
129 } |
126 } |
130 iSurfUpdateSession.CancelAllUpdateNotifications(); |
127 |
|
128 if (iSurfSessionConnected && iSurfManager) |
|
129 { |
|
130 iSurfUpdateSession.CancelAllUpdateNotifications(); |
|
131 } |
131 } |
132 } |
132 |
133 |
133 // ----------------------------------------------------------------------------- |
134 // ----------------------------------------------------------------------------- |
134 // CTor |
135 // CTor |
135 // ----------------------------------------------------------------------------- |
136 // ----------------------------------------------------------------------------- |
136 CGlxHdmiSurfaceUpdater::CGlxHdmiSurfaceUpdater(RWindow* aWindow, const TDesC& aImageFile, |
137 CGlxHdmiSurfaceUpdater::CGlxHdmiSurfaceUpdater(RWindow* aWindow, |
137 TSize aOrigImageDimensions, TInt aFrameCount, MGlxGenCallback* aCallBack): |
138 const TDesC& aImageFile, MGlxGenCallback* aCallBack): |
138 iWindow(aWindow), iImagePath(aImageFile), iOrigImageDimensions(aOrigImageDimensions), |
139 iWindow(aWindow), iImagePath(aImageFile), |
139 iFrameCount(aFrameCount ),iCallBack(aCallBack) |
140 iCallBack(aCallBack) |
140 { |
141 { |
141 TRACER("CGlxHdmiSurfaceUpdater::CGlxHdmiSurfaceUpdater()"); |
142 TRACER("CGlxHdmiSurfaceUpdater::CGlxHdmiSurfaceUpdater()"); |
142 // Implement nothing here |
143 // Implement nothing here |
143 } |
144 } |
144 |
145 |
145 // ----------------------------------------------------------------------------- |
146 // ----------------------------------------------------------------------------- |
146 // ConstructL |
147 // ConstructL |
147 // ----------------------------------------------------------------------------- |
148 // ----------------------------------------------------------------------------- |
148 void CGlxHdmiSurfaceUpdater::ConstructL(TSize /*aImageDimensions*/) |
149 void CGlxHdmiSurfaceUpdater::ConstructL() |
149 { |
150 { |
150 TRACER("CGlxHdmiSurfaceUpdater::ConstructL()"); |
151 TRACER("CGlxHdmiSurfaceUpdater::ConstructL()"); |
151 TInt error = iFsSession.Connect (); |
152 TInt error = iFsSession.Connect (); |
152 if ( KErrNone!= iFsSession.Connect () ) |
153 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ConstructL() FsSession Connect error = %d", error); |
153 { |
154 User::LeaveIfError(error); |
154 User::LeaveIfError(error); |
155 |
155 } |
|
156 iBitmapReady = EFalse; |
156 iBitmapReady = EFalse; |
157 iAnimCount = 0; |
|
158 // Create the active object |
157 // Create the active object |
159 iGlxDecoderAO = CGlxHdmiDecoderAO::NewL(this, iFrameCount); |
158 iGlxDecoderAO = CGlxHdmiDecoderAO::NewL(this); |
160 CreateImageDecoderL(iImagePath); |
159 CreateImageDecoderL(iImagePath); |
161 CreateBitmapAndStartDecodingL(); |
160 CreateBitmapL(); |
162 CreateHdmiL(); |
161 CreateHdmiL(); |
163 error = iSurfUpdateSession.Connect(); |
162 error = iSurfUpdateSession.Connect(); |
|
163 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ConstructL() Surface update Session Connect error = %d", error); |
|
164 User::LeaveIfError(error); |
|
165 iSurfSessionConnected = ETrue; |
|
166 |
164 #ifdef _DEBUG |
167 #ifdef _DEBUG |
165 iStartTime.HomeTime(); |
168 iStartTime.HomeTime(); |
166 #endif |
169 #endif |
167 if (KErrNone !=error) |
170 //start decoding the image |
168 { |
171 iGlxDecoderAO->ConvertImageL(*iDecodedBitmap,iImageDecoder); |
169 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ConstructL() Surface update Session Connect Failed with error = %d", error); |
172 |
170 User::LeaveIfError(error); |
|
171 } |
|
172 iLeftCornerForZoom.iX = 0; |
173 iLeftCornerForZoom.iX = 0; |
173 iLeftCornerForZoom.iY = 0; |
174 iLeftCornerForZoom.iY = 0; |
174 iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); |
175 iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); |
175 iZoom = ETrue; |
176 iZoom = ETrue; |
176 } |
177 } |
177 |
178 |
178 // ----------------------------------------------------------------------------- |
179 // ----------------------------------------------------------------------------- |
179 // UpdateNewImageL |
180 // UpdateNewImageL |
180 // ----------------------------------------------------------------------------- |
181 // ----------------------------------------------------------------------------- |
181 void CGlxHdmiSurfaceUpdater::UpdateNewImageL(const TDesC& aImageFile, |
182 void CGlxHdmiSurfaceUpdater::UpdateNewImageL(const TDesC& aImageFile) |
182 TInt aFrameCount,TSize aImageDimensions) |
|
183 { |
183 { |
184 TRACER("CGlxHdmiSurfaceUpdater::UpdateNewImageL()"); |
184 TRACER("CGlxHdmiSurfaceUpdater::UpdateNewImageL()"); |
185 // First release the contents before proceeding further |
185 //Cancel the zoom timers if any |
|
186 if(iTimer->IsActive()) |
|
187 { |
|
188 GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::UpdateNewImageL() - Cancel Timer"); |
|
189 iTimer->Cancel(); |
|
190 } |
|
191 |
|
192 iBitmapReady = EFalse; |
|
193 iLeftCornerForZoom.iX = 0; |
|
194 iLeftCornerForZoom.iY = 0; |
186 ReleaseContent(); |
195 ReleaseContent(); |
187 iOrigImageDimensions = aImageDimensions; |
|
188 iFrameCount = aFrameCount; |
|
189 iBitmapReady = EFalse; |
|
190 iAnimCount = 0; |
|
191 |
|
192 CreateImageDecoderL(aImageFile); |
196 CreateImageDecoderL(aImageFile); |
193 CreateBitmapAndStartDecodingL(); |
197 CreateBitmapL(); |
194 CreateHdmiL(EFalse); |
198 CreateHdmiL(EFalse); |
195 #ifdef _DEBUG |
199 #ifdef _DEBUG |
196 iStartTime.HomeTime(); |
200 iStartTime.HomeTime(); |
197 #endif |
201 #endif |
|
202 //start decoding the image |
|
203 iGlxDecoderAO->ConvertImageL(*iDecodedBitmap,iImageDecoder); |
198 } |
204 } |
199 |
205 |
200 // ----------------------------------------------------------------------------- |
206 // ----------------------------------------------------------------------------- |
201 // CreateHDMI |
207 // CreateHDMI |
202 // ----------------------------------------------------------------------------- |
208 // ----------------------------------------------------------------------------- |
317 // After this is done, a refresh to the window should be done to refresh the TV |
313 // After this is done, a refresh to the window should be done to refresh the TV |
318 // ----------------------------------------------------------------------------- |
314 // ----------------------------------------------------------------------------- |
319 void CGlxHdmiSurfaceUpdater::SwapBuffers() |
315 void CGlxHdmiSurfaceUpdater::SwapBuffers() |
320 { |
316 { |
321 TRACER("CGlxHdmiSurfaceUpdater::SwapBuffers()"); |
317 TRACER("CGlxHdmiSurfaceUpdater::SwapBuffers()"); |
322 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::SwapBuffers() animCOunt = %d",iAnimCount); |
318 |
323 // Lock the heap so that subsequent call to dataaddress doesnt happen |
319 // Lock the heap so that subsequent call to dataaddress doesnt happen |
324 iDecodedBitmap[iAnimCount]->LockHeap(); |
320 iDecodedBitmap->LockHeap(); |
325 |
321 |
326 // Data stride |
322 // Data stride |
327 TUint fs = iDecodedBitmap[iAnimCount]->DataStride(); |
323 TUint fs = iDecodedBitmap->DataStride(); |
328 |
324 |
329 //Bitmap address from where the data has to be copied. |
325 //Bitmap address from where the data has to be copied. |
330 TUint8* from = (TUint8*)iDecodedBitmap[iAnimCount]->DataAddress(); |
326 TUint8* from = (TUint8*)iDecodedBitmap->DataAddress(); |
331 |
327 |
332 //surface chunk address to where the bitmap data has to be copied. |
328 //surface chunk address to where the bitmap data has to be copied. |
333 TUint8* to = (TUint8*)iSurfBuffer; |
329 TUint8* to = (TUint8*)iSurfBuffer; |
334 |
330 |
335 // To buffer (32 bit colors) |
331 // To buffer (32 bit colors) |
336 TUint ts = iSurfaceStride; |
332 TUint ts = iSurfaceStride; |
337 //No of bytes to be copied on to the surface. |
333 //No of bytes to be copied on to the surface. |
338 TUint bytes = iDecodedBitmap[iAnimCount]->SizeInPixels().iWidth * KMulFactorToCreateBitmap; |
334 TUint bytes = iDecodedBitmap->SizeInPixels().iWidth * KMulFactorToCreateBitmap; |
339 |
335 |
340 GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::SwapBuffers() - decodeSize width = %d and height %d", |
336 GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::SwapBuffers() - decodeSize width = %d and height %d", |
341 iDecodedBitmap[iAnimCount]->SizeInPixels().iWidth, iDecodedBitmap[iAnimCount]->SizeInPixels().iHeight ); |
337 iDecodedBitmap->SizeInPixels().iWidth, iDecodedBitmap->SizeInPixels().iHeight ); |
342 |
338 |
343 // Copy the bitmap on to the surface. |
339 // Copy the bitmap on to the surface. |
344 for (TInt y = iDecodedBitmap[iAnimCount]->SizeInPixels().iHeight; y >0; y--) |
340 for (TInt y = iDecodedBitmap->SizeInPixels().iHeight; y >0; y--) |
345 { |
341 { |
346 Mem::Copy(to, from, bytes); |
342 Mem::Copy(to, from, bytes); |
347 to += ts; |
343 to += ts; |
348 from += fs; |
344 from += fs; |
349 } |
345 } |
350 iDecodedBitmap[iAnimCount]->UnlockHeap(); |
346 iDecodedBitmap->UnlockHeap(); |
351 } |
347 } |
352 |
348 |
353 // ----------------------------------------------------------------------------- |
349 // ----------------------------------------------------------------------------- |
354 // CreateBitmapL |
350 // CreateBitmapL |
355 // ----------------------------------------------------------------------------- |
351 // ----------------------------------------------------------------------------- |
356 void CGlxHdmiSurfaceUpdater::CreateBitmapAndStartDecodingL() |
352 void CGlxHdmiSurfaceUpdater::CreateBitmapL() |
357 { |
353 { |
358 TRACER("CGlxHdmiSurfaceUpdater::CreateBitmapAndStartDecodingL()"); |
354 TRACER("CGlxHdmiSurfaceUpdater::CreateBitmapL()"); |
359 TSize scrnSize = iWindow->Size(); |
355 TSize scrnSize = iWindow->Size(); |
360 TSize targetBitmapSize; |
356 TSize targetBitmapSize; |
361 if (iFrameCount>1) |
357 TSize imageSize = iImageDecoder->FrameInfo().iOverallSizeInPixels; |
362 { |
358 GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::StartImageDecodeL() - bitmapsize=%d, %d",imageSize.iWidth,imageSize.iHeight); |
363 iAnimationTimer = CPeriodic::NewL( CActive::EPriorityLow ); |
|
364 } |
|
365 |
|
366 // if (iFrameCount >1) |
|
367 // { |
|
368 // // For Gif images , use the same size of its dimensions, as Image decoder wont decode to different size. |
|
369 // GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::CreateBitmapAndStartDecodingL() -1"); |
|
370 // targetBitmapSize = iOrigImageDimensions; |
|
371 // } |
|
372 // else |
|
373 // { |
|
374 // for all other images, re calculate the size of the image based on aspect ratio and fit the screen |
|
375 GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::CreateBitmapAndStartDecodingL() -2"); |
|
376 GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::CreateBitmapAndStartDecodingL() - bitmapsize=%d, %d",iOrigImageDimensions.iWidth,iOrigImageDimensions.iHeight); |
|
377 TReal32 scaleFactor = 0.0f; |
359 TReal32 scaleFactor = 0.0f; |
378 if (scrnSize.iWidth * iOrigImageDimensions.iHeight > scrnSize.iHeight |
360 if (scrnSize.iWidth * imageSize.iHeight > scrnSize.iHeight |
379 * iOrigImageDimensions.iWidth) |
361 * imageSize.iWidth) |
380 { |
362 { |
381 scaleFactor = (TReal32) scrnSize.iHeight |
363 scaleFactor = (TReal32) scrnSize.iHeight |
382 / (TReal32) iOrigImageDimensions.iHeight; |
364 / (TReal32) imageSize.iHeight; |
383 } |
365 } |
384 else |
366 else |
385 { |
367 { |
386 scaleFactor = (TReal32) scrnSize.iWidth |
368 scaleFactor = (TReal32) scrnSize.iWidth |
387 / (TReal32) iOrigImageDimensions.iWidth; |
369 / (TReal32) imageSize.iWidth; |
388 } |
370 } |
389 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::CreateBitmapAndStartDecodingL() - scaleFactor=%f",scaleFactor); |
371 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::StartImageDecodeL() - scaleFactor=%f",scaleFactor); |
390 targetBitmapSize.iHeight = iOrigImageDimensions.iHeight * scaleFactor; |
372 targetBitmapSize.iHeight = imageSize.iHeight * scaleFactor; |
391 targetBitmapSize.iWidth = iOrigImageDimensions.iWidth * scaleFactor; |
373 targetBitmapSize.iWidth = imageSize.iWidth * scaleFactor; |
392 // } |
374 |
393 GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::CreateBitmapAndStartDecodingL() - targetBitmapSize=%d, %d",targetBitmapSize.iWidth,targetBitmapSize.iHeight); |
375 GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::StartImageDecodeL() - targetBitmapSize=%d, %d",targetBitmapSize.iWidth,targetBitmapSize.iHeight); |
394 //create the bitmap for the required size |
376 //create the bitmap for the required size |
395 iDecodedBitmap[iAnimCount] = new (ELeave) CFbsBitmap(); |
377 iDecodedBitmap = new (ELeave) CFbsBitmap(); |
396 |
378 |
397 TInt err = iDecodedBitmap[iAnimCount]->Create(targetBitmapSize, EColor16MU); |
379 TInt err = iDecodedBitmap->Create(targetBitmapSize, EColor16MU); |
398 User::LeaveIfNull(iDecodedBitmap[iAnimCount]); |
380 User::LeaveIfNull(iDecodedBitmap); |
399 GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::CreateBitmapAndStartDecodingL() FrameCOunt = %d, AnimCOunt =%d",iFrameCount, iAnimCount); |
|
400 //start decoding the image |
|
401 iGlxDecoderAO->ConvertImageL(*iDecodedBitmap[iAnimCount],iAnimCount,iImageDecoder); |
|
402 } |
381 } |
403 |
382 |
404 // ----------------------------------------------------------------------------- |
383 // ----------------------------------------------------------------------------- |
405 // HandleRunL |
384 // HandleRunL |
406 // ----------------------------------------------------------------------------- |
385 // ----------------------------------------------------------------------------- |
407 void CGlxHdmiSurfaceUpdater::HandleRunL(TRequestStatus& aStatus) |
386 void CGlxHdmiSurfaceUpdater::HandleRunL(TRequestStatus& aStatus) |
408 { |
387 { |
409 TRACER("CGlxHdmiSurfaceUpdater::HandleRunL()"); |
388 TRACER("CGlxHdmiSurfaceUpdater::HandleRunL()"); |
410 |
389 |
411 if (iFrameCount >1 && iAnimCount !=iFrameCount-1) |
390 #ifdef _DEBUG |
412 { |
391 iStopTime.HomeTime(); |
413 GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::HandleRunL() - gif image - iAnimCount= %d,FrameCOunt =%d",iAnimCount,iFrameCount); |
392 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::HandleRunL() ConvertImageL took" |
414 while(iAnimCount != iFrameCount-1 && !iGlxDecoderAO->IsActive()) |
393 " <%d> us", (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64()); |
|
394 #endif |
|
395 if(aStatus.Int() !=KErrNone) |
|
396 { |
|
397 GLX_LOG_INFO("HandleRunL - Convert failed"); |
|
398 ShiftToCloningMode(); |
|
399 } |
|
400 else |
|
401 { |
|
402 iZoomRectSz = iDecodedBitmap->SizeInPixels(); |
|
403 if (iSurfBufferAO->iStatus != KRequestPending |
|
404 && !iSurfBufferAO->IsActive()) |
415 { |
405 { |
416 iAnimCount++; |
406 Refresh(); |
417 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::HandleRunL() - gif image - iAnimCount= %d",iAnimCount); |
407 iSurfBufferAO->iStatus = KRequestPending; |
418 CreateBitmapAndStartDecodingL(); |
408 iSurfBufferAO->SetActive(); |
|
409 iSurfUpdateSession.NotifyWhenAvailable(iSurfBufferAO->iStatus); |
|
410 TInt err = iSurfUpdateSession.SubmitUpdate(1, iSurfId, 0, NULL); |
419 } |
411 } |
420 } |
412 iBitmapReady = ETrue; |
421 else |
413 } |
422 { |
414 //release imagedecoder after the conversion is over |
423 #ifdef _DEBUG |
415 if(iImageDecoder) |
424 iStopTime.HomeTime(); |
416 { |
425 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::HandleRunL() ConvertImageL took" |
417 delete iImageDecoder; |
426 " <%d> us", (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64()); |
418 iImageDecoder = NULL; |
427 #endif |
419 } |
428 if(aStatus.Int() !=KErrNone) |
420 } |
429 { |
421 |
430 GLX_LOG_INFO1("HandleRunL - Convert failed with error=%d",aStatus.Int()); |
|
431 ShiftToCloningMode(); |
|
432 } |
|
433 else |
|
434 { |
|
435 iBitmapReady = ETrue; |
|
436 iZoomRectSz = iDecodedBitmap[iAnimCount]->SizeInPixels(); |
|
437 ProcessTvImageL(); |
|
438 } |
|
439 //release imagedecoder after the conversion is over |
|
440 if(iImageDecoder) |
|
441 { |
|
442 delete iImageDecoder; |
|
443 iImageDecoder = NULL; |
|
444 } |
|
445 } |
|
446 } |
|
447 |
|
448 // ----------------------------------------------------------------------------- |
|
449 // CreateImageDecoderL |
|
450 // ----------------------------------------------------------------------------- |
|
451 void CGlxHdmiSurfaceUpdater::ProcessTvImageL() |
|
452 { |
|
453 TRACER("CGlxHdmiSurfaceUpdater::ProcessTvImageL()"); |
|
454 if (iSurfBufferAO->iStatus != KRequestPending |
|
455 && !iSurfBufferAO->IsActive()) |
|
456 { |
|
457 Refresh(); |
|
458 iSurfBufferAO->iStatus = KRequestPending; |
|
459 iSurfBufferAO->SetActive(); |
|
460 iSurfUpdateSession.NotifyWhenAvailable(iSurfBufferAO->iStatus); |
|
461 TInt err = iSurfUpdateSession.SubmitUpdate(1, iSurfId, 0, NULL); |
|
462 // If the Animation framecount is more that 1, it means this is a gif image, |
|
463 // start the timer to refresh the TV |
|
464 if (iFrameCount>1) |
|
465 { |
|
466 GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ProcessTvImageL() :Gif Image, ANimCOUnt =%d",iAnimCount); |
|
467 iAnimationTimer->Cancel(); |
|
468 |
|
469 // Next frame |
|
470 iAnimationTimer->Start(KSleepTime, KSleepTime, TCallBack(TimerCallbackL, this)); |
|
471 } |
|
472 } |
|
473 } |
|
474 // ----------------------------------------------------------------------------- |
422 // ----------------------------------------------------------------------------- |
475 // CreateImageDecoderL |
423 // CreateImageDecoderL |
476 // ----------------------------------------------------------------------------- |
424 // ----------------------------------------------------------------------------- |
477 void CGlxHdmiSurfaceUpdater::CreateImageDecoderL(const TDesC& aImageFile) |
425 void CGlxHdmiSurfaceUpdater::CreateImageDecoderL(const TDesC& aImageFile) |
478 { |
426 { |
479 TRACER("CGlxHdmiController::CreateImageDecoderL()"); |
427 TRACER("CGlxHdmiController::CreateImageDecoderL()"); |
480 // Create a decoder for the image in the named file |
428 // Create a decoder for the image in the named file |
481 TRAPD(error,iImageDecoder = CImageDecoder::FileNewL(iFsSession, |
429 TRAPD(error,iImageDecoder = CImageDecoder::FileNewL(iFsSession, |
482 aImageFile, CImageDecoder::EOptionNone, KNullUid)); |
430 aImageFile, CImageDecoder::EOptionNone, KNullUid)); |
483 if (error!=KErrNone) |
431 GLX_LOG_INFO1("CreateImageDecoderL CImageDecoder:FileNewL error %d",error); |
484 { |
432 User::LeaveIfError(error); |
485 User::Leave(error); |
433 |
486 } |
|
487 } |
434 } |
488 |
435 |
489 // ----------------------------------------------------------------------------- |
436 // ----------------------------------------------------------------------------- |
490 // ActivateZoom |
437 // ActivateZoom |
491 // ----------------------------------------------------------------------------- |
438 // ----------------------------------------------------------------------------- |
492 void CGlxHdmiSurfaceUpdater::ActivateZoom() |
439 void CGlxHdmiSurfaceUpdater::ActivateZoom(TBool aAutoZoomOut) |
493 { |
440 { |
494 TRACER("CGlxHdmiSurfaceUpdater::ActivateZoom()"); |
441 TRACER("CGlxHdmiSurfaceUpdater::ActivateZoom()"); |
495 iZoom = ETrue; |
442 iZoom = ETrue; |
496 if (!(iFrameCount >1)) |
443 iAutoZoomOut = aAutoZoomOut; |
497 { |
444 if(iTimer->IsActive()) |
498 if(!iTimer->IsActive() && iBitmapReady) |
445 { |
499 { |
446 GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ActivateZoom() - Cancel Timer"); |
500 iTimer->Start(KZoomDelay,KZoomDelay,TCallBack( TimeOut,this )); |
447 iTimer->Cancel(); |
501 } |
448 } |
502 } |
449 |
|
450 if(!iTimer->IsActive() && iBitmapReady) |
|
451 { |
|
452 GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ActivateZoom() - Start Timer"); |
|
453 iTimer->Start(KZoomDelay,KZoomDelay,TCallBack( TimeOut,this )); |
|
454 } |
503 } |
455 } |
504 |
456 |
505 // ----------------------------------------------------------------------------- |
457 // ----------------------------------------------------------------------------- |
506 // DeactivateZoom |
458 // DeactivateZoom |
507 // ----------------------------------------------------------------------------- |
459 // ----------------------------------------------------------------------------- |
508 void CGlxHdmiSurfaceUpdater::DeactivateZoom() |
460 void CGlxHdmiSurfaceUpdater::DeactivateZoom() |
509 { |
461 { |
510 TRACER("CGlxHdmiSurfaceUpdater::DeactivateZoom()"); |
462 TRACER("CGlxHdmiSurfaceUpdater::DeactivateZoom()"); |
511 if(iDecodedBitmap[iAnimCount] && !(iFrameCount >1)) |
463 |
512 { |
464 if(iTimer->IsActive()) |
513 TSize bitmapsize = iDecodedBitmap[iAnimCount]->SizeInPixels(); |
465 { |
514 iConfig.SetViewport(TRect(0,0,bitmapsize.iWidth,bitmapsize.iHeight)); |
466 GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::DeactivateZoom() - Cancel Timer"); |
515 iConfig.SetExtent(TRect(0,0,bitmapsize.iWidth,bitmapsize.iHeight)); |
467 iTimer->Cancel(); |
516 iWindow->SetBackgroundSurface(iConfig, ETrue); |
468 } |
517 } |
469 if(!iTimer->IsActive() && iBitmapReady && iLeftCornerForZoom.iX) |
|
470 { |
|
471 GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::DeactivateZoom() - Start Timer"); |
|
472 iZoom = EFalse; |
|
473 iTimer->Start(KZoomDelay,KZoomDelay,TCallBack( TimeOut,this )); |
|
474 } |
518 } |
475 } |
519 |
476 |
520 // --------------------------------------------------------------------------- |
477 // --------------------------------------------------------------------------- |
521 // TimeOut |
478 // TimeOut |
522 // --------------------------------------------------------------------------- |
479 // --------------------------------------------------------------------------- |