Compare commits

...

4 Commits

Author SHA1 Message Date
Jean-Philippe Andre 94b447e99b Evas filters: Fix glReadPixels usage for EGL
EGL might very well not support RGBA read mode, so we
need to check for it first.

Also remove some error logs (see previous commit), and useless
initialization of the Evas GL engine.

@fix
2015-05-13 10:46:06 +09:00
Jean-Philippe Andre 8f4d840876 Evas GL common: Skip shaders generation if there is no change
Based on a quick git diff we check that the glsl code has not changed.
This should fix out-of-tree builds and avoid all source modification
unless required.

When compiling from a tarball there should be no git tree (err 129),
or if there's one the files should not be checked in (ie. no diff).
If you changed the glsl files in a tarball... too bad for you.

If this is still not enough to fix the build, then go ahead and disable
the script from Makefile_Evas.am

I would like to note that the auto-generation during make is extremely
useful when working on the shaders, which is why I'd rather keep it enabled.

@fix
2015-05-12 14:23:49 +09:00
Stefan Schmidt 1501b791a7 rg_etc: Correct ifdef to keep function available for debug build
In the nightly builds we have debug enabled and this spotted the case where
rg_etc1_solution_coordinates_block_colors_get is actually still used:

lib/eet/.libs/libeet.so: undefined reference to `rg_etc1_solution_coordinates_block_colors_get'

Showed only after we switched back from release to dev mode.

@fix
2015-05-11 14:54:10 +02:00
Daniel Zaoui 6c5d0b6f6b Eolian/Generator: fix enums generation
Typedef word was not generated for enums. Camel case was not respected
for type definition.
Tests have been updated to check enums generation.

@fix T2400
2015-05-07 10:17:54 +03:00
10 changed files with 87 additions and 35 deletions

View File

@ -4,6 +4,7 @@
#include <Eina.h>
#include <string.h>
#include <ctype.h>
#include "Eolian.h"
#include "types_generator.h"
@ -22,7 +23,11 @@ _concat_name(const Eolian_Type *tp)
name = eolian_type_name_get(tp);
if (name) eina_strbuf_append_printf(buf, "%s", name);
if (eina_strbuf_length_get(buf))
str = eina_strbuf_string_steal(buf);
{
char *tmp = str = eina_strbuf_string_steal(buf);
*tmp = toupper(*tmp);
while (*tmp) if (*tmp++ == '_' && *tmp) *tmp = toupper(*tmp);
}
eina_strbuf_free(buf);
return str;
}
@ -118,14 +123,11 @@ _type_generate(const Eolian_Type *tp, Eina_Bool in_typedef, Eina_Bool full)
break;
}
char *pre = NULL;
eina_strbuf_append_printf(buf, "enum %s {\n", name);
eina_strbuf_append_printf(buf, "typedef enum\n{\n");
if (eolian_type_enum_legacy_prefix_get(tp))
{
pre = strdup(eolian_type_enum_legacy_prefix_get(tp));
free(name);
}
pre = strdup(eolian_type_enum_legacy_prefix_get(tp));
else
pre = name;
pre = strdup(name);
eina_str_toupper(&pre);
Eina_Iterator *members = eolian_type_enum_fields_get(tp);
Eina_Bool next = eina_iterator_next(members, (void**)&member);
@ -162,10 +164,11 @@ _type_generate(const Eolian_Type *tp, Eina_Bool in_typedef, Eina_Bool full)
if (desc) eina_strbuf_append_printf(buf, " /** %s */", desc);
eina_strbuf_append(buf, "\n");
}
eina_strbuf_append_printf(buf, "} %s", name);
eina_strbuf_free(membuf);
free(name);
free(pre);
eina_iterator_free(members);
eina_strbuf_append(buf, "}");
break;
}
default:

View File

@ -1,5 +1,4 @@
/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED
* See: ./modules/evas/engines/gl_common/shader/gen_shaders.sh */
/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
typedef enum {
SHADER_RECT,

View File

@ -1,5 +1,4 @@
/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED
* See: ./modules/evas/engines/gl_common/shader/gen_shaders.sh */
/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
#include "../evas_gl_private.h"

View File

@ -35,6 +35,14 @@ precision mediump float;
#endif
"
# Skip generation if there is no diff (or no git)
if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
if git diff --quiet --exit-code -- "$DIR"
then
touch "${OUTPUT}" "${OUTPUT_ENUM}"
exit 0
fi
function upper() {
echo $@ |tr '[:lower:]' '[:upper:]'
}
@ -50,7 +58,7 @@ IFS=$'\n' SHADERS=(`cat ${DIR}/shaders.txt`)
IFS=$OIFS
# Write header
printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */\n\n" > ${OUTPUT}
printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */\n\n" > ${OUTPUT}
# Including private for hilights and stuff :)
printf "#include \"../evas_gl_private.h\"\n\n" >> ${OUTPUT}
@ -164,7 +172,7 @@ static const struct {
printf "${shaders_source}};\n\n" >> ${OUTPUT}
printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */
printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
typedef enum {
${shaders_enum} SHADER_LAST

View File

@ -1,5 +1,4 @@
/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED
* See: modules/evas/engines/gl_common/shader_3d/gen_shaders_3d.sh */
/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
static const char vertex_color_vert_glsl[] =
"#ifdef GL_ES\n"

View File

@ -6,6 +6,14 @@ DIR=`dirname $0`
OUTPUT=${DIR}/evas_gl_3d_shaders.x
# Skip generation if there is no diff (or no git)
if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
if git diff --quiet --exit-code -- "$DIR"
then
touch "${OUTPUT}"
exit 0
fi
exec 1<&-
exec 1>${OUTPUT}
@ -14,7 +22,7 @@ vert_shaders_source=""
frag_shaders_source=""
# Write header
printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */\n\n"
printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */\n\n"
for shd in ${SHADERS} ; do
lname=`basename ${shd} .shd`

View File

@ -621,7 +621,6 @@ _rotate_image_data(void *data, void *img)
evas_common_draw_context_free(dc);
glsym_glBindFramebuffer(GL_FRAMEBUFFER, im2->tex->pt->fb);
GLERRV("glsym_glBindFramebuffer");
// Rely on Evas_GL_Image infrastructure to allocate pixels
im2->im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
@ -652,7 +651,6 @@ _rotate_image_data(void *data, void *img)
}
glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
GLERRV("glsym_glBindFramebuffer");
return im2;
}
@ -725,7 +723,6 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i
if (!im->tex->pt->dyn.data)
{
if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
GLERRV("secsym_eglMapImageSEC");
return im;
}
im->tex->pt->dyn.checked_out++;
@ -1600,12 +1597,10 @@ eng_gl_get_pixels_post(void *data EINA_UNUSED)
}
static Eina_Bool
eng_gl_surface_lock(void *data, void *surface)
eng_gl_surface_lock(void *data EINA_UNUSED, void *surface)
{
Render_Engine_GL_Generic *re = data;
Evas_GL_Image *im = surface;
EVGLINIT(re, EINA_FALSE);
if (!im->tex || !im->tex->pt)
{
ERR("Can not lock image that is not a surface!");
@ -1618,27 +1613,25 @@ eng_gl_surface_lock(void *data, void *surface)
}
static Eina_Bool
eng_gl_surface_unlock(void *data, void *surface)
eng_gl_surface_unlock(void *data EINA_UNUSED, void *surface)
{
Render_Engine_GL_Generic *re = data;
Evas_GL_Image *im = surface;
EVGLINIT(re, EINA_FALSE);
im->locked = EINA_FALSE;
return EINA_TRUE;
}
static Eina_Bool
eng_gl_surface_read_pixels(void *data, void *surface,
eng_gl_surface_read_pixels(void *data EINA_UNUSED, void *surface,
int x, int y, int w, int h,
Evas_Colorspace cspace, void *pixels)
{
Render_Engine_GL_Generic *re = data;
Evas_GL_Image *im = surface;
GLint fmt = GL_BGRA;
int done = 0;
EINA_SAFETY_ON_NULL_RETURN_VAL(pixels, EINA_FALSE);
EVGLINIT(re, EINA_FALSE);
if (!im->locked)
{
// For now, this is useless, but let's force clients to lock :)
@ -1657,10 +1650,20 @@ eng_gl_surface_read_pixels(void *data, void *surface,
*/
glsym_glBindFramebuffer(GL_FRAMEBUFFER, im->tex->pt->fb);
GLERRV("glsym_glBindFramebuffer");
if (im->tex->pt->format == GL_BGRA)
glReadPixels(x, y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
else
glPixelStorei(GL_PACK_ALIGNMENT, 4);
// With GLX we will try to read BGRA even if the driver reports RGBA
#if defined(GL_GLES) && defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT)
glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &fmt);
#endif
if ((im->tex->pt->format == GL_BGRA) && (fmt == GL_BGRA))
{
glReadPixels(x, y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
done = (glGetError() == GL_NO_ERROR);
}
if (!done)
{
DATA32 *ptr = pixels;
int k;
@ -1674,8 +1677,8 @@ eng_gl_surface_read_pixels(void *data, void *surface,
| ((v & 0x000000FF) << 16);
}
}
glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
GLERRV("glsym_glBindFramebuffer");
return EINA_TRUE;
}

View File

@ -1592,7 +1592,7 @@ rg_etc1_solution_coordinates_get_scaled_color(color_quad_u8 *color, const Etc1_S
rg_etc1_color_quad_u8_init(color, br, bg, bb, 255);
}
#if 0
#ifdef RG_ETC1_BUILD_DEBUG
static inline void
rg_etc1_solution_coordinates_block_colors_get(const Etc1_Solution_Coordinates *coords, color_quad_u8 colors[4])
{

View File

@ -1,6 +1,23 @@
type Evas.Coord: int; /* Simple type definition */
type List_Objects: own(list<Eo *>*); /* A little more complex */
enum Enum.Bar
{
legacy: bar;
first_item = 0,
second_item,
last_item
}
enum Elm.Object.Select_mode
{
default = 0,
always,
none,
display_only,
max
}
class Typedef {
methods {
foo {

View File

@ -15,6 +15,22 @@ typedef int Evas_Coord;
typedef Eina_List *List_Objects;
typedef enum
{
BAR_FIRST_ITEM = 0,
BAR_SECOND_ITEM,
BAR_LAST_ITEM
} Enum_Bar;
typedef enum
{
ELM_OBJECT_SELECT_MODE_DEFAULT = 0,
ELM_OBJECT_SELECT_MODE_ALWAYS,
ELM_OBJECT_SELECT_MODE_NONE,
ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY,
ELM_OBJECT_SELECT_MODE_MAX
} Elm_Object_Select_Mode;
#endif
#define TYPEDEF_CLASS typedef_class_get()