mdfdevvideoextensions/nga_mdf_postprocessor/src/NGAPostProcHwDevice.cpp
branchRCL_3
changeset 55 e51ae4fd18e6
parent 50 948c7f65f6d4
equal deleted inserted replaced
52:613edd2a8a70 55:e51ae4fd18e6
  1548     TInt 			offset;
  1548     TInt 			offset;
  1549 
  1549 
  1550     PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::MmvshcRedrawBufferToSurface -- Creating %d x %d surface"), this, iPicSize.iWidth, iPicSize.iHeight);
  1550     PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::MmvshcRedrawBufferToSurface -- Creating %d x %d surface"), this, iPicSize.iWidth, iPicSize.iHeight);
  1551 
  1551 
  1552    	TInt err = KErrNone;
  1552    	TInt err = KErrNone;
  1553 	SetSurfaceAttributes(iPicSize, 1); 
  1553 	TSize evenSize(iPicSize);
       
  1554 	if (evenSize.iWidth % 2 != 0)
       
  1555 		{
       
  1556 		++evenSize.iWidth;
       
  1557 		}
       
  1558 	if (evenSize.iHeight % 2 != 0)
       
  1559 		{
       
  1560 		++evenSize.iHeight;
       
  1561 		}
       
  1562 
       
  1563 	SetSurfaceAttributes(evenSize, 1); 
  1554 	
  1564 	
  1555   	err = iSurfaceHandler->CreateSurface(iAttributes, iSurfaceId);
  1565   	err = iSurfaceHandler->CreateSurface(iAttributes, iSurfaceId);
  1556   	if (err != KErrNone)
  1566   	if (err != KErrNone)
  1557 	{
  1567 	{
  1558 	   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvshcRedrawBufferToSurface -- failed to create Surface %d"), 
  1568 	   PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvshcRedrawBufferToSurface -- failed to create Surface %d"), 
  1612     }
  1622     }
  1613 
  1623 
  1614     PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::MmvshcRedrawBufferToSurface offset = %d"), this, offset);
  1624     PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::MmvshcRedrawBufferToSurface offset = %d"), this, offset);
  1615 
  1625 
  1616 	lPtr = reinterpret_cast<TUint8*>(iChunk.Base() + offset);
  1626 	lPtr = reinterpret_cast<TUint8*>(iChunk.Base() + offset);
  1617 	memcpy((TAny *)lPtr, (TAny *)aRedrawBuffer.Ptr(), redrawBufferSize);
  1627 
       
  1628 	if (evenSize.iWidth > iPicSize.iWidth)
       
  1629 		{
       
  1630 		TInt redrawLineWidth = redrawBufferSize / iPicSize.iHeight;
       
  1631 
       
  1632 		for (TInt i = 0; i < iPicSize.iHeight; ++i)
       
  1633 			{
       
  1634 			memcpy((TAny*)(lPtr + (i * iInfo().iStride)), (TAny*)(aRedrawBuffer.Ptr() + (i * redrawLineWidth)), redrawLineWidth);
       
  1635 			}
       
  1636 		}
       
  1637 	else
       
  1638 		{
       
  1639 		memcpy((TAny *)lPtr, (TAny *)aRedrawBuffer.Ptr(), redrawBufferSize);
       
  1640 		}
  1618 
  1641 
  1619 	iRedrawSurfaceInUse = ETrue;
  1642 	iRedrawSurfaceInUse = ETrue;
  1620 
  1643 
  1621 	PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::MmvshcRedrawBufferToSurface(): New surface = 0x%x"), this, iSurfaceId);
  1644 	PP_DEBUG(_L("CNGAPostProcHwDevice[%x]::MmvshcRedrawBufferToSurface(): New surface = 0x%x"), this, iSurfaceId);
  1622 
  1645