hostsupport/hostegl/inc/EGLProcess.h
branchbug235_bringup_0
changeset 53 c2ef9095503a
child 67 ca7e6949bf7a
equal deleted inserted replaced
52:39e5f73667ba 53:c2ef9095503a
       
     1 /* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2  *
       
     3  * Permission is hereby granted, free of charge, to any person obtaining a
       
     4  * copy of this software and /or associated documentation files
       
     5  * (the "Materials "), to deal in the Materials without restriction,
       
     6  * including without limitation the rights to use, copy, modify, merge,
       
     7  * publish, distribute, sublicense, and/or sell copies of the Materials,
       
     8  * and to permit persons to whom the Materials are furnished to do so,
       
     9  * subject to the following conditions:
       
    10  *
       
    11  * The above copyright notice and this permission notice shall be included
       
    12  * in all copies or substantial portions of the Materials.
       
    13  *
       
    14  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
       
    15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
       
    16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
       
    17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
       
    18  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
       
    19  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
       
    20  * THE USE OR OTHER DEALINGS IN THE MATERIALS.
       
    21  *
       
    22  * Initial Contributors:
       
    23  * Nokia Corporation - initial contribution.
       
    24  *
       
    25  * Contributors:
       
    26  *
       
    27  * Description:
       
    28  *
       
    29  */
       
    30 
       
    31 #ifndef _EGLPROCESS_H_
       
    32 #define _EGLPROCESS_H_
       
    33 
       
    34 #include <vector>
       
    35 #include "eglInternal.h"
       
    36 
       
    37 class CEGLThread;
       
    38 class CEGLContext;
       
    39 class CEGLSurface;
       
    40 
       
    41 class CEGLProcess
       
    42 {
       
    43 public:
       
    44 	CEGLProcess( EGLint processId );
       
    45 	~CEGLProcess(void);
       
    46 
       
    47 public:
       
    48     inline EGLint Id() const { return m_id; }
       
    49     CEGLThread* AddThread( EGLI_THREAD_ID threadId, bool setCurrent, EGLint supportedApis );
       
    50     void RemoveThread( EGLI_THREAD_ID threadId );
       
    51     CEGLThread* HasThread( EGLI_THREAD_ID threadId ) const;
       
    52     inline EGLint ThreadCount() const { return m_threads.size(); }
       
    53     void SetCurrentThread( EGLI_THREAD_ID threadId );
       
    54     CEGLThread* CurrentThread() const;
       
    55     CEGLSurface* FindBoundSurface( CEGLContext* context, bool readSurface ) const;
       
    56 
       
    57 private:
       
    58     EGLint                      m_id;
       
    59     std::vector<CEGLThread*>    m_threads;
       
    60     CEGLThread*                 m_currentThread;
       
    61 };
       
    62 #endif //_EGLPROCESS_H_