24
|
1 |
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#ifdef WIN32
|
|
17 |
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
|
18 |
#include <windows.h>
|
|
19 |
#endif
|
|
20 |
|
|
21 |
#include <stdio.h>
|
|
22 |
#include <stdlib.h>
|
|
23 |
#include <EGL/egl.h>
|
|
24 |
#include "serializedfunctioncall.h"
|
|
25 |
#include "remotefunctioncall.h"
|
|
26 |
#include "apiwrapper.h"
|
|
27 |
#include "graphicsvhwcallback.h" //callback interface Wrapper=>Virtual HW
|
|
28 |
#include "khronosapiwrapperdefs.h"
|
|
29 |
|
|
30 |
APIWrapper::~APIWrapper()
|
|
31 |
{
|
|
32 |
}
|
|
33 |
/*
|
|
34 |
void APIWrapper::SetCurrentRFC( RemoteFunctionCallData* currentFunctionCall )
|
|
35 |
{
|
|
36 |
m_currentFunctionCallData = currentFunctionCall;
|
|
37 |
}*/
|
|
38 |
|
|
39 |
APIWrapper::APIWrapper( RemoteFunctionCallData& currentFunctionCall,
|
|
40 |
APIWrapperStack* stack,
|
|
41 |
void* result,
|
|
42 |
MGraphicsVHWCallback* serviceIf):
|
|
43 |
m_currentFunctionCallData( currentFunctionCall ),
|
|
44 |
m_currentResult( result ),
|
|
45 |
iStack( stack ),
|
|
46 |
iServiceIf( serviceIf )
|
|
47 |
{
|
|
48 |
}
|
|
49 |
|
|
50 |
int APIWrapper::WriteReply()
|
|
51 |
{
|
|
52 |
int ret( 0 );
|
|
53 |
if ( RemoteFunctionCallData::EOpRequestWithReply == m_currentFunctionCallData.Header().iOpType )
|
|
54 |
{
|
|
55 |
TRACE("APIWrapper::WriteReply() retval finally:%d\n", m_currentFunctionCallData.Header().iReturnValue );
|
|
56 |
m_currentFunctionCallData.SetOperationType( RemoteFunctionCallData::EOpReply );
|
|
57 |
iServiceIf->LockOutputBuffer();
|
|
58 |
SerializedFunctionCall sfc( m_currentFunctionCallData );
|
|
59 |
ret = sfc.WriteToBuffer( (TUint8*)m_currentResult, VVI_PARAMETERS_OUTPUT_MEMORY_SIZE );
|
|
60 |
}
|
|
61 |
return ret;
|
|
62 |
}
|