summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-11-27 11:06:56 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-11-27 13:51:40 +0900
commitf45a75f925dc2027bd4fa131952b1eadb4096a0f (patch)
tree7aec6fc0fc6f82bc2747e0ecd618cd5e0a01c51f
parent7aa577c774fae89d724546f6120793a0927fa67b (diff)
Revert "Revert "evas: allow fuzziness on the texture format returned by GL.""
This reverts commit 87385b05c3117aa8d46fd4029bfdeadf3444a7b9 that is necessary for desktop target.
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c38
3 files changed, 42 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ec1db15bc6..95ee2abefd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@
7 * ecore anim: Fixed animator not working problem when source_set is 7 * ecore anim: Fixed animator not working problem when source_set is
8 changed back and forth very fast. 8 changed back and forth very fast.
9 9
102013-11-26 Cedric Bail
11
12 * Evas: Allow fuzziness on the texture format returned by GL.
13
102013-11-25 Tom Hacohen 142013-11-25 Tom Hacohen
11 15
12 * Evas textblock: Fixed wrapping of lines ending with whites. 16 * Evas textblock: Fixed wrapping of lines ending with whites.
diff --git a/NEWS b/NEWS
index 856e3f45d4..e5a8bbe65a 100644
--- a/NEWS
+++ b/NEWS
@@ -228,6 +228,7 @@ Improvements:
228 - Use mmap/munmap for image data allocation on system that have mmap. 228 - Use mmap/munmap for image data allocation on system that have mmap.
229 - Add iterator for walking child of smart objects, table and a box. 229 - Add iterator for walking child of smart objects, table and a box.
230 - Use Eina_Spinlock for Evas_ScaleCache, Evas_Async_Events and Image_Entry. 230 - Use Eina_Spinlock for Evas_ScaleCache, Evas_Async_Events and Image_Entry.
231 - Allow fuzziness on the texture format returned by GL.
231 * Ecore: 232 * Ecore:
232 - Use Eina_Spinlock for Ecore_Thread. 233 - Use Eina_Spinlock for Ecore_Thread.
233 * Ecore_Con: 234 * Ecore_Con:
diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c b/src/modules/evas/engines/gl_common/evas_gl_texture.c
index 1cacce3548..95cb3a4946 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -54,6 +54,42 @@ static const struct {
54#endif 54#endif
55}; 55};
56 56
57static const GLenum matching_rgba[] = { GL_RGBA4, GL_RGBA8, GL_RGBA12, GL_RGBA16, 0x0 };
58static const GLenum matching_alpha[] = { GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, 0x0 };
59static const GLenum matching_luminance[] = { GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, 0x0 };
60static const GLenum matching_luminance_alpha[] = { GL_LUMINANCE4_ALPHA4, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, 0x0 };
61
62static const struct {
63 GLenum master;
64 const GLenum *matching;
65} matching_fmt[] = {
66 { GL_RGBA, matching_rgba },
67 { GL_ALPHA, matching_alpha },
68 { GL_LUMINANCE, matching_luminance },
69 { GL_LUMINANCE_ALPHA, matching_luminance_alpha }
70};
71
72static Eina_Bool
73_evas_gl_texture_match(GLenum intfmt, GLenum intfmtret)
74{
75 unsigned int i;
76
77 if (intfmt == intfmtret) return EINA_TRUE;
78
79 for (i = 0; i < sizeof (matching_fmt) / sizeof (matching_fmt[0]); i++)
80 if (matching_fmt[i].master == intfmt)
81 {
82 unsigned int j;
83
84 for (j = 0; matching_fmt[i].matching[j] != 0x0; j++)
85 if (matching_fmt[i].matching[j] == intfmtret)
86 return EINA_TRUE;
87 return EINA_FALSE;
88 }
89
90 return EINA_FALSE;
91}
92
57static int 93static int
58_evas_gl_texture_search_format(Eina_Bool alpha, Eina_Bool bgra) 94_evas_gl_texture_search_format(Eina_Bool alpha, Eina_Bool bgra)
59{ 95{
@@ -161,7 +197,7 @@ _tex_2d(Evas_Engine_GL_Context *gc, int intfmt, int w, int h, int fmt, int type)
161 197
162 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, 198 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
163 GL_TEXTURE_INTERNAL_FORMAT, &intfmtret); 199 GL_TEXTURE_INTERNAL_FORMAT, &intfmtret);
164 if (intfmtret != intfmt) 200 if (!_evas_gl_texture_match(intfmt, intfmtret))
165 { 201 {
166 ERR("Fail tex alloc %ix%i", w, h); 202 ERR("Fail tex alloc %ix%i", w, h);
167 // XXX send async err to evas 203 // XXX send async err to evas