hostsupport/hostegl/inc/EGLDisplay.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 _EGLDISPLAY_H_
       
    32 #define _EGLDISPLAY_H_
       
    33 
       
    34 #include <EGL/egl.h>
       
    35 #include <EGL/eglext.h>
       
    36 #include "eglInternal.h"
       
    37 #include "EGLSurface.h"
       
    38 
       
    39 
       
    40 //FORWARD DECLARATIONS
       
    41 class CEGLConfig;
       
    42 class CEGLContext;
       
    43 class CEGLImage;
       
    44 
       
    45 class CEGLDisplay : public RefCountingObject
       
    46 {
       
    47 public:
       
    48 	CEGLDisplay( EGLINativeDisplayType nativeType, EGLint processId );
       
    49 	~CEGLDisplay(void);
       
    50 
       
    51 public:
       
    52     CEGLContext* AddContext( CEGLContext* context );
       
    53     void RemoveContext( EGLContext context );
       
    54     CEGLContext* GetContext( EGLContext context ) const;
       
    55 
       
    56     CEGLSurface* AddSurface( CEGLSurface* surface );
       
    57     void RemoveSurface( EGLSurface surfaceId );
       
    58     CEGLSurface* GetSurface( EGLSurface surfaceId ) const;
       
    59     CEGLSurface* GetSurfaceByNativeType( EGLINativeWindowType nativeType ) const;
       
    60     CEGLSurface* FindSurfaceByClientSurface( void* clientSurface, EGLenum api, EGLint apiVersion  ) const;
       
    61     CEGLSurface* FindSurfaceByClientBuffer( void* clientBuffer ) const;
       
    62 
       
    63     inline EGLint ProcessId() const { return m_processId; }
       
    64 
       
    65     EGLINativeDisplayType NativeType() const;
       
    66 
       
    67     EGLBoolean Initialize();
       
    68     bool TerminateDisplay();
       
    69     inline EGLBoolean IsInitialized() const { return m_initialized; }
       
    70     CEGLImage* AddEGLImage( CEGLImage* image );
       
    71     void RemoveEGLImage( EGLImageKHR image );
       
    72     CEGLImage* GetImage( EGLImageKHR image ) const;
       
    73 
       
    74 private:
       
    75     EGLINativeDisplayType       m_nativeType;
       
    76     EGLBoolean                  m_initialized;
       
    77     std::vector<CEGLContext*>   m_contexts;
       
    78     std::vector<CEGLSurface*>   m_surfaces;
       
    79     std::vector<CEGLImage*>     m_images;
       
    80     EGLint                      m_processId;
       
    81 };
       
    82 #endif //_EGLDISPLAY_H_