33
#ifdef EGL_MESA_screen_surface
35
_eglParseScreenSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
37
EGLint i, err = EGL_SUCCESS;
42
for (i = 0; attrib_list[i] != EGL_NONE; i++) {
43
EGLint attr = attrib_list[i++];
44
EGLint val = attrib_list[i];
49
err = EGL_BAD_PARAMETER;
56
err = EGL_BAD_PARAMETER;
62
err = EGL_BAD_ATTRIBUTE;
66
if (err != EGL_SUCCESS) {
67
_eglLog(_EGL_WARNING, "bad surface attribute 0x%04x", attr);
74
#endif /* EGL_MESA_screen_surface */
34
78
* Parse the list of surface attributes and return the proper error code.
37
81
_eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
83
_EGLDisplay *dpy = surf->Resource.Display;
39
84
EGLint type = surf->Type;
85
EGLint texture_type = EGL_PBUFFER_BIT;
40
86
EGLint i, err = EGL_SUCCESS;
43
89
return EGL_SUCCESS;
91
#ifdef EGL_MESA_screen_surface
92
if (type == EGL_SCREEN_BIT_MESA)
93
return _eglParseScreenSurfaceAttribList(surf, attrib_list);
96
if (dpy->Extensions.NOK_texture_from_pixmap)
97
texture_type |= EGL_PIXMAP_BIT;
45
99
for (i = 0; attrib_list[i] != EGL_NONE; i++) {
46
100
EGLint attr = attrib_list[i++];
47
101
EGLint val = attrib_list[i];
50
/* common (except for screen surfaces) attributes */
104
/* common attributes */
51
105
case EGL_VG_COLORSPACE:
52
if (type == EGL_SCREEN_BIT_MESA) {
53
err = EGL_BAD_ATTRIBUTE;
57
107
case EGL_VG_COLORSPACE_sRGB:
58
108
case EGL_VG_COLORSPACE_LINEAR:
66
116
surf->VGColorspace = val;
68
118
case EGL_VG_ALPHA_FORMAT:
69
if (type == EGL_SCREEN_BIT_MESA) {
70
err = EGL_BAD_ATTRIBUTE;
74
120
case EGL_VG_ALPHA_FORMAT_NONPRE:
75
121
case EGL_VG_ALPHA_FORMAT_PRE:
205
252
case EGL_PBUFFER_BIT:
206
253
func = "eglCreatePBufferSurface";
255
#ifdef EGL_MESA_screen_surface
208
256
case EGL_SCREEN_BIT_MESA:
209
257
func = "eglCreateScreenSurface";
210
258
renderBuffer = EGL_SINGLE_BUFFER; /* XXX correct? */
213
262
_eglLog(_EGL_WARNING, "Bad type in _eglInitSurface");
214
263
return EGL_FALSE;
452
501
_eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
504
EGLint texture_type = EGL_PBUFFER_BIT;
455
506
/* Just do basic error checking and return success/fail.
456
507
* Drivers must implement the real stuff.
459
if (surface->Type != EGL_PBUFFER_BIT) {
510
if (dpy->Extensions.NOK_texture_from_pixmap)
511
texture_type |= EGL_PIXMAP_BIT;
513
if (!(surface->Type & texture_type)) {
460
514
_eglError(EGL_BAD_SURFACE, "eglBindTexImage");
461
515
return EGL_FALSE;
466
520
return EGL_FALSE;
523
if (surface->TextureTarget == EGL_NO_TEXTURE) {
524
_eglError(EGL_BAD_MATCH, "eglBindTexImage");
469
528
if (buffer != EGL_BACK_BUFFER) {
470
529
_eglError(EGL_BAD_PARAMETER, "eglBindTexImage");
471
530
return EGL_FALSE;