[Mesa-dev] [PATCH 10/12] egl: Improve configuration creation for Haiku.
Alexander von Gluck IV
kallisti5 at unixzen.com
Mon Dec 22 06:36:09 PST 2014
From: Adrián Arroyo Calle <adrian.arroyocalle at gmail.com>
* Creates a configuration, but it does not work
---
src/egl/drivers/dri2/platform_haiku.cpp | 51 ++++++++++++++++++++++++++++++-
1 files changed, 50 insertions(+), 1 deletions(-)
diff --git a/src/egl/drivers/dri2/platform_haiku.cpp b/src/egl/drivers/dri2/platform_haiku.cpp
index 22633ff..f62e8ed 100644
--- a/src/egl/drivers/dri2/platform_haiku.cpp
+++ b/src/egl/drivers/dri2/platform_haiku.cpp
@@ -115,6 +115,8 @@ dri2_haiku_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
+ //BWindow* win=new BWindow(BRect(100,100,500,500),NULL);
+ //win->Show();
return NULL;
}
@@ -142,6 +144,7 @@ static EGLBoolean
dri2_haiku_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
_EGLDisplay *dpy)
{
+ printf("Adding configs\n");
/*EGLint config_attrs[] = {
EGL_NATIVE_VISUAL_ID, 0,
EGL_NATIVE_VISUAL_TYPE, 0,
@@ -153,17 +156,63 @@ dri2_haiku_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
EGL_SWAP_BEHAVIOR_PRESERVED_BIT,config_attrs,rgb_masks);*/
struct dri2_egl_config *conf;
_EGLConfig base;
- _eglInitConfig(&base, dpy, 1);
+ _eglInitConfig(&base, dpy, 0x8);
+ printf("Config inited\n");
+ _eglSetConfigKey(&base, EGL_RED_SIZE ,8);
+ _eglSetConfigKey(&base, EGL_BLUE_SIZE ,8);
+ _eglSetConfigKey(&base, EGL_GREEN_SIZE ,8);
+ _eglSetConfigKey(&base, EGL_LUMINANCE_SIZE ,0);
+ _eglSetConfigKey(&base, EGL_ALPHA_SIZE ,8);
+ _eglSetConfigKey(&base, EGL_COLOR_BUFFER_TYPE ,EGL_RGB_BUFFER);
+ EGLint r = (_eglGetConfigKey(&base, EGL_RED_SIZE)
+ + _eglGetConfigKey(&base, EGL_GREEN_SIZE)
+ + _eglGetConfigKey(&base, EGL_BLUE_SIZE)
+ + _eglGetConfigKey(&base, EGL_ALPHA_SIZE));
+ _eglSetConfigKey(&base, EGL_BUFFER_SIZE, r);
+ _eglSetConfigKey(&base, EGL_CONFIG_CAVEAT, EGL_NONE);
+ _eglSetConfigKey(&base, EGL_CONFIG_ID, 0x8);
+ _eglSetConfigKey(&base, EGL_BIND_TO_TEXTURE_RGB ,EGL_FALSE);
+ _eglSetConfigKey(&base, EGL_BIND_TO_TEXTURE_RGBA ,EGL_FALSE);
+ _eglSetConfigKey(&base, EGL_STENCIL_SIZE ,0);
+ _eglSetConfigKey(&base, EGL_TRANSPARENT_TYPE ,EGL_NONE);
+ _eglSetConfigKey(&base, EGL_NATIVE_RENDERABLE ,EGL_TRUE); // Let's say yes
+ _eglSetConfigKey(&base, EGL_NATIVE_VISUAL_ID ,0); // No visual
+ _eglSetConfigKey(&base, EGL_NATIVE_VISUAL_TYPE ,EGL_NONE); // No visual
+ //_eglSetConfigKey(&base, EGL_RENDERABLE_TYPE ,glv);
+ _eglSetConfigKey(&base, EGL_SAMPLE_BUFFERS ,0); // TODO: How to get the right value ?
+ _eglSetConfigKey(&base, EGL_SAMPLES ,_eglGetConfigKey(&base, EGL_SAMPLE_BUFFERS) == 0 ? 0 : 0);
+ _eglSetConfigKey(&base, EGL_DEPTH_SIZE ,24); // TODO: How to get the right value ?
+ _eglSetConfigKey(&base, EGL_LEVEL ,0);
+ _eglSetConfigKey(&base, EGL_MAX_PBUFFER_WIDTH ,0); // TODO: How to get the right value ?
+ _eglSetConfigKey(&base, EGL_MAX_PBUFFER_HEIGHT ,0); // TODO: How to get the right value ?
+ _eglSetConfigKey(&base, EGL_MAX_PBUFFER_PIXELS ,0); // TODO: How to get the right value ?
+ base.NativeRenderable = EGL_TRUE;
+ base.SurfaceType = EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT;
+
+ base.RenderableType = dpy->ClientAPIs;
+ base.Conformant = dpy->ClientAPIs;
+
+ base.MinSwapInterval = dri2_dpy->min_swap_interval;
+ base.MaxSwapInterval = dri2_dpy->max_swap_interval;
+ printf("Config configurated\n");
if (!_eglValidateConfig(&base, EGL_FALSE)) {
_eglLog(_EGL_DEBUG, "DRI2: failed to validate config");
return NULL;
}
+ printf("Validated config\n");
+ conf =(struct dri2_egl_config*) malloc(sizeof *conf);
+ memcpy(&conf->base, &base, sizeof base);
+ conf->base.ConfigID = base.ConfigID;
+ base.ConfigID = EGL_DONT_CARE;
+ base.SurfaceType = EGL_DONT_CARE;
+
_eglLinkConfig(&conf->base);
if (!_eglGetArraySize(dpy->Configs)) {
_eglLog(_EGL_WARNING, "DRI2: failed to create any config");
return EGL_FALSE;
}
+ printf("Config succesfull\n");
return EGL_TRUE;
}
--
1.7.1
More information about the mesa-dev
mailing list