guestrendering/vghwserialiser/src/openvgrfc.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 "openvgrfc.h"
       
    17 #include "serialisedapiuids.h"
       
    18 
       
    19 // -----------------------------------------------------------------------------
       
    20 // 
       
    21 // -----------------------------------------------------------------------------
       
    22 //
       
    23 OpenVgRFC::OpenVgRFC( RemoteFunctionCallData& aData ):
       
    24     RemoteFunctionCall( aData )
       
    25     {    
       
    26     }
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 // 
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 TUint32 OpenVgRFC::GetAPIUid() const
       
    33     {
       
    34 	return SERIALISED_OPENVG_API_UID;
       
    35     }
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // 
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 TInt OpenVgRFC::GetTypeAlignment( TInt32 aType ) const
       
    42     {
       
    43     TInt ret(0);
       
    44     if ( EVGvoid == aType )
       
    45         {
       
    46         ret = 4;
       
    47         }
       
    48     else
       
    49         {
       
    50         ret = GetTypeSize( aType );
       
    51         }
       
    52     return ret;
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // 
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 TInt OpenVgRFC::GetTypeSize( TInt32 aType ) const
       
    60     {
       
    61 	TInt size(0);
       
    62 	switch ( aType )
       
    63         {
       
    64         case EVGvoid:
       
    65         case EVGbyte:
       
    66         case EVGubyte:
       
    67             size = 1;
       
    68             break;
       
    69         case EVGshort:
       
    70             size = 2;
       
    71             break;
       
    72         case EVGfloat:
       
    73         case EVGint:
       
    74         case EVGuint:
       
    75         case EVGbitfield:
       
    76         case EVGboolean:
       
    77         case EVGHandle:
       
    78         case EVGErrorCode:
       
    79         case EVGParamType:
       
    80         case EVGRenderingQuality:
       
    81         case EVGPixelLayout:
       
    82         case EVGMatrixMode:
       
    83         case EVGMaskOperation:
       
    84         case EVGPathDatatype:
       
    85         case EVGPathAbsRel:
       
    86         case EVGPathSegment:
       
    87         case EVGPathCommand:
       
    88         case EVGPath:
       
    89         case EVGPathCapabilities:
       
    90         case EVGPathParamType:
       
    91         case EVGCapStyle:
       
    92         case EVGJoinStyle:
       
    93         case EVGFillRule:
       
    94         case EVGPaintMode:
       
    95         case EVGPaint:
       
    96         case EVGPaintParamType:
       
    97         case EVGPaintType:
       
    98         case EVGColorRampSpreadMode:
       
    99         case EVGTilingMode:
       
   100         case EVGImageFormat:
       
   101         case EVGImage:
       
   102         case EVGImageQuality:
       
   103         case EVGImageParamType:
       
   104         case EVGImageMode:
       
   105         case EVGImageChannel:
       
   106         case EVGBlendMode:
       
   107         case EVGHardwareQueryType:
       
   108         case EVGHardwareQueryResult:
       
   109         case EVGStringID:
       
   110         case EVGeglImageKHR:
       
   111             size = 4;
       
   112             break;
       
   113         case ETUint64:
       
   114             size = 8;
       
   115             break;
       
   116         default:
       
   117             break;
       
   118         }
       
   119 	return size;
       
   120     }