hostsupport/hostegl/inc/EGLPbufferSurface.h
branchbug235_bringup_0
changeset 53 c2ef9095503a
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 _EGLPBUFFERSURFACE_H_
       
    32 #define _EGLPBUFFERSURFACE_H_
       
    33 
       
    34 #include "EGLSurface.h"
       
    35 
       
    36 class CEGLPbufferSurface : public CEGLSurface
       
    37 {
       
    38 public:
       
    39     CEGLPbufferSurface( EGLint colorSpace,
       
    40                         EGLint alphaFormat,
       
    41                         EGLint renderBuffer,
       
    42                         CEGLConfig* config,
       
    43                         EGLint largestPbuffer,
       
    44                         EGLint textureFormat,
       
    45 						EGLint textureTarget,
       
    46 						EGLint mipmapTexture,
       
    47                         EGLClientBuffer clientBuf = NULL );
       
    48 	~CEGLPbufferSurface(void);
       
    49 
       
    50 public:
       
    51     inline EGLint IsLargestPbuffer() const { return m_largestPbuffer; }
       
    52     inline EGLint TextureFormat() const { return m_textureFormat; }
       
    53 	inline EGLint TextureTarget() const { return m_textureTarget; }
       
    54 	inline EGLint MipmapTexture() const { return m_mipmapTexture; }
       
    55     inline EGLClientBuffer ClientBuffer() const { return m_clientBuffer; }
       
    56 
       
    57     void SetNativePbufferContainer( EGLINativePbufferContainer* container );
       
    58     inline EGLINativePbufferType NativePbuffer() const { return (m_container ? m_container->pbuffer : NULL); }
       
    59     inline EGLINativeContextType CopyContext() const { return (m_container ? m_container->copyContext : NULL); }
       
    60     inline EGLINativeDisplayType NativeDisplay() const { return (m_container ? m_container->display : NULL); }
       
    61     inline struct EGLINativeGLFunctions* NativeGLFunctions() const { if( m_container ) return &(m_container->functions); else return NULL; }
       
    62 
       
    63     bool BindCopyContext();
       
    64     bool ReleaseCopyContext();
       
    65 
       
    66 private:
       
    67     CEGLPbufferSurface(void);
       
    68 
       
    69 private:
       
    70     EGLint                              m_largestPbuffer;
       
    71     EGLint                              m_textureFormat;
       
    72 	EGLint                              m_textureTarget;
       
    73 	EGLint								m_mipmapTexture;
       
    74     EGLClientBuffer                     m_clientBuffer;
       
    75     struct EGLINativePbufferContainer*  m_container;
       
    76     EGLINativeContextType               m_tmpContext;
       
    77     EGLINativeDisplayType               m_tmpDisplay;
       
    78 };
       
    79 #endif //_EGLPBUFFERSURFACE_H_