hostsupport/hostegl/inc/EGLImage.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 _EGLIMAGE_H_
       
    32 #define _EGLIMAGE_H_
       
    33 
       
    34 #include <EGL/egl.h>
       
    35 #include <vector>
       
    36 #include "SurfaceDescriptor.h"
       
    37 
       
    38 // Forward declarations
       
    39 class CEGLState;
       
    40 
       
    41 class CEGLImage
       
    42 {
       
    43 public:
       
    44     CEGLImage( EGLenum target, EGLClientBuffer buffer, SurfaceDescriptor desc, void* data );
       
    45     virtual ~CEGLImage(void);
       
    46     inline EGLenum Target() const { return m_target; }
       
    47     EGLClientBuffer ClientBuffer() const { return m_buffer; }
       
    48     inline EGLint DataStride() const { return m_SurfDesc.m_stride; }
       
    49     inline EGLint Height() const { return m_SurfDesc.m_height; }
       
    50     inline EGLint Width() const { return m_SurfDesc.m_width; }
       
    51     inline EGLint DataSize() const { return (m_SurfDesc.m_height * m_SurfDesc.m_stride); }
       
    52 	inline const SurfaceDescriptor& SurfaceDesc() const { return m_SurfDesc; }
       
    53     inline void* Data() const { return m_data; }
       
    54     void AddSibling( EGLenum target, EGLClientBuffer buffer);
       
    55     void UpdateData( CEGLState *state, void* data );
       
    56     void DestroyAllSiblings();
       
    57 
       
    58 
       
    59 public:
       
    60     struct EGLImageSibling
       
    61         {
       
    62         EGLenum target;
       
    63         EGLClientBuffer buffer;
       
    64         EGLImageSibling* next;
       
    65         };
       
    66     
       
    67 private:
       
    68     
       
    69     EGLenum m_target;
       
    70     EGLClientBuffer m_buffer;
       
    71     void* m_data;
       
    72     SurfaceDescriptor m_SurfDesc;
       
    73     EGLImageSibling* m_siblings;
       
    74     
       
    75 };
       
    76 #endif // _EGLIMAGE_H_