vghwinterface/vghwapiwrapper/src/eglapiwrapper.cpp
branchbug235_bringup_0
changeset 56 40cc73c24bf8
parent 53 c2ef9095503a
child 71 243bbc1d70db
equal deleted inserted replaced
55:09263774e342 56:40cc73c24bf8
    45 }
    45 }
    46 
    46 
    47 void EGLAPIWrapper::SetProcessInformation( TUint32 aProcess, TUint32 aThread )
    47 void EGLAPIWrapper::SetProcessInformation( TUint32 aProcess, TUint32 aThread )
    48 {
    48 {
    49     TRACE("EGLAPIWrapper::SetProcessInformation()\n");
    49     TRACE("EGLAPIWrapper::SetProcessInformation()\n");
    50 	::eglPlatsimSetProcessInformation( aProcess, aThread );
    50 	::eglSimulatorSetProcessInformation( aProcess, aThread );
    51 }
    51 }
    52 
    52 
    53 void EGLAPIWrapper::Cleanup( TUint32 aProcess, TUint32 aThread )
    53 void EGLAPIWrapper::Cleanup( TUint32 aProcess, TUint32 aThread )
    54 {
    54 {
    55     TRACE("EGLAPIWrapper::Cleanup()\n");
    55     TRACE("EGLAPIWrapper::Cleanup()\n");
    56 	::eglPlatsimSetProcessInformation( aProcess, aThread );
    56 	::eglSimulatorSetProcessInformation( aProcess, aThread );
    57 	::eglReleaseThread();
    57 	::eglReleaseThread();
    58 }
    58 }
    59 
    59 
    60 int EGLAPIWrapper::WriteReply()
    60 int EGLAPIWrapper::WriteReply()
    61 {
    61 {
    62     TRACE("EGLAPIWrapper::WriteReply()\n");
    62     TRACE("EGLAPIWrapper::WriteReply()\n");
    63 #ifdef LOG_ERROR
    63 #ifdef LOG_ERROR
    64 	int operationid = (int)m_currentFunctionCall.Data().Header().iOpCode;
    64 	int operationid = (int)m_currentFunctionCall.Data().Header().iOpCode;
    65 	int eglerror = ::eglPlatsimGetError();
    65 	int eglerror = ::eglSimulatorGetError();
    66 	if ( m_lastEglError != eglerror )
    66 	if ( m_lastEglError != eglerror )
    67 	{
    67 	{
    68 		if ( EGL_SUCCESS != eglerror )
    68 		if ( EGL_SUCCESS != eglerror )
    69 			{
    69 			{
    70 			TRACE("EGL error 0x%X, for request %d\n", eglerror, operationid );
    70 			TRACE("EGL error 0x%X, for request %d\n", eglerror, operationid );
   815 	TRACE("EGLAPIWrapper::eglCopyBiffers() <-\n");
   815 	TRACE("EGLAPIWrapper::eglCopyBiffers() <-\n");
   816     return ret;
   816     return ret;
   817 }
   817 }
   818 
   818 
   819 
   819 
   820 int EGLAPIWrapper::eglPlatsimSetSurfaceParams()
   820 int EGLAPIWrapper::eglSimulatorSetSurfaceParams()
   821 {
   821 {
   822     TRACE("EGLAPIWrapper::eglPlatsimSetSurfaceParams() ->\n");
   822     TRACE("EGLAPIWrapper::eglSimulatorSetSurfaceParams() ->\n");
   823     EGLDisplay display;
   823     EGLDisplay display;
   824     EGLSurface surface;
   824     EGLSurface surface;
   825     EGLint width;
   825     EGLint width;
   826     EGLint height;
   826     EGLint height;
   827     EGLint stride;
   827     EGLint stride;
   839     m_currentFunctionCall.GetEGLint( buffer1Offset, 7 );
   839     m_currentFunctionCall.GetEGLint( buffer1Offset, 7 );
   840 
   840 
   841     void* buffer0 = (void*)((EGLint)m_surfaceBuffer + buffer0Offset);
   841     void* buffer0 = (void*)((EGLint)m_surfaceBuffer + buffer0Offset);
   842     void* buffer1 = (void*)((EGLint)m_surfaceBuffer + buffer1Offset);
   842     void* buffer1 = (void*)((EGLint)m_surfaceBuffer + buffer1Offset);
   843 
   843 
   844 	::eglPlatsimSetSurfaceParams(display, surface, width, height, stride, buffer0, buffer1);
   844 	::eglSimulatorSetSurfaceParams(display, surface, width, height, stride, buffer0, buffer1);
   845 	m_currentFunctionCall.SetReturnValue( 0 );
   845 	m_currentFunctionCall.SetReturnValue( 0 );
   846 	TRACE("EGLAPIWrapper::eglPlatsimSetSurfaceParams() <-\n");
   846 	TRACE("EGLAPIWrapper::eglSimulatorSetSurfaceParams() <-\n");
   847     return WriteReply();
   847     return WriteReply();
   848 }
   848 }
   849 
   849 
   850 
   850 
   851 int EGLAPIWrapper::eglPlatsimCopyImageData()
   851 int EGLAPIWrapper::eglSimulatorCopyImageData()
   852 {
   852 {
   853     TRACE("EGLAPIWrapper::eglPlatsimCopyImageData() ->\n");
   853     TRACE("EGLAPIWrapper::eglSimulatorCopyImageData() ->\n");
   854     void* data(NULL);
   854     void* data(NULL);
   855     int size(0);
   855     int size(0);
   856     m_currentFunctionCall.GetVectorData( data, size, 0 );
   856     m_currentFunctionCall.GetVectorData( data, size, 0 );
   857 
   857 
   858 	if ( size )
   858 	if ( size )
   859 		{
   859 		{
   860 		EGLDisplay display = ::eglGetCurrentDisplay();
   860 		EGLDisplay display = ::eglGetCurrentDisplay();
   861 		EGLSurface surface = ::eglGetCurrentSurface(EGL_DRAW);
   861 		EGLSurface surface = ::eglGetCurrentSurface(EGL_DRAW);
   862 		NativePixmapType nativePixmap = eglPlatsimGetPixmapSurfaceBitmap(display,surface);
   862 		NativePixmapType nativePixmap = eglSimulatorGetPixmapSurfaceBitmap(display,surface);
   863 		SymbianPixmap* symbianBitmap = (SymbianPixmap*)nativePixmap;
   863 		SymbianPixmap* symbianBitmap = (SymbianPixmap*)nativePixmap;
   864 		if ( symbianBitmap )
   864 		if ( symbianBitmap )
   865 			{
   865 			{
   866 			m_currentFunctionCall.SetVectorData( symbianBitmap->data, size, 0 );
   866 			m_currentFunctionCall.SetVectorData( symbianBitmap->data, size, 0 );
   867 			}
   867 			}
   868 		}	
   868 		}	
   869     TRACE("EGLAPIWrapper::eglPlatsimCopyImageData() <-\n");
   869     TRACE("EGLAPIWrapper::eglSimulatorCopyImageData() <-\n");
   870     return WriteReply();
   870     return WriteReply();
   871 }
   871 }
   872 
   872 
   873 int EGLAPIWrapper::eglPixmapSurfaceSizeChanged()
   873 int EGLAPIWrapper::eglPixmapSurfaceSizeChanged()
   874 {
   874 {
   886 	EGLint height;
   886 	EGLint height;
   887     m_currentFunctionCall.GetEGLint( height, 5 );
   887     m_currentFunctionCall.GetEGLint( height, 5 );
   888 	EGLint stride;
   888 	EGLint stride;
   889     m_currentFunctionCall.GetEGLint( stride, 6 );
   889     m_currentFunctionCall.GetEGLint( stride, 6 );
   890 
   890 
   891 	NativePixmapType nativePixmap = eglPlatsimGetPixmapSurfaceBitmap(display,surface);
   891 	NativePixmapType nativePixmap = eglSimulatorGetPixmapSurfaceBitmap(display,surface);
   892 	SymbianPixmap* symbianBitmap = (SymbianPixmap*)nativePixmap;
   892 	SymbianPixmap* symbianBitmap = (SymbianPixmap*)nativePixmap;
   893 	if ( symbianBitmap )
   893 	if ( symbianBitmap )
   894 	{
   894 	{
   895 		symbianBitmap->format = (TDisplayMode)format;
   895 		symbianBitmap->format = (TDisplayMode)format;
   896 		symbianBitmap->width = width;
   896 		symbianBitmap->width = width;
  1253             ret = eglCopyBuffers();
  1253             ret = eglCopyBuffers();
  1254             break;
  1254             break;
  1255         }
  1255         }
  1256         case EglRFC::EeglSimulatorSetSurfaceParams:
  1256         case EglRFC::EeglSimulatorSetSurfaceParams:
  1257         {
  1257         {
  1258             ret = eglPlatsimSetSurfaceParams();
  1258             ret = eglSimulatorSetSurfaceParams();
  1259             break;
  1259             break;
  1260         }
  1260         }
  1261 		case EglRFC::EeglSimulatorCopyImageData:
  1261 		case EglRFC::EeglSimulatorCopyImageData:
  1262         {
  1262         {
  1263             ret = eglPlatsimCopyImageData();
  1263             ret = eglSimulatorCopyImageData();
  1264             break;
  1264             break;
  1265         }
  1265         }
  1266 		case EglRFC::EeglPixmapSurfaceSizeChanged:
  1266 		case EglRFC::EeglPixmapSurfaceSizeChanged:
  1267         {
  1267         {
  1268             ret = eglPixmapSurfaceSizeChanged();
  1268             ret = eglPixmapSurfaceSizeChanged();