102f4aeb0Sopenharmony_ciName 202f4aeb0Sopenharmony_ci 302f4aeb0Sopenharmony_ci HI_clientpixmap 402f4aeb0Sopenharmony_ci 502f4aeb0Sopenharmony_ciName Strings 602f4aeb0Sopenharmony_ci 702f4aeb0Sopenharmony_ci EGL_HI_clientpixmap 802f4aeb0Sopenharmony_ci 902f4aeb0Sopenharmony_ciContributors 1002f4aeb0Sopenharmony_ci 1102f4aeb0Sopenharmony_ci Guillaume Portier 1202f4aeb0Sopenharmony_ci 1302f4aeb0Sopenharmony_ciContacts 1402f4aeb0Sopenharmony_ci 1502f4aeb0Sopenharmony_ci HI support. (support_renderion 'at' hicorp.co.jp) 1602f4aeb0Sopenharmony_ci 1702f4aeb0Sopenharmony_ciStatus 1802f4aeb0Sopenharmony_ci 1902f4aeb0Sopenharmony_ci Shipping (Revision 3). 2002f4aeb0Sopenharmony_ci 2102f4aeb0Sopenharmony_ciVersion 2202f4aeb0Sopenharmony_ci 2302f4aeb0Sopenharmony_ci Last Modified Date: June 7, 2010 2402f4aeb0Sopenharmony_ci Revision 3 2502f4aeb0Sopenharmony_ci 2602f4aeb0Sopenharmony_ciNumber 2702f4aeb0Sopenharmony_ci 2802f4aeb0Sopenharmony_ci EGL Extension #24 2902f4aeb0Sopenharmony_ci 3002f4aeb0Sopenharmony_ciDependencies 3102f4aeb0Sopenharmony_ci 3202f4aeb0Sopenharmony_ci This extension is written against the wording of the EGL 1.4 3302f4aeb0Sopenharmony_ci Specification. 3402f4aeb0Sopenharmony_ci 3502f4aeb0Sopenharmony_ciOverview 3602f4aeb0Sopenharmony_ci 3702f4aeb0Sopenharmony_ci The extension specified in this document provide a mechanism for 3802f4aeb0Sopenharmony_ci using memory allocated by the application as a color-buffer. 3902f4aeb0Sopenharmony_ci 4002f4aeb0Sopenharmony_ci 4102f4aeb0Sopenharmony_ciNew Types 4202f4aeb0Sopenharmony_ci 4302f4aeb0Sopenharmony_ci EGLClientPixmapHI : specifies the width, height, stride, format 4402f4aeb0Sopenharmony_ci and memory pointer of the pixmap to be used by the function 4502f4aeb0Sopenharmony_ci eglCreatePixmapSurfaceHI to create the PixmapSurface. 4602f4aeb0Sopenharmony_ci 4702f4aeb0Sopenharmony_ci Members: 4802f4aeb0Sopenharmony_ci void* pData; 4902f4aeb0Sopenharmony_ci Pointer to a memory buffer allocated by the application 5002f4aeb0Sopenharmony_ci that will contain the result of the drawing operations. 5102f4aeb0Sopenharmony_ci It is up to the application to ensure that the buffer 5202f4aeb0Sopenharmony_ci size corresponds to iHeight * iStride * sizeof(pixel). 5302f4aeb0Sopenharmony_ci EGLint iWidth; 5402f4aeb0Sopenharmony_ci Width of the buffer in pixels. 5502f4aeb0Sopenharmony_ci EGLint iHeight; 5602f4aeb0Sopenharmony_ci Height of the buffer in pixels. The height of the buffer 5702f4aeb0Sopenharmony_ci can be negative; in that case the result of the 5802f4aeb0Sopenharmony_ci drawing operations will be vertically swapped. When 5902f4aeb0Sopenharmony_ci positive, pData will point at the bottom-left corner 6002f4aeb0Sopenharmony_ci of the image; when negative, to the top-left corner. 6102f4aeb0Sopenharmony_ci EGLint iStride; 6202f4aeb0Sopenharmony_ci Stride of the buffer, in pixels. It is important to note 6302f4aeb0Sopenharmony_ci that each row of the buffer must start on 32-bit 6402f4aeb0Sopenharmony_ci boundaries. 6502f4aeb0Sopenharmony_ci 6602f4aeb0Sopenharmony_ciNew Procedures and Functions 6702f4aeb0Sopenharmony_ci 6802f4aeb0Sopenharmony_ci eglCreatePixmapSurfaceHI : creates an EGL ClientPixmap from 6902f4aeb0Sopenharmony_ci an EGLClientPixmapHI structure. eglCreatePixmapSurfaceHI usage 7002f4aeb0Sopenharmony_ci is identical to eglCreatePixmapSurface. In addition the ordering 7102f4aeb0Sopenharmony_ci of the color components in the color buffer can be specified by 7202f4aeb0Sopenharmony_ci the surface attribute described in the EGL_HI_colorformats 7302f4aeb0Sopenharmony_ci extension. 7402f4aeb0Sopenharmony_ci 7502f4aeb0Sopenharmony_ci In order to update the pointer to the data of the surface, the application 7602f4aeb0Sopenharmony_ci can call eglSurfaceAttrib with the EGL_CLIENT_PIXMAP_POINTER_HI attribute. 7702f4aeb0Sopenharmony_ci See below for an example. 7802f4aeb0Sopenharmony_ci 7902f4aeb0Sopenharmony_ciNew Tokens 8002f4aeb0Sopenharmony_ci 8102f4aeb0Sopenharmony_ci None. 8202f4aeb0Sopenharmony_ci 8302f4aeb0Sopenharmony_ciExample 8402f4aeb0Sopenharmony_ci 8502f4aeb0Sopenharmony_ci 8602f4aeb0Sopenharmony_ci EGLClientPixmapHI pixmap; 8702f4aeb0Sopenharmony_ci EGLint attrib_list[] = { 8802f4aeb0Sopenharmony_ci EGL_RED_SIZE, 8, 8902f4aeb0Sopenharmony_ci EGL_GREEN_SIZE, 8, 9002f4aeb0Sopenharmony_ci EGL_BLUE_SIZE, 8, 9102f4aeb0Sopenharmony_ci EGL_ALPHA_SIZE, 8, 9202f4aeb0Sopenharmony_ci EGL_SURFACE_TYPE, EGL_PIXMAP_BIT, 9302f4aeb0Sopenharmony_ci // Specifying ARGB as a color format 9402f4aeb0Sopenharmony_ci EGL_COLOR_FORMAT_HI, EGL_COLOR_ARGB_HI, 9502f4aeb0Sopenharmony_ci EGL_NONE 9602f4aeb0Sopenharmony_ci }; 9702f4aeb0Sopenharmony_ci 9802f4aeb0Sopenharmony_ci // ‘access' being the memory to render into. 9902f4aeb0Sopenharmony_ci pixmap.pData = framebuffer.access; 10002f4aeb0Sopenharmony_ci pixmap.iWidht = framebuffer.width; 10102f4aeb0Sopenharmony_ci pixmap.iHeight = framebuffer.height; 10202f4aeb0Sopenharmony_ci pixmap.iStride = framebuffer.stride; 10302f4aeb0Sopenharmony_ci 10402f4aeb0Sopenharmony_ci 10502f4aeb0Sopenharmony_ci 10602f4aeb0Sopenharmony_ci //Get Config ARGB8 10702f4aeb0Sopenharmony_ci eglChooseConfig(dpy, attrib_list, &config, 1, &num_config); 10802f4aeb0Sopenharmony_ci 10902f4aeb0Sopenharmony_ci // Create the pixmap 11002f4aeb0Sopenharmony_ci #ifdef EGL_EGLEXT_PROTOTYPES 11102f4aeb0Sopenharmony_ci 11202f4aeb0Sopenharmony_ci eglCreatePixmapSurfaceHI(eglDisplay, ppkConfig[0], &gHiPixmap); 11302f4aeb0Sopenharmony_ci 11402f4aeb0Sopenharmony_ci #else 11502f4aeb0Sopenharmony_ci 11602f4aeb0Sopenharmony_ci pfCreatePixmap = (PFNEGLCREATEPIXMAPSURFACEHIPROC) 11702f4aeb0Sopenharmony_ci eglGetProcAddress("eglCreatePixmapSurfaceHI"); 11802f4aeb0Sopenharmony_ci pfCreatePixmap(eglDisplay, ppkConfig[0], &gHiPixmap); 11902f4aeb0Sopenharmony_ci 12002f4aeb0Sopenharmony_ci #endif /* EGL_EGLEXT_PROTOTYPES */ 12102f4aeb0Sopenharmony_ci 12202f4aeb0Sopenharmony_ci 12302f4aeb0Sopenharmony_ci // Update the surface data pointer, from now we will render into the 12402f4aeb0Sopenharmony_ci // memory pointed by 'access2'. 12502f4aeb0Sopenharmony_ci eglSurfaceAttrib(eglDisplay, eglSurface, EGL_CLIENT_PIXMAP_POINTER_HI, 12602f4aeb0Sopenharmony_ci offscreen.access2); 12702f4aeb0Sopenharmony_ci 12802f4aeb0Sopenharmony_ciIssues 12902f4aeb0Sopenharmony_ci 13002f4aeb0Sopenharmony_ci None 13102f4aeb0Sopenharmony_ci 13202f4aeb0Sopenharmony_ci 13302f4aeb0Sopenharmony_ciRevision History 13402f4aeb0Sopenharmony_ci 13502f4aeb0Sopenharmony_ci June 7, 2010 (r3) 13602f4aeb0Sopenharmony_ci - Allow updating the pixmap data pointer using eglSurfaceAttrib with 13702f4aeb0Sopenharmony_ci the EGL_CLIENT_PIXMAP_POINTER_HI attribute. 13802f4aeb0Sopenharmony_ci 13902f4aeb0Sopenharmony_ci June 16, 2009 (r2) 14002f4aeb0Sopenharmony_ci - Split HI_clientpixmap into two different extensions: 14102f4aeb0Sopenharmony_ci - HI_colorformats 14202f4aeb0Sopenharmony_ci - HI_clientpixmap 14302f4aeb0Sopenharmony_ci 14402f4aeb0Sopenharmony_ci March 3, 2009 (r1) 145