vghwinterface/vghwserialiser/src/eglrfc.cpp
branchbug235_bringup_0
changeset 51 4f400a6ea71f
parent 1 d8d95053303a
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 #include "eglrfc.h"
       
    16 #include "serialisedapiuids.h"
       
    17 
       
    18 // -----------------------------------------------------------------------------
       
    19 // 
       
    20 // -----------------------------------------------------------------------------
       
    21 //
       
    22 EglRFC::EglRFC( RemoteFunctionCallData& aData ):
       
    23     RemoteFunctionCall( aData )
       
    24     {
       
    25     }
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // 
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 TUint32 EglRFC::GetAPIUid() const
       
    32     {
       
    33 	return SERIALISED_EGL_API_UID;
       
    34     }
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // 
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 TInt EglRFC::GetTypeAlignment( TInt32 aType ) const
       
    41     {
       
    42     TInt ret(0);
       
    43     if ( EEGLVoid == aType )
       
    44         {
       
    45         ret = 4;
       
    46         }
       
    47     else
       
    48         {
       
    49         ret = GetTypeSize( aType );
       
    50         }
       
    51     return ret;
       
    52     }
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // 
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 TInt EglRFC::GetTypeSize( TInt32 aType ) const
       
    59     {
       
    60 	TInt size(0);
       
    61 	switch ( aType )
       
    62         {
       
    63         case EEGLVoid:
       
    64             size = 1;
       
    65             break;
       
    66         case EEGLBoolean:
       
    67         case EEGLint:
       
    68         case EEGLenum:
       
    69         case EEGLDisplay:
       
    70         case EEGLConfig:
       
    71         case EEGLSurface:
       
    72         case EEGLContext:
       
    73         case EEGLClientBuffer:
       
    74         case EEGLImageKHR:
       
    75         case EEGLNativeDisplayType:
       
    76         case EEGLNativeWindowType:
       
    77         case EEGLNativePixmapType:
       
    78             size = 4;
       
    79             break;
       
    80         case ETUint64:
       
    81             size = 8;
       
    82             break;
       
    83         default:
       
    84             ASSERT( EFalse );
       
    85             break;
       
    86         }
       
    87 	return size;
       
    88     }
       
    89 
       
    90 EGLint EglRFC::MetaGetConfigAttribute( int aIndex )
       
    91         {
       
    92     static const EGLint attribs[] =
       
    93     {
       
    94         EGL_BUFFER_SIZE,
       
    95         EGL_RED_SIZE,
       
    96         EGL_GREEN_SIZE,
       
    97         EGL_BLUE_SIZE,
       
    98         EGL_LUMINANCE_SIZE,
       
    99         EGL_ALPHA_SIZE,
       
   100         EGL_ALPHA_MASK_SIZE,
       
   101         EGL_BIND_TO_TEXTURE_RGB,
       
   102         EGL_BIND_TO_TEXTURE_RGBA,
       
   103         EGL_COLOR_BUFFER_TYPE,
       
   104         EGL_CONFIG_CAVEAT,
       
   105         EGL_CONFIG_ID,
       
   106         EGL_CONFORMANT,
       
   107         EGL_DEPTH_SIZE,
       
   108         EGL_LEVEL,
       
   109         EGL_MATCH_NATIVE_PIXMAP,
       
   110         EGL_MAX_SWAP_INTERVAL,
       
   111         EGL_MIN_SWAP_INTERVAL,
       
   112         EGL_NATIVE_RENDERABLE,
       
   113         EGL_NATIVE_VISUAL_TYPE,
       
   114         EGL_RENDERABLE_TYPE,
       
   115         EGL_SAMPLE_BUFFERS,
       
   116         EGL_SAMPLES,
       
   117         EGL_STENCIL_SIZE,
       
   118         EGL_SURFACE_TYPE,
       
   119         EGL_TRANSPARENT_TYPE,
       
   120         EGL_TRANSPARENT_RED_VALUE,
       
   121         EGL_TRANSPARENT_GREEN_VALUE,
       
   122         EGL_TRANSPARENT_BLUE_VALUE
       
   123     };
       
   124     return attribs[aIndex];
       
   125         }
       
   126 EGLint EglRFC::MetaGetConfigAttributeSelCriteria( int aIndex )
       
   127     {
       
   128     static const EGLint attrib_selection_criteria[] =
       
   129     {
       
   130     EAtLeast,
       
   131     EAtLeast,
       
   132     EAtLeast,
       
   133     EAtLeast,
       
   134     EAtLeast,
       
   135     EAtLeast,
       
   136     EAtLeast,
       
   137     EExact,
       
   138     EExact,
       
   139     EExact,
       
   140     EExact,
       
   141     EExact,
       
   142     EMask,
       
   143     EAtLeast,
       
   144     EExact,
       
   145     ESpecial,
       
   146     EExact,
       
   147     EExact,
       
   148     EExact,
       
   149     EExact,
       
   150     EMask,
       
   151     EAtLeast,
       
   152     EAtLeast,
       
   153     EAtLeast,
       
   154     EMask,
       
   155     EExact,
       
   156     EExact,
       
   157     EExact,
       
   158     EExact
       
   159     };
       
   160     return attrib_selection_criteria[aIndex];
       
   161     }
       
   162 TInt EglRFC::MetaGetConfigAttributeCnt()
       
   163         {
       
   164     return 29;
       
   165         }