本文整理汇总了C++中dri2_egl_display函数的典型用法代码示例。如果您正苦于以下问题:C++ dri2_egl_display函数的具体用法?C++ dri2_egl_display怎么用?C++ dri2_egl_display使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dri2_egl_display函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dri2_drm_authenticate
static int
dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
return drmAuthMagic(dri2_dpy->fd, id);
}
开发者ID:ashmew2,项目名称:kolibriosSVN,代码行数:7,代码来源:platform_drm.c
示例2: dri2_x11_swap_buffers_region
static EGLBoolean
dri2_x11_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *draw,
EGLint numRects, const EGLint *rects)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
EGLBoolean ret;
xcb_xfixes_region_t region;
xcb_rectangle_t rectangles[16];
if (numRects > (int)ARRAY_SIZE(rectangles))
return dri2_copy_region(drv, disp, draw, dri2_surf->region);
for (int i = 0; i < numRects; i++) {
rectangles[i].x = rects[i * 4];
rectangles[i].y = dri2_surf->base.Height - rects[i * 4 + 1] - rects[i * 4 + 3];
rectangles[i].width = rects[i * 4 + 2];
rectangles[i].height = rects[i * 4 + 3];
}
region = xcb_generate_id(dri2_dpy->conn);
xcb_xfixes_create_region(dri2_dpy->conn, region, numRects, rectangles);
ret = dri2_copy_region(drv, disp, draw, region);
xcb_xfixes_destroy_region(dri2_dpy->conn, region);
return ret;
}
开发者ID:FireBurn,项目名称:mesa,代码行数:28,代码来源:platform_x11.c
示例3: dri2_create_image_khr_pixmap
static _EGLImage *
dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct gbm_dri_bo *dri_bo = gbm_dri_bo((struct gbm_bo *) buffer);
struct dri2_egl_image *dri2_img;
dri2_img = malloc(sizeof *dri2_img);
if (!dri2_img) {
_eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
return NULL;
}
if (!_eglInitImage(&dri2_img->base, disp)) {
free(dri2_img);
return NULL;
}
dri2_img->dri_image = dri2_dpy->image->dupImage(dri_bo->image, dri2_img);
if (dri2_img->dri_image == NULL) {
free(dri2_img);
_eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
return NULL;
}
return &dri2_img->base;
}
开发者ID:ashmew2,项目名称:kolibriosSVN,代码行数:28,代码来源:platform_drm.c
示例4: droid_swap_buffers
static EGLBoolean
droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
_EGLContext *ctx;
if (dri2_surf->base.Type != EGL_WINDOW_BIT)
return EGL_TRUE;
if (dri2_drv->glFlush) {
ctx = _eglGetCurrentContext();
if (ctx && ctx->DrawSurface == &dri2_surf->base)
dri2_drv->glFlush();
}
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
if (dri2_surf->buffer)
droid_window_enqueue_buffer(dri2_surf);
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
return EGL_TRUE;
}
开发者ID:blckshrk,项目名称:Mesa,代码行数:26,代码来源:platform_android.c
示例5: dri2_destroy_surface
static EGLBoolean
dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
int i;
if (!_eglPutSurface(surf))
return EGL_TRUE;
(*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
if (dri2_surf->color_buffers[i].bo)
gbm_bo_destroy(dri2_surf->color_buffers[i].bo);
}
for (i = 0; i < __DRI_BUFFER_COUNT; i++) {
if (dri2_surf->dri_buffers[i])
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->dri_buffers[i]);
}
free(surf);
return EGL_TRUE;
}
开发者ID:ashmew2,项目名称:kolibriosSVN,代码行数:27,代码来源:platform_drm.c
示例6: dri2_get_buffers_with_format
static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
xcb_dri2_dri2_buffer_t *buffers;
xcb_dri2_get_buffers_with_format_reply_t *reply;
xcb_dri2_get_buffers_with_format_cookie_t cookie;
xcb_dri2_attach_format_t *format_attachments;
format_attachments = (xcb_dri2_attach_format_t *) attachments;
cookie = xcb_dri2_get_buffers_with_format_unchecked (dri2_dpy->conn,
dri2_surf->drawable,
count, count,
format_attachments);
reply = xcb_dri2_get_buffers_with_format_reply (dri2_dpy->conn,
cookie, NULL);
if (reply == NULL)
return NULL;
buffers = xcb_dri2_get_buffers_with_format_buffers (reply);
dri2_surf->base.Width = *width = reply->width;
dri2_surf->base.Height = *height = reply->height;
*out_count = reply->count;
dri2_process_buffers(dri2_surf, buffers, *out_count);
free(reply);
return dri2_surf->buffers;
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:35,代码来源:egl_dri2.c
示例7: dri2_copy_region
static EGLBoolean
dri2_copy_region(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *draw, xcb_xfixes_region_t region)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
enum xcb_dri2_attachment_t render_attachment;
xcb_dri2_copy_region_cookie_t cookie;
/* No-op for a pixmap or pbuffer surface */
if (draw->Type == EGL_PIXMAP_BIT || draw->Type == EGL_PBUFFER_BIT)
return EGL_TRUE;
dri2_dpy->flush->flush(dri2_surf->dri_drawable);
if (dri2_surf->have_fake_front)
render_attachment = XCB_DRI2_ATTACHMENT_BUFFER_FAKE_FRONT_LEFT;
else
render_attachment = XCB_DRI2_ATTACHMENT_BUFFER_BACK_LEFT;
cookie = xcb_dri2_copy_region_unchecked(dri2_dpy->conn,
dri2_surf->drawable,
region,
XCB_DRI2_ATTACHMENT_BUFFER_FRONT_LEFT,
render_attachment);
free(xcb_dri2_copy_region_reply(dri2_dpy->conn, cookie, NULL));
return EGL_TRUE;
}
开发者ID:FireBurn,项目名称:mesa,代码行数:29,代码来源:platform_x11.c
示例8: dri2_x11_destroy_surface
static EGLBoolean
dri2_x11_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
(void) drv;
dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
if (dri2_dpy->dri2) {
xcb_dri2_destroy_drawable (dri2_dpy->conn, dri2_surf->drawable);
} else {
assert(dri2_dpy->swrast);
swrastDestroyDrawable(dri2_dpy, dri2_surf);
}
if (surf->Type == EGL_PBUFFER_BIT)
xcb_free_pixmap (dri2_dpy->conn, dri2_surf->drawable);
dri2_fini_surface(surf);
free(surf);
return EGL_TRUE;
}
开发者ID:FireBurn,项目名称:mesa,代码行数:25,代码来源:platform_x11.c
示例9: dri2_x11_authenticate
static int
dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
return dri2_x11_do_authenticate(dri2_dpy, id);
}
开发者ID:FireBurn,项目名称:mesa,代码行数:7,代码来源:platform_x11.c
示例10: swrastGetImage
static void
swrastGetImage(__DRIdrawable * read,
int x, int y, int w, int h,
char *data, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
xcb_get_image_cookie_t cookie;
xcb_get_image_reply_t *reply;
xcb_generic_error_t *error;
cookie = xcb_get_image (dri2_dpy->conn, XCB_IMAGE_FORMAT_Z_PIXMAP,
dri2_surf->drawable, x, y, w, h, ~0);
reply = xcb_get_image_reply (dri2_dpy->conn, cookie, &error);
if (reply == NULL)
return;
if (error != NULL) {
_eglLog(_EGL_WARNING, "error in xcb_get_image");
free(error);
} else {
uint32_t bytes = xcb_get_image_data_length(reply);
uint8_t *idata = xcb_get_image_data(reply);
memcpy(data, idata, bytes);
}
free(reply);
}
开发者ID:FireBurn,项目名称:mesa,代码行数:28,代码来源:platform_x11.c
示例11: swrastPutImage
static void
swrastPutImage(__DRIdrawable * draw, int op,
int x, int y, int w, int h,
char *data, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
xcb_gcontext_t gc;
switch (op) {
case __DRI_SWRAST_IMAGE_OP_DRAW:
gc = dri2_surf->gc;
break;
case __DRI_SWRAST_IMAGE_OP_SWAP:
gc = dri2_surf->swapgc;
break;
default:
return;
}
xcb_put_image(dri2_dpy->conn, XCB_IMAGE_FORMAT_Z_PIXMAP, dri2_surf->drawable,
gc, w, h, x, y, 0, dri2_surf->depth,
w*h*dri2_surf->bytes_per_pixel, (const uint8_t *)data);
}
开发者ID:FireBurn,项目名称:mesa,代码行数:25,代码来源:platform_x11.c
示例12: x11_get_drawable_info
static bool
x11_get_drawable_info(__DRIdrawable * draw,
int *x, int *y, int *w, int *h,
void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
xcb_get_geometry_cookie_t cookie;
xcb_get_geometry_reply_t *reply;
xcb_generic_error_t *error;
bool ret;
cookie = xcb_get_geometry (dri2_dpy->conn, dri2_surf->drawable);
reply = xcb_get_geometry_reply (dri2_dpy->conn, cookie, &error);
if (reply == NULL)
return false;
if (error != NULL) {
ret = false;
_eglLog(_EGL_WARNING, "error in xcb_get_geometry");
free(error);
} else {
*x = reply->x;
*y = reply->y;
*w = reply->width;
*h = reply->height;
ret = true;
}
free(reply);
return ret;
}
开发者ID:FireBurn,项目名称:mesa,代码行数:32,代码来源:platform_x11.c
示例13: dri2_x11_copy_buffers
static EGLBoolean
dri2_x11_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
void *native_pixmap_target)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
xcb_gcontext_t gc;
xcb_pixmap_t target;
STATIC_ASSERT(sizeof(uintptr_t) == sizeof(native_pixmap_target));
target = (uintptr_t) native_pixmap_target;
(void) drv;
dri2_dpy->flush->flush(dri2_surf->dri_drawable);
gc = xcb_generate_id(dri2_dpy->conn);
xcb_create_gc(dri2_dpy->conn, gc, target, 0, NULL);
xcb_copy_area(dri2_dpy->conn,
dri2_surf->drawable,
target,
gc,
0, 0,
0, 0,
dri2_surf->base.Width,
dri2_surf->base.Height);
xcb_free_gc(dri2_dpy->conn, gc);
return EGL_TRUE;
}
开发者ID:FireBurn,项目名称:mesa,代码行数:30,代码来源:platform_x11.c
示例14: droid_create_surface
static _EGLSurface *
droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "droid_create_surface");
return NULL;
}
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surface;
if (type == EGL_WINDOW_BIT) {
int format;
if (!window || window->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
_eglError(EGL_BAD_NATIVE_WINDOW, "droid_create_surface");
goto cleanup_surface;
}
if (window->query(window, NATIVE_WINDOW_FORMAT, &format)) {
_eglError(EGL_BAD_NATIVE_WINDOW, "droid_create_surface");
goto cleanup_surface;
}
if (format != dri2_conf->base.NativeVisualID) {
_eglLog(_EGL_WARNING, "Native format mismatch: 0x%x != 0x%x",
format, dri2_conf->base.NativeVisualID);
}
window->query(window, NATIVE_WINDOW_WIDTH, &dri2_surf->base.Width);
window->query(window, NATIVE_WINDOW_HEIGHT, &dri2_surf->base.Height);
}
dri2_surf->dri_drawable =
(*dri2_dpy->dri2->createNewDrawable)(dri2_dpy->dri_screen,
dri2_conf->dri_double_config,
dri2_surf);
if (dri2_surf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
goto cleanup_surface;
}
if (window) {
window->common.incRef(&window->common);
dri2_surf->window = window;
}
return &dri2_surf->base;
cleanup_surface:
free(dri2_surf);
return NULL;
}
开发者ID:FASTCHIP,项目名称:kernel_3.4.67_lenovo_s939_mtk6592,代码行数:59,代码来源:platform_android.c
示例15: surfaceless_free_images
static void
surfaceless_free_images(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
if (dri2_surf->front) {
dri2_dpy->image->destroyImage(dri2_surf->front);
dri2_surf->front = NULL;
}
}
开发者ID:Kalamatee,项目名称:mesa,代码行数:11,代码来源:platform_surfaceless.c
示例16: dri2_x11_swap_interval
static EGLBoolean
dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint interval)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
if (dri2_dpy->swap_available)
xcb_dri2_swap_interval(dri2_dpy->conn, dri2_surf->drawable, interval);
return EGL_TRUE;
}
开发者ID:FireBurn,项目名称:mesa,代码行数:12,代码来源:platform_x11.c
示例17: dri2_create_surface
static _EGLSurface *
dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
struct gbm_dri_surface *surf;
(void) drv;
dri2_surf = malloc(sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "dri2_create_surface");
return NULL;
}
memset(dri2_surf, 0, sizeof *dri2_surf);
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surf;
switch (type) {
case EGL_WINDOW_BIT:
if (!window)
return NULL;
surf = gbm_dri_surface((struct gbm_surface *) window);
dri2_surf->gbm_surf = surf;
dri2_surf->base.Width = surf->base.width;
dri2_surf->base.Height = surf->base.height;
surf->dri_private = dri2_surf;
break;
default:
goto cleanup_surf;
}
dri2_surf->dri_drawable =
(*dri2_dpy->dri2->createNewDrawable) (dri2_dpy->dri_screen,
dri2_conf->dri_double_config,
dri2_surf->gbm_surf);
if (dri2_surf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
goto cleanup_surf;
}
return &dri2_surf->base;
cleanup_surf:
free(dri2_surf);
return NULL;
}
开发者ID:FASTCHIP,项目名称:kernel_3.4.67_lenovo_s939_mtk6592,代码行数:53,代码来源:platform_drm.c
示例18: dri2_swap_buffers_msc
static int64_t
dri2_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
int64_t msc, int64_t divisor, int64_t remainder)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
uint32_t msc_hi = msc >> 32;
uint32_t msc_lo = msc & 0xffffffff;
uint32_t divisor_hi = divisor >> 32;
uint32_t divisor_lo = divisor & 0xffffffff;
uint32_t remainder_hi = remainder >> 32;
uint32_t remainder_lo = remainder & 0xffffffff;
xcb_dri2_swap_buffers_cookie_t cookie;
xcb_dri2_swap_buffers_reply_t *reply;
int64_t swap_count = -1;
/* No-op for a pixmap or pbuffer surface */
if (draw->Type == EGL_PIXMAP_BIT || draw->Type == EGL_PBUFFER_BIT)
return 0;
if (draw->SwapBehavior == EGL_BUFFER_PRESERVED || !dri2_dpy->swap_available)
return dri2_copy_region(drv, disp, draw, dri2_surf->region) ? 0 : -1;
if (dri2_dpy->flush)
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
cookie = xcb_dri2_swap_buffers_unchecked(dri2_dpy->conn, dri2_surf->drawable,
msc_hi, msc_lo, divisor_hi, divisor_lo, remainder_hi, remainder_lo);
reply = xcb_dri2_swap_buffers_reply(dri2_dpy->conn, cookie, NULL);
if (reply) {
swap_count = (((int64_t)reply->swap_hi) << 32) | reply->swap_lo;
free(reply);
}
/* Since we aren't watching for the server's invalidate events like we're
* supposed to (due to XCB providing no mechanism for filtering the events
* the way xlib does), and SwapBuffers is a common cause of invalidate
* events, just shove one down to the driver, even though we haven't told
* the driver that we're the kind of loader that provides reliable
* invalidate events. This causes the driver to request buffers again at
* its next draw, so that we get the correct buffers if a pageflip
* happened. The driver should still be using the viewport hack to catch
* window resizes.
*/
if (dri2_dpy->flush &&
dri2_dpy->flush->base.version >= 3 && dri2_dpy->flush->invalidate)
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
return swap_count;
}
开发者ID:DirectFB,项目名称:mesa,代码行数:52,代码来源:platform_x11.c
示例19: surfaceless_add_configs_for_visuals
static EGLBoolean
surfaceless_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
unsigned int visuals[3][4] = {
{ 0xff0000, 0xff00, 0xff, 0xff000000 }, // ARGB8888
{ 0xff0000, 0xff00, 0xff, 0x0 }, // RGB888
{ 0xf800, 0x7e0, 0x1f, 0x0 }, // RGB565
};
int count, i, j;
unsigned int r, b, g, a;
count = 0;
for (i = 0; i < ARRAY_SIZE(visuals); i++) {
for (j = 0; dri2_dpy->driver_configs[j]; j++) {
const EGLint surface_type = EGL_PBUFFER_BIT;
struct dri2_egl_config *dri2_conf;
/* Determine driver supported masks */
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[j],
__DRI_ATTRIB_RED_MASK, &r);
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[j],
__DRI_ATTRIB_BLUE_MASK, &b);
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[j],
__DRI_ATTRIB_GREEN_MASK, &g);
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[j],
__DRI_ATTRIB_ALPHA_MASK, &a);
/* Compare with advertised visuals */
if (r ^ visuals[i][0] || g ^ visuals[i][1]
|| b ^ visuals[i][2] || a ^ visuals[i][3])
continue;
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
count + 1, surface_type, NULL, visuals[i]);
if (dri2_conf)
count++;
}
}
if (!count)
_eglLog(_EGL_DEBUG, "Can't create surfaceless visuals");
return (count != 0);
}
开发者ID:Kalamatee,项目名称:mesa,代码行数:49,代码来源:platform_surfaceless.c
示例20: dri2_surfaceless_create_surface
static _EGLSurface *
dri2_surfaceless_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
const __DRIconfig *config;
/* Make sure to calloc so all pointers
* are originally NULL.
*/
dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreatePbufferSurface");
return NULL;
}
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surface;
config = dri2_get_dri_config(dri2_conf, type,
dri2_surf->base.GLColorspace);
if (!config)
goto cleanup_surface;
dri2_surf->dri_drawable =
(*dri2_dpy->dri2->createNewDrawable)(dri2_dpy->dri_screen, config,
dri2_surf);
if (dri2_surf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
goto cleanup_surface;
}
if (conf->RedSize == 5)
dri2_surf->visual = __DRI_IMAGE_FORMAT_RGB565;
else if (conf->AlphaSize == 0)
dri2_surf->visual = __DRI_IMAGE_FORMAT_XRGB8888;
else
dri2_surf->visual = __DRI_IMAGE_FORMAT_ARGB8888;
return &dri2_surf->base;
cleanup_surface:
free(dri2_surf);
return NULL;
}
开发者ID:Kalamatee,项目名称:mesa,代码行数:49,代码来源:platform_surfaceless.c
注:本文中的dri2_egl_display函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论