summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-06-11 18:12:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-06-11 18:12:07 +0900
commitfdabe06989b674daccfefb397c81b6184b2e4541 (patch)
tree58f2ba91b2ca0b046efa1bb2f2d51c6a07a54c8f
parent1f7ae48215168724d35e6c8076eba39eef47ee72 (diff)
evas - partial rendering support now for qualcomm extn too.
Diffstat (limited to '')
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h38
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c70
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c3
5 files changed, 114 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index db4539192e..e2a081aff3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-06-11 Carsten Haitzler (The Rasterman)
2
3 * Support qualcomm begin/end tile extension for partial update
4
12013-06-06 ChunEon Park (Hermet) 52013-06-06 ChunEon Park (Hermet)
2 6
3 * Edje: support edc map color set 7 * Edje: support edc map color set
diff --git a/NEWS b/NEWS
index 5a1e7c5354..2de8052bce 100644
--- a/NEWS
+++ b/NEWS
@@ -187,6 +187,7 @@ Improvements:
187 * Edje entry emtis signals on keydown/up for theme to use 187 * Edje entry emtis signals on keydown/up for theme to use
188 * Turn on scissors always to abe able to to partual render on some GL implementations properly. 188 * Turn on scissors always to abe able to to partual render on some GL implementations properly.
189 * Evas gl engine - dont map dri/drm buffer unless we are going to render. 189 * Evas gl engine - dont map dri/drm buffer unless we are going to render.
190 * Partial rendering support in evas for several gl drivers.
190 191
191Fixes: 192Fixes:
192 * Fix a memory leak in ecore_con_dns when using ecore_con_server_connect 193 * Fix a memory leak in ecore_con_dns when using ecore_con_server_connect
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h
index 452ab2848d..f1515b6b57 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -126,6 +126,42 @@
126#define EGL_MAP_GL_TEXTURE_OPTION_WRITE_SEC (1<<1) 126#define EGL_MAP_GL_TEXTURE_OPTION_WRITE_SEC (1<<1)
127#endif 127#endif
128 128
129#ifndef GL_COLOR_BUFFER_BIT0_QCOM
130// if GL_COLOR_BUFFER_BIT0_QCOM just assume the rest arent... saves fluff
131#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
132#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
133#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
134#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
135#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
136#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
137#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
138#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
139#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
140#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
141#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
142#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
143#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
144#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
145#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
146#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
147#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
148#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
149#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
150#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
151#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
152#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
153#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
154#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
155#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
156#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
157#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
158#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
159#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
160#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
161#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
162#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
163#endif
164
129#define SHAD_VERTEX 0 165#define SHAD_VERTEX 0
130#define SHAD_COLOR 1 166#define SHAD_COLOR 1
131#define SHAD_TEXUV 2 167#define SHAD_TEXUV 2
@@ -354,6 +390,7 @@ struct _Evas_Engine_GL_Context
354 struct { 390 struct {
355 int x, y, w, h; 391 int x, y, w, h;
356 Eina_Bool enabled : 1; 392 Eina_Bool enabled : 1;
393 Eina_Bool used : 1;
357 } master_clip; 394 } master_clip;
358 395
359 struct { 396 struct {
@@ -558,6 +595,7 @@ void evas_gl_common_context_free(Evas_Engine_GL_Context *gc);
558void evas_gl_common_context_use(Evas_Engine_GL_Context *gc); 595void evas_gl_common_context_use(Evas_Engine_GL_Context *gc);
559void evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc); 596void evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc);
560void evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h, int rot); 597void evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h, int rot);
598void evas_gl_common_context_done(Evas_Engine_GL_Context *gc);
561void evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc, Evas_GL_Image *surface); 599void evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc, Evas_GL_Image *surface);
562 600
563void evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc, 601void evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c
index ae4f06a877..0308d90523 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -27,6 +27,8 @@ void (*glsym_glProgramParameteri) (GLuint a, GLuint b, GLint d) = NULL;
27void (*glsym_glReleaseShaderCompiler)(void) = NULL; 27void (*glsym_glReleaseShaderCompiler)(void) = NULL;
28void *(*glsym_glMapBuffer) (GLenum a, GLenum b) = NULL; 28void *(*glsym_glMapBuffer) (GLenum a, GLenum b) = NULL;
29GLboolean (*glsym_glUnmapBuffer) (GLenum a) = NULL; 29GLboolean (*glsym_glUnmapBuffer) (GLenum a) = NULL;
30void (*glsym_glStartTiling) (GLuint a, GLuint b, GLuint c, GLuint d, GLuint e) = NULL;
31void (*glsym_glEndTiling) (GLuint a) = NULL;
30 32
31#ifdef GL_GLES 33#ifdef GL_GLES
32// just used for finding symbols :) 34// just used for finding symbols :)
@@ -142,6 +144,12 @@ gl_symbols(void)
142 FINDSYM(glsym_glReleaseShaderCompiler, "glReleaseShaderCompilerARB", glsym_func_void); 144 FINDSYM(glsym_glReleaseShaderCompiler, "glReleaseShaderCompilerARB", glsym_func_void);
143 FINDSYM(glsym_glReleaseShaderCompiler, "glReleaseShaderCompiler", glsym_func_void); 145 FINDSYM(glsym_glReleaseShaderCompiler, "glReleaseShaderCompiler", glsym_func_void);
144 146
147 FINDSYM(glsym_glStartTiling, "glStartTilingQCOM", glsym_func_void);
148 FINDSYM(glsym_glStartTiling, "glStartTiling", glsym_func_void);
149
150 FINDSYM(glsym_glEndTiling, "glEndTilingQCOM", glsym_func_void);
151 FINDSYM(glsym_glEndTiling, "glEndTiling", glsym_func_void);
152
145 if (!getenv("EVAS_GL_MAPBUFFER_DISABLE")) 153 if (!getenv("EVAS_GL_MAPBUFFER_DISABLE"))
146 { 154 {
147 FINDSYM(glsym_glMapBuffer, "glMapBufferOES", glsym_func_void_ptr); 155 FINDSYM(glsym_glMapBuffer, "glMapBufferOES", glsym_func_void_ptr);
@@ -618,6 +626,11 @@ evas_gl_common_context_new(void)
618 shared->info.sec_image_map = 1; 626 shared->info.sec_image_map = 1;
619 } 627 }
620#endif 628#endif
629 if (!strstr((char *)ext, "GL_QCOM_tiled_rendering"))
630 {
631 glsym_glStartTiling = NULL;
632 glsym_glEndTiling = NULL;
633 }
621 } 634 }
622 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, 635 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,
623 &(shared->info.max_texture_units)); 636 &(shared->info.max_texture_units));
@@ -1021,13 +1034,24 @@ evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h, int rot)
1021} 1034}
1022 1035
1023void 1036void
1037evas_gl_common_context_done(Evas_Engine_GL_Context *gc)
1038{
1039 if (gc->master_clip.used)
1040 {
1041 if (glsym_glEndTiling) glsym_glEndTiling(GL_COLOR_BUFFER_BIT0_QCOM);
1042 gc->master_clip.used = EINA_FALSE;
1043 }
1044}
1045
1046void
1024evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc, 1047evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc,
1025 Evas_GL_Image *surface) 1048 Evas_GL_Image *surface)
1026{ 1049{
1027 if (surface == gc->pipe[0].shader.surface) return; 1050 if (surface == gc->pipe[0].shader.surface) return;
1028 1051
1029 evas_gl_common_context_flush(gc); 1052 evas_gl_common_context_flush(gc);
1030 1053 evas_gl_common_context_done(gc);
1054
1031 gc->state.current.cur_prog = PRG_INVALID; 1055 gc->state.current.cur_prog = PRG_INVALID;
1032 gc->state.current.cur_tex = -1; 1056 gc->state.current.cur_tex = -1;
1033 gc->state.current.cur_texu = -1; 1057 gc->state.current.cur_texu = -1;
@@ -2570,6 +2594,32 @@ scissor_rot(Evas_Engine_GL_Context *gc EINA_UNUSED,
2570} 2594}
2571 2595
2572static void 2596static void
2597start_tiling(Evas_Engine_GL_Context *gc EINA_UNUSED,
2598 int rot, int gw, int gh, int cx, int cy, int cw, int ch,
2599 int bitmask)
2600{
2601 if (!glsym_glStartTiling) return;
2602 switch (rot)
2603 {
2604 case 0: // UP this way: ^
2605 glsym_glStartTiling(cx, cy, cw, ch, bitmask);
2606 break;
2607 case 90: // UP this way: <
2608 glsym_glStartTiling(gh - (cy + ch), cx, ch, cw, bitmask);
2609 break;
2610 case 180: // UP this way: v
2611 glsym_glStartTiling(gw - (cx + cw), gh - (cy + ch), cw, ch, bitmask);
2612 break;
2613 case 270: // UP this way: >
2614 glsym_glStartTiling(cy, gw - (cx + cw), ch, cw, bitmask);
2615 break;
2616 default: // assume up is up
2617 glsym_glStartTiling(cx, cy, cw, ch, bitmask);
2618 break;
2619 }
2620}
2621
2622static void
2573shader_array_flush(Evas_Engine_GL_Context *gc) 2623shader_array_flush(Evas_Engine_GL_Context *gc)
2574{ 2624{
2575 int i, gw, gh, setclip, fbo = 0, done = 0; 2625 int i, gw, gh, setclip, fbo = 0, done = 0;
@@ -2742,6 +2792,24 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
2742 ch = gc->master_clip.h; 2792 ch = gc->master_clip.h;
2743 } 2793 }
2744 } 2794 }
2795 if ((glsym_glStartTiling) && (glsym_glEndTiling) &&
2796 (gc->master_clip.enabled) &&
2797 (gc->master_clip.w > 0) && (gc->master_clip.h > 0))
2798 {
2799 if (!gc->master_clip.used)
2800 {
2801 if (!fbo)
2802 start_tiling(gc, gc->rot, gw, gh,
2803 gc->master_clip.x,
2804 gh - gc->master_clip.y - gc->master_clip.h,
2805 gc->master_clip.w, gc->master_clip.h, 0);
2806 else
2807 start_tiling(gc, 0, gw, gh,
2808 gc->master_clip.x, gc->master_clip.y,
2809 gc->master_clip.w, gc->master_clip.h, 0);
2810 gc->master_clip.used = EINA_TRUE;
2811 }
2812 }
2745 if ((gc->pipe[i].shader.clip) || 2813 if ((gc->pipe[i].shader.clip) ||
2746 ((gc->master_clip.enabled) && (!fbo))) 2814 ((gc->master_clip.enabled) && (!fbo)))
2747 { 2815 {
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 7312e11b0b..8939ded4ca 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -1430,7 +1430,8 @@ eng_output_flush(void *data, Evas_Render_Mode render_mode)
1430 1430
1431 re->win->draw.drew = 0; 1431 re->win->draw.drew = 0;
1432 eng_window_use(re->win); 1432 eng_window_use(re->win);
1433 1433 evas_gl_common_context_done(re->win->gl_context);
1434
1434#ifdef GL_GLES 1435#ifdef GL_GLES
1435 if (!re->vsync) 1436 if (!re->vsync)
1436 { 1437 {