vghwinterface/vghwapiwrapper/src/apiwrapper.cpp
author Matt Plumtree <matt.plumtree@nokia.com>
Wed, 06 Oct 2010 17:59:01 +0100
branchbug235_bringup_0
changeset 53 c2ef9095503a
parent 24 holdingarea/serialization/Graphics/KhronosAPIWrapper/src/apiwrapper.cpp@a3f46bb01be2
permissions -rw-r--r--
Copy code from the holdingarea into the target locations. Some initial rework of CMakeLists.txt files, but not yet tested.

// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// 

#ifdef WIN32
#define WIN32_LEAN_AND_MEAN                       // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <EGL/egl.h>
#include "serializedfunctioncall.h"
#include "remotefunctioncall.h"
#include "apiwrapper.h"
#include "graphicsvhwcallback.h"        //callback interface Wrapper=>Virtual HW
#include "khronosapiwrapperdefs.h"

APIWrapper::~APIWrapper()
{
}
/*
void APIWrapper::SetCurrentRFC( RemoteFunctionCallData* currentFunctionCall )
{
	m_currentFunctionCallData = currentFunctionCall;
}*/

APIWrapper::APIWrapper( RemoteFunctionCallData& currentFunctionCall, 
	APIWrapperStack* stack,
    void* result,
	MGraphicsVHWCallback* serviceIf):
m_currentFunctionCallData( currentFunctionCall ),
m_currentResult( result ),
iStack( stack ),
iServiceIf( serviceIf )
{
}

int APIWrapper::WriteReply()
{
	int ret( 0 );
	if ( RemoteFunctionCallData::EOpRequestWithReply == m_currentFunctionCallData.Header().iOpType )
	{
		TRACE("APIWrapper::WriteReply() retval finally:%d\n", m_currentFunctionCallData.Header().iReturnValue );
		m_currentFunctionCallData.SetOperationType( RemoteFunctionCallData::EOpReply );
		iServiceIf->LockOutputBuffer();
		SerializedFunctionCall sfc( m_currentFunctionCallData );
		ret = sfc.WriteToBuffer( (TUint8*)m_currentResult, VVI_PARAMETERS_OUTPUT_MEMORY_SIZE );
	}
	return ret;
}