guestrendering/vghwserialiser/src/opengles11rfc.cpp
branchbug235_bringup_0
changeset 51 4f400a6ea71f
parent 49 3b4f7e9d873f
child 52 39e5f73667ba
equal deleted inserted replaced
49:3b4f7e9d873f 51:4f400a6ea71f
     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 #include "opengles11rfc.h"
       
    17 #include "serialisedapiuids.h"
       
    18 
       
    19 OpenGlES11RFC::OpenGlES11RFC( RemoteFunctionCallData& aData ):
       
    20     RemoteFunctionCall( aData )
       
    21     {    
       
    22     }
       
    23 
       
    24 TUint32 OpenGlES11RFC::GetAPIUid() const
       
    25 {
       
    26 	return SERIALISED_OPENGLES_1_1_API_UID;
       
    27 }
       
    28 
       
    29 TInt OpenGlES11RFC::GetTypeAlignment( TInt32 aType ) const
       
    30 {
       
    31     TInt ret(0);
       
    32     if ( EGLvoid == aType )
       
    33         {
       
    34         ret = 4;
       
    35         }
       
    36     else
       
    37         {
       
    38         ret = GetTypeSize( aType );
       
    39         }
       
    40     return ret;
       
    41 }
       
    42 
       
    43 TInt OpenGlES11RFC::GetTypeSize( TInt32 aType ) const
       
    44 {
       
    45     TInt size(0);
       
    46     switch ( aType )
       
    47     {
       
    48     case EGLvoid:
       
    49     case EGLubyte:
       
    50     case EGLboolean:
       
    51         size = 1;
       
    52         break;
       
    53     case EGLshort:
       
    54         size = 2;
       
    55         break;
       
    56     case EGLbitfield:
       
    57     case EGLclampf:
       
    58     case EGLclampx:
       
    59     case EGLenum:
       
    60     case EGLfixed:
       
    61     case EGLfloat:
       
    62     case EGLint:
       
    63     case EGLintptr:
       
    64     case EGLsizei:
       
    65     case EGLsizeiptr:
       
    66     case EGLuint:
       
    67         size = 4;
       
    68         break;
       
    69     default:
       
    70         break;
       
    71     }
       
    72     return size;
       
    73 }