#include "evas_common.h" /* Also includes international specific stuff */
#include "evas_engine.h"
-#include <dlfcn.h> /* dlopen,dlclose,etc */
-
static void* _sdl_output_setup (int w, int h, int fullscreen, int noframe);
int _evas_engine_GL_SDL_log_dom = -1;
}
}
- evas_gl_common_context_resize(re->gl_context, w, h);
+ evas_gl_common_context_resize(re->gl_context, w, h, re->gl_context->rot);
}
static void
Render_Engine *re;
re = (Render_Engine *)data;
- evas_gl_common_context_resize(re->gl_context, re->w, re->h);
+ evas_gl_common_context_resize(re->gl_context, re->w, re->h, re->gl_context->rot);
/* smple bounding box */
if (!re->draw.redraw)
{
re = (Render_Engine *)data;
evas_gl_common_context_flush(re->gl_context);
+ evas_gl_common_context_newframe(re->gl_context);
/* get the upate rect surface - return engine data as dummy */
if (!re->draw.redraw)
{
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
if (im->tex) evas_gl_common_texture_free(im->tex);
im->tex = NULL;
if (im->cs.data)
{
}
-static void
+static void *
eng_image_native_set(void *data, void *image, void *native)
{
+ return NULL;
}
static void *
return image;
}
im_old = image;
- if ((eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P601_PL) ||
- (eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P709_PL))
- w &= ~0x1;
+
+ switch (eng_image_colorspace_get(data, image))
+ {
+ case EVAS_COLORSPACE_YCBCR422P601_PL:
+ case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+ w &= ~0x1;
+ break;
+ }
+
if ((im_old) && (im_old->im->cache_entry.w == w) && (im_old->im->cache_entry.h == h))
return image;
if (im_old)
}
static void *
-eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
+eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, int *err)
{
Render_Engine *re;
Evas_GL_Image *im;
-
+ int error;
+
re = (Render_Engine *)data;
if (!image)
{
*image_data = NULL;
+ if (err) *err = EVAS_LOAD_ERROR_GENERIC;
return NULL;
}
im = image;
if (im->native.data)
{
*image_data = NULL;
+ if (err) *err = EVAS_LOAD_ERROR_NONE;
return im;
}
- evas_cache_image_load_data(&im->im->cache_entry);
+ error = evas_cache_image_load_data(&im->im->cache_entry);
switch (im->cs.space)
{
case EVAS_COLORSPACE_ARGB8888:
if (!im_new)
{
*image_data = NULL;
- return im;
+ if (err) *err = error;
+ return im;
}
evas_gl_common_image_free(im);
im = im_new;
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
*image_data = im->cs.data;
break;
default:
abort();
break;
}
+ if (err) *err = error;
return im;
}
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
if (image_data != im->cs.data)
{
if (im->cs.data)
}
static void
-eng_image_map4_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map_Point *p, int smooth, int level)
+eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level)
{
Render_Engine *re;
re = (Render_Engine *)data;
evas_gl_common_context_target_surface_set(re->gl_context, surface);
re->gl_context->dc = context;
- evas_gl_common_image_map4_draw(re->gl_context, image, p, smooth, level);
+ evas_gl_common_image_map_draw(re->gl_context, image, npoints, p, smooth, level);
}
static void *
}
static void
-eng_font_draw(void *data, void *context, void *surface, void *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const Eina_Unicode *text, const Evas_BiDi_Props *intl_props)
+eng_font_draw(void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const Evas_Text_Props *intl_props)
{
Render_Engine *re;
evas_gl_font_texture_new,
evas_gl_font_texture_free,
evas_gl_font_texture_draw);
- evas_common_font_draw(im, context, font, x, y, text, intl_props);
+ evas_common_font_draw(im, context, (RGBA_Font *) font, x, y,
+ intl_props);
evas_common_draw_context_font_ext_set(context,
NULL,
NULL,
}
static int
+eng_image_load_error_get(void *data __UNUSED__, void *image)
+{
+ Evas_GL_Image *im;
+
+ if (!image) return EVAS_LOAD_ERROR_NONE;
+ im = image;
+ return im->im->cache_entry.load_error;
+}
+
+
+static int
module_open(Evas_Module *em)
{
if (!em) return 0;
+ if (!evas_gl_common_module_open()) return 0;
/* get whatever engine module we inherit from */
if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
if (_evas_engine_GL_SDL_log_dom < 0)
- _evas_engine_GL_SDL_log_dom = eina_log_domain_register("EvasEngineGLSDL", EVAS_DEFAULT_LOG_COLOR);
+ _evas_engine_GL_SDL_log_dom = eina_log_domain_register
+ ("evas-gl_sdl", EVAS_DEFAULT_LOG_COLOR);
if (_evas_engine_GL_SDL_log_dom < 0)
{
- EINA_LOG_ERR("Impossible to create a log domain for GL SDL engine.\n");
+ EINA_LOG_ERR("Can not create a module log domain.");
return 0;
}
/* store it for later use */
ORD(image_colorspace_get);
ORD(image_native_set);
ORD(image_native_get);
+#if 0 // filtering disabled
+// ORD(image_draw_filtered);
+// ORD(image_filtered_get);
+// ORD(image_filtered_save);
+// ORD(image_filtered_free);
+#endif
ORD(font_draw);
ORD(image_scale_hint_set);
ORD(image_scale_hint_get);
- ORD(image_map4_draw);
+ ORD(image_map_draw);
ORD(image_map_surface_new);
ORD(image_map_surface_free);
+
+// ORD(image_content_hint_set);
+// ORD(image_content_hint_get);
+
+// ORD(image_cache_flush);
+// ORD(image_cache_set);
+// ORD(image_cache_get);
+
+// ORD(gl_surface_create);
+// ORD(gl_surface_destroy);
+// ORD(gl_context_create);
+// ORD(gl_context_destroy);
+// ORD(gl_make_current);
+// ORD(gl_proc_address_get);
+// ORD(gl_native_surface_get);
+
+// ORD(gl_api_get);
+
+ ORD(image_load_error_get);
/* now advertise out own api */
em->functions = (void *)(&func);
module_close(Evas_Module *em)
{
eina_log_domain_unregister(_evas_engine_GL_SDL_log_dom);
+ evas_gl_common_module_close();
}
static Evas_Module_Api evas_modapi =
if (!surface)
{
- CRIT("SDL_SetVideoMode [ %i x %i x 32 ] failed.", w, h);
- CRIT("SDL: %s\n", SDL_GetError());
+ CRIT("SDL_SetVideoMode [ %i x %i x 32 ] failed. %s", w, h, SDL_GetError());
SDL_Quit();
exit(-1);
}
- fprintf(stderr, "Screen Depth : %d\n", SDL_GetVideoSurface()->format->BitsPerPixel);
- fprintf(stderr, "Vendor : %s\n", glGetString(GL_VENDOR));
- fprintf(stderr, "Renderer : %s\n", glGetString(GL_RENDERER));
- fprintf(stderr, "Version : %s\n", glGetString(GL_VERSION));
+ INF("Screen Depth: %d, Vendor: '%s', Renderer: '%s', Version: '%s'", SDL_GetVideoSurface()->format->BitsPerPixel, glGetString(GL_VENDOR), glGetString(GL_RENDERER), glGetString(GL_VERSION));
re->gl_context = evas_gl_common_context_new();
if (!re->gl_context)
return NULL;
}
evas_gl_common_context_use(re->gl_context);
- evas_gl_common_context_resize(re->gl_context, w, h);
+ evas_gl_common_context_resize(re->gl_context, w, h, re->gl_context->rot);
/* End GL Initialization */
re->w = w;