• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    HI_clientpixmap
4
5Name Strings
6
7    EGL_HI_clientpixmap
8
9Contributors
10
11    Guillaume Portier
12
13Contacts
14
15    HI support. (support_renderion 'at' hicorp.co.jp)
16
17Status
18
19    Shipping (Revision 3).
20
21Version
22
23    Last Modified Date: June 7, 2010
24    Revision 3
25
26Number
27
28    EGL Extension #24
29
30Dependencies
31
32    This extension is written against the wording of the EGL 1.4
33    Specification.
34
35Overview
36
37    The extension specified in this document provide a mechanism for
38    using memory allocated by the application as a color-buffer.
39
40
41New Types
42
43    EGLClientPixmapHI : specifies the width, height, stride, format
44    and memory pointer of the pixmap to be used by the function
45    eglCreatePixmapSurfaceHI to create the PixmapSurface.
46
47    Members:
48        void*		pData;
49             Pointer to a memory buffer allocated by the application
50             that will contain the result of the drawing operations.
51             It is up to the application to ensure that the buffer
52             size corresponds to iHeight * iStride * sizeof(pixel).
53        EGLint		iWidth;
54             Width of the buffer in pixels.
55        EGLint		iHeight;
56             Height of the buffer in pixels. The height of the buffer
57             can be negative; in that case the result of the
58             drawing operations will be vertically swapped. When
59			 positive, pData will point at the bottom-left corner
60             of the image; when negative, to the top-left corner.
61        EGLint		iStride;
62	         Stride of the buffer, in pixels. It is important to note
63             that each row of the buffer must start on 32-bit
64             boundaries.
65
66New Procedures and Functions
67
68    eglCreatePixmapSurfaceHI : creates an EGL ClientPixmap from
69    an EGLClientPixmapHI structure. eglCreatePixmapSurfaceHI usage
70    is identical to eglCreatePixmapSurface. In addition the ordering
71    of the color components in the color buffer can be specified by
72    the surface attribute described in the EGL_HI_colorformats
73    extension.
74
75    In order to update the pointer to the data of the surface, the application
76    can call eglSurfaceAttrib with the EGL_CLIENT_PIXMAP_POINTER_HI attribute.
77    See below for an example.
78
79New Tokens
80
81    None.
82
83Example
84
85
86    EGLClientPixmapHI pixmap;
87    EGLint attrib_list[] = {
88        EGL_RED_SIZE, 8,
89        EGL_GREEN_SIZE, 8,
90        EGL_BLUE_SIZE, 8,
91        EGL_ALPHA_SIZE, 8,
92        EGL_SURFACE_TYPE, EGL_PIXMAP_BIT,
93        // Specifying ARGB as a color format
94        EGL_COLOR_FORMAT_HI, EGL_COLOR_ARGB_HI,
95        EGL_NONE
96    };
97
98    // ‘access' being the memory to render into.
99    pixmap.pData = framebuffer.access;
100    pixmap.iWidht = framebuffer.width;
101    pixmap.iHeight = framebuffer.height;
102    pixmap.iStride = framebuffer.stride;
103
104
105
106    //Get Config ARGB8
107    eglChooseConfig(dpy, attrib_list, &config, 1, &num_config);
108
109    // Create the pixmap
110    #ifdef EGL_EGLEXT_PROTOTYPES
111
112    eglCreatePixmapSurfaceHI(eglDisplay, ppkConfig[0],  &gHiPixmap);
113
114    #else
115
116    pfCreatePixmap = (PFNEGLCREATEPIXMAPSURFACEHIPROC)
117                         eglGetProcAddress("eglCreatePixmapSurfaceHI");
118    pfCreatePixmap(eglDisplay, ppkConfig[0], &gHiPixmap);
119
120    #endif /* EGL_EGLEXT_PROTOTYPES */
121
122
123    // Update the surface data pointer, from now we will render into the
124    // memory pointed by 'access2'.
125    eglSurfaceAttrib(eglDisplay, eglSurface, EGL_CLIENT_PIXMAP_POINTER_HI,
126                     offscreen.access2);
127
128Issues
129
130    None
131
132
133Revision History
134
135    June 7, 2010 (r3)
136        - Allow updating the pixmap data pointer using eglSurfaceAttrib with
137          the EGL_CLIENT_PIXMAP_POINTER_HI attribute.
138
139    June 16, 2009 (r2)
140        - Split HI_clientpixmap into two different extensions:
141          - HI_colorformats
142          - HI_clientpixmap
143
144    March 3, 2009 (r1)
145