* incomplete, EGL_BAD_PARAMETER is generated."
*/
if (attrs->Width <= 0 || attrs->Height <= 0 ||
- !attrs->DMABufFourCC.IsPresent) {
- _eglError(EGL_BAD_PARAMETER, "attribute(s) missing");
- return EGL_FALSE;
- }
+ !attrs->DMABufFourCC.IsPresent)
+ return _eglError(EGL_BAD_PARAMETER, "attribute(s) missing");
/**
* Also:
*/
for (unsigned i = 0; i < ARRAY_SIZE(attrs->DMABufPlanePitches); ++i) {
if (attrs->DMABufPlanePitches[i].IsPresent &&
- attrs->DMABufPlanePitches[i].Value <= 0) {
- _eglError(EGL_BAD_ACCESS, "invalid pitch");
- return EGL_FALSE;
- }
+ attrs->DMABufPlanePitches[i].Value <= 0)
+ return _eglError(EGL_BAD_ACCESS, "invalid pitch");
}
/**
*/
for (unsigned i = 0; i < DMA_BUF_MAX_PLANES; ++i) {
if (attrs->DMABufPlaneModifiersLo[i].IsPresent !=
- attrs->DMABufPlaneModifiersHi[i].IsPresent) {
- _eglError(EGL_BAD_PARAMETER, "modifier attribute lo or hi missing");
- return EGL_FALSE;
- }
+ attrs->DMABufPlaneModifiersHi[i].IsPresent)
+ return _eglError(EGL_BAD_PARAMETER, "modifier attribute lo or hi missing");
}
/* Although the EGL_EXT_image_dma_buf_import_modifiers spec doesn't
(attrs->DMABufPlaneModifiersLo[0].Value !=
attrs->DMABufPlaneModifiersLo[i].Value) ||
(attrs->DMABufPlaneModifiersHi[0].Value !=
- attrs->DMABufPlaneModifiersHi[i].Value)) {
- _eglError(EGL_BAD_PARAMETER, "modifier attributes not equal");
- return EGL_FALSE;
- }
+ attrs->DMABufPlaneModifiersHi[i].Value))
+ return _eglError(EGL_BAD_PARAMETER, "modifier attributes not equal");
}
}
EGLint max, EGLint *formats, EGLint *count)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
- if (max < 0 || (max > 0 && formats == NULL)) {
- _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
- return EGL_FALSE;
- }
+ if (max < 0 || (max > 0 && formats == NULL))
+ return _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
if (dri2_dpy->image->base.version < 15 ||
dri2_dpy->image->queryDmaBufFormats == NULL)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
- if (max < 0) {
- _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
- return EGL_FALSE;
- }
+ if (max < 0)
+ return _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
- if (max > 0 && modifiers == NULL) {
- _eglError(EGL_BAD_PARAMETER, "invalid modifiers array");
- return EGL_FALSE;
- }
+ if (max > 0 && modifiers == NULL)
+ return _eglError(EGL_BAD_PARAMETER, "invalid modifiers array");
if (dri2_dpy->image->base.version < 15 ||
dri2_dpy->image->queryDmaBufModifiers == NULL)
if (dri2_dpy->image->queryDmaBufModifiers(dri2_dpy->dri_screen, format,
max, modifiers,
(unsigned int *) external_only,
- count) == false) {
- _eglError(EGL_BAD_PARAMETER, "invalid format");
- return EGL_FALSE;
- }
+ count) == false)
+ return _eglError(EGL_BAD_PARAMETER, "invalid format");
return EGL_TRUE;
}
(void) drv;
if (name && !dri2_dpy->image->queryImage(dri2_img->dri_image,
- __DRI_IMAGE_ATTRIB_NAME, name)) {
- _eglError(EGL_BAD_ALLOC, "dri2_export_drm_image_mesa");
- return EGL_FALSE;
- }
+ __DRI_IMAGE_ATTRIB_NAME, name))
+ return _eglError(EGL_BAD_ALLOC, "dri2_export_drm_image_mesa");
if (handle)
dri2_dpy->image->queryImage(dri2_img->dri_image,
struct dri2_egl_sync *dri2_sync = dri2_egl_sync(sync);
EGLint ret;
- if (sync->Type != EGL_SYNC_REUSABLE_KHR) {
- _eglError(EGL_BAD_MATCH, "eglSignalSyncKHR");
- return EGL_FALSE;
- }
+ if (sync->Type != EGL_SYNC_REUSABLE_KHR)
+ return _eglError(EGL_BAD_MATCH, "eglSignalSyncKHR");
- if (mode != EGL_SIGNALED_KHR && mode != EGL_UNSIGNALED_KHR) {
- _eglError(EGL_BAD_ATTRIBUTE, "eglSignalSyncKHR");
- return EGL_FALSE;
- }
+ if (mode != EGL_SIGNALED_KHR && mode != EGL_UNSIGNALED_KHR)
+ return _eglError(EGL_BAD_ATTRIBUTE, "eglSignalSyncKHR");
dri2_sync->base.SyncStatus = mode;
ret = cnd_broadcast(&dri2_sync->cond);
/* fail to broadcast */
- if (ret) {
- _eglError(EGL_BAD_ACCESS, "eglSignalSyncKHR");
- return EGL_FALSE;
- }
+ if (ret)
+ return _eglError(EGL_BAD_ACCESS, "eglSignalSyncKHR");
}
return EGL_TRUE;
return EGL_TRUE;
droid_rects = malloc(n_rects * sizeof(android_native_rect_t));
- if (droid_rects == NULL) {
- _eglError(EGL_BAD_ALLOC, "eglSetDamageRegionKHR");
- return EGL_FALSE;
- }
+ if (droid_rects == NULL)
+ return _eglError(EGL_BAD_ALLOC, "eglSetDamageRegionKHR");
for (EGLint num_drects = 0; num_drects < n_rects; num_drects++) {
EGLint i = num_drects * 4;
/* Make sure we have a back buffer in case we're swapping without
* ever rendering. */
- if (get_back_bo(dri2_surf) < 0) {
- _eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
- return EGL_FALSE;
- }
+ if (get_back_bo(dri2_surf) < 0)
+ return _eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
dri2_surf->current = dri2_surf->back;
dri2_surf->current->age = 1;
/* Make sure we have a back buffer in case we're swapping without ever
* rendering. */
- if (get_back_bo(dri2_surf) < 0) {
- _eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
- return EGL_FALSE;
- }
+ if (get_back_bo(dri2_surf) < 0)
+ return _eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
if (draw->SwapInterval > 0) {
dri2_surf->throttle_callback =
if (dri2_x11_swap_buffers_msc(drv, disp, draw, 0, 0, 0) == -1) {
/* Swap failed with a window drawable. */
- _eglError(EGL_BAD_NATIVE_WINDOW, __func__);
- return EGL_FALSE;
+ return _eglError(EGL_BAD_NATIVE_WINDOW, __func__);
}
return EGL_TRUE;
}
cookie = xcb_dri2_get_msc(dri2_dpy->conn, dri2_surf->drawable);
reply = xcb_dri2_get_msc_reply(dri2_dpy->conn, cookie, NULL);
- if (!reply) {
- _eglError(EGL_BAD_ACCESS, __func__);
- return EGL_FALSE;
- }
+ if (!reply)
+ return _eglError(EGL_BAD_ACCESS, __func__);
*ust = ((EGLuint64KHR) reply->ust_hi << 32) | reply->ust_lo;
*msc = ((EGLuint64KHR) reply->msc_hi << 32) | reply->msc_lo;
struct haiku_egl_config* conf;
conf = (struct haiku_egl_config*) calloc(1, sizeof (*conf));
- if (!conf) {
- _eglError(EGL_BAD_ALLOC, "haiku_add_configs_for_visuals");
- return EGL_FALSE;
- }
+ if (!conf)
+ return _eglError(EGL_BAD_ALLOC, "haiku_add_configs_for_visuals");
_eglInitConfig(&conf->base, dpy, 1);
TRACE("Config inited\n");
const EGLenum api = eglQueryAPI();
EGLint err;
- if (api == EGL_NONE) {
- _eglError(EGL_BAD_MATCH, "eglCreateContext(no client API)");
- return EGL_FALSE;
- }
+ if (api == EGL_NONE)
+ return _eglError(EGL_BAD_MATCH, "eglCreateContext(no client API)");
_eglInitResource(&ctx->Resource, sizeof(*ctx), dpy);
ctx->ClientAPI = api;
/* EGL_EXT_platform_x11 recognizes exactly one attribute,
* EGL_PLATFORM_X11_SCREEN_EXT, which is optional.
*/
- if (attrib == EGL_PLATFORM_X11_SCREEN_EXT) {
- display->Options.Platform = (void *)(uintptr_t)value;
- } else {
- _eglError(EGL_BAD_ATTRIBUTE, "eglGetPlatformDisplay");
- return EGL_FALSE;
- }
+ if (attrib != EGL_PLATFORM_X11_SCREEN_EXT)
+ return _eglError(EGL_BAD_ATTRIBUTE, "eglGetPlatformDisplay");
+
+ display->Options.Platform = (void *)(uintptr_t)value;
}
return EGL_TRUE;
return EGL_FALSE;
}
- if ((conf->SurfaceType & type) == 0) {
+ if ((conf->SurfaceType & type) == 0)
/* The config can't be used to create a surface of this type */
- _eglError(EGL_BAD_MATCH, func);
- return EGL_FALSE;
- }
+ return _eglError(EGL_BAD_MATCH, func);
_eglInitResource(&surf->Resource, sizeof(*surf), dpy);
surf->Type = type;
*value = surface->VGColorspace;
break;
case EGL_GL_COLORSPACE_KHR:
- if (!dpy->Extensions.KHR_gl_colorspace) {
- _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
- return EGL_FALSE;
- }
+ if (!dpy->Extensions.KHR_gl_colorspace)
+ return _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
+
*value = surface->GLColorspace;
break;
case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
*value = surface->PostSubBufferSupportedNV;
break;
case EGL_BUFFER_AGE_EXT:
- if (!dpy->Extensions.EXT_buffer_age) {
- _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
- return EGL_FALSE;
- }
+ if (!dpy->Extensions.EXT_buffer_age)
+ return _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
+
_EGLContext *ctx = _eglGetCurrentContext();
EGLint result = drv->API.QueryBufferAge(drv, dpy, surface);
/* error happened */
if (result < 0)
return EGL_FALSE;
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
- ctx->DrawSurface != surface) {
- _eglError(EGL_BAD_SURFACE, "eglQuerySurface");
- return EGL_FALSE;
- }
+ ctx->DrawSurface != surface)
+ return _eglError(EGL_BAD_SURFACE, "eglQuerySurface");
+
*value = result;
surface->BufferAgeRead = EGL_TRUE;
break;
default:
- _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
- return EGL_FALSE;
+ return _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
}
return EGL_TRUE;
if (dpy->Extensions.NOK_texture_from_pixmap)
texture_type |= EGL_PIXMAP_BIT;
- if (!(surface->Type & texture_type)) {
- _eglError(EGL_BAD_SURFACE, "eglBindTexImage");
- return EGL_FALSE;
- }
+ if (!(surface->Type & texture_type))
+ return _eglError(EGL_BAD_SURFACE, "eglBindTexImage");
- if (surface->TextureFormat == EGL_NO_TEXTURE) {
- _eglError(EGL_BAD_MATCH, "eglBindTexImage");
- return EGL_FALSE;
- }
+ if (surface->TextureFormat == EGL_NO_TEXTURE)
+ return _eglError(EGL_BAD_MATCH, "eglBindTexImage");
- if (surface->TextureTarget == EGL_NO_TEXTURE) {
- _eglError(EGL_BAD_MATCH, "eglBindTexImage");
- return EGL_FALSE;
- }
+ if (surface->TextureTarget == EGL_NO_TEXTURE)
+ return _eglError(EGL_BAD_MATCH, "eglBindTexImage");
- if (buffer != EGL_BACK_BUFFER) {
- _eglError(EGL_BAD_PARAMETER, "eglBindTexImage");
- return EGL_FALSE;
- }
+ if (buffer != EGL_BACK_BUFFER)
+ return _eglError(EGL_BAD_PARAMETER, "eglBindTexImage");
surface->BoundToTexture = EGL_TRUE;
EGLint texture_type = EGL_PBUFFER_BIT;
if (surf == EGL_NO_SURFACE)
- {
- _eglError(EGL_BAD_SURFACE, "eglReleaseTexImage");
- return EGL_FALSE;
- }
+ return _eglError(EGL_BAD_SURFACE, "eglReleaseTexImage");
if (!surf->BoundToTexture)
{
}
if (surf->TextureFormat == EGL_NO_TEXTURE)
- {
- _eglError(EGL_BAD_MATCH, "eglReleaseTexImage");
- return EGL_FALSE;
- }
+ return _eglError(EGL_BAD_MATCH, "eglReleaseTexImage");
if (buffer != EGL_BACK_BUFFER)
- {
- _eglError(EGL_BAD_PARAMETER, "eglReleaseTexImage");
- return EGL_FALSE;
- }
+ return _eglError(EGL_BAD_PARAMETER, "eglReleaseTexImage");
if (dpy->Extensions.NOK_texture_from_pixmap)
texture_type |= EGL_PIXMAP_BIT;
if (!(surf->Type & texture_type))
- {
- _eglError(EGL_BAD_SURFACE, "eglReleaseTexImage");
- return EGL_FALSE;
- }
+ return _eglError(EGL_BAD_SURFACE, "eglReleaseTexImage");
surf->BoundToTexture = EGL_FALSE;