This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch v-0.28
in repository enlightenment-mxd.
View the commit online.
commit 25574bacfda7fcf6bb4097fdf007ef713b8d1a99
Author: Valera <[email protected]>
AuthorDate: Wed Dec 2 17:06:04 2026 +0000
Загрузить файлы в «src/bin»
---
src/bin/e_comp_blur_frosted.h | 29 +++
src/bin/e_comp_blur_kawase.c | 465 ++++++++++++++++++++++++++++++++++++++++++
src/bin/e_comp_blur_kawase.h | 15 ++
3 files changed, 509 insertions(+)
diff --git a/src/bin/e_comp_blur_frosted.h b/src/bin/e_comp_blur_frosted.h
new file mode 100644
index 000000000..64e825d33
--- /dev/null
+++ b/src/bin/e_comp_blur_frosted.h
@@ -0,0 +1,29 @@
+#ifndef E_COMP_BLUR_FROSTED_H
+#define E_COMP_BLUR_FROSTED_H
+
+#include "e.h"
+
+/* E27 frosted glass v2.2: two-phase frame (CAPTURE/PRESENT) driver */
+
+E_API void e_comp_blur_frosted_init(void); /* (re)bind to e_comp->evas */
+E_API void e_comp_blur_frosted_enabled_set(Eina_Bool on); /* master gate (GUI toggle) */
+E_API void e_comp_blur_frosted_all_set(Eina_Bool on); /* frost all visible ARGB clients */
+E_API void e_comp_blur_frosted_client_set(E_Client *ec, Eina_Bool on);
+E_API void e_comp_blur_frosted_strength_set(double k); /* backdrop weight 0..1 */
+E_API void e_comp_blur_frosted_mix_set(int percent);
+E_API void e_comp_blur_frosted_radius_set(int radius);
+/* v2.60-EVASOBJ: mark an Evas_Object (shelf/menu/popup/gadget)
+ * as a frosted-glass surface; its canvas rect is added to the
+ * blur rects alongside E_Client rects in _rects_frames_collect(). */
+E_API void e_comp_blur_frosted_mark(Evas_Object *obj);
+E_API void e_comp_blur_frosted_unmark(Evas_Object *obj);
+
+
+#endif
+
+E_API int e_comp_blur_frosted_diag_hit(int x, int y, int w, int h);
+
+E_API void e_comp_blur_frosted_dirty_mark(void);
+
+E_API void e_client_blur_enable_set(Eina_Bool on, int radius);
+E_API void e_client_blur_apply_all(void);
diff --git a/src/bin/e_comp_blur_kawase.c b/src/bin/e_comp_blur_kawase.c
new file mode 100644
index 000000000..9fbf23572
--- /dev/null
+++ b/src/bin/e_comp_blur_kawase.c
@@ -0,0 +1,465 @@
+#include "e_comp_blur_kawase.h"
+#include <Eina.h>
+#include <Evas.h>
+#include <GLES3/gl3.h>
+
+static GLint _down_hp = -1, _down_tex = -1;
+static GLint _up_hp = -1, _up_tex = -1;
+
+extern unsigned int evas_gl_offscreen_fbo_get(Evas *e, void *surface);
+
+
+#define MAX_ITER 8
+static int _alloc_w[MAX_ITER] = {0}, _alloc_h[MAX_ITER] = {0};
+
+static const char *vs_src =
+ "#version 310 es\n"
+ "layout(location=0) in vec2 pos;\n"
+ "layout(location=1) in vec2 uv;\n"
+ "out vec2 v_uv;\n"
+ "void main(){ gl_Position=vec4(pos,0.0,1.0); v_uv=uv; }\n";
+
+static const char *down_src =
+ "#version 310 es\n"
+ "precision mediump float;\n"
+ "uniform sampler2D tex;\n"
+ "uniform vec2 hp;\n"
+ "in vec2 v_uv;\n"
+ "out vec4 color;\n"
+ "void main(){\n"
+ " vec4 s = texture(tex, v_uv) * 4.0;\n"
+ " s += texture(tex, v_uv - hp);\n"
+ " s += texture(tex, v_uv + hp);\n"
+ " s += texture(tex, v_uv + vec2(hp.x, -hp.y));\n"
+ " s += texture(tex, v_uv - vec2(hp.x, -hp.y));\n"
+ " color = s / 8.0;\n"
+ "}\n";
+
+static const char *up_src =
+ "#version 310 es\n"
+ "precision mediump float;\n"
+ "uniform sampler2D tex;\n"
+ "uniform vec2 hp;\n"
+ "in vec2 v_uv;\n"
+ "out vec4 color;\n"
+ "void main(){\n"
+ " vec4 s = texture(tex, v_uv + vec2(-hp.x*2.0, 0.0));\n"
+ " s += texture(tex, v_uv + vec2(-hp.x, hp.y)) * 2.0;\n"
+ " s += texture(tex, v_uv + vec2(0.0, hp.y*2.0));\n"
+ " s += texture(tex, v_uv + vec2(hp.x, hp.y)) * 2.0;\n"
+ " s += texture(tex, v_uv + vec2(hp.x*2.0, 0.0));\n"
+ " s += texture(tex, v_uv + vec2(hp.x, -hp.y)) * 2.0;\n"
+ " s += texture(tex, v_uv + vec2(0.0, -hp.y*2.0));\n"
+ " s += texture(tex, v_uv + vec2(-hp.x, -hp.y)) * 2.0;\n"
+ " color = s / 12.0;\n"
+ "}\n";
+
+static const char *passthrough_fs =
+ "#version 310 es\n"
+ "precision mediump float;\n"
+ "uniform sampler2D tex;\n"
+ "in vec2 v_uv;\n"
+ "out vec4 color;\n"
+ "void main(){ color = texture(tex, v_uv); }\n";
+
+static GLuint _down = 0, _up = 0, _pass = 0;
+static GLuint _vao = 0, _vbo = 0;
+static GLuint _tex[MAX_ITER] = {0};
+static GLuint _fbo[MAX_ITER] = {0};
+static int _tw[MAX_ITER] = {0}, _th[MAX_ITER] = {0};
+static GLuint _result_tex = 0, _result_fbo = 0;
+static int _result_w = 0, _result_h = 0;
+static int _inited = 0;
+
+static GLuint _compile(GLenum type, const char *src)
+{
+ GLuint s = glCreateShader(type);
+ glShaderSource(s, 1, &src, NULL);
+ glCompileShader(s);
+ GLint ok = 0;
+ glGetShaderiv(s, GL_COMPILE_STATUS, &ok);
+ if (!ok)
+ {
+ char log[1024];
+ glGetShaderInfoLog(s, sizeof(log), NULL, log);
+ EINA_LOG_ERR("kawase shader: %s", log);
+ glDeleteShader(s);
+ return 0;
+ }
+ return s;
+}
+
+static GLuint _link(GLuint vs, GLuint fs)
+{
+ GLuint p = glCreateProgram();
+ glAttachShader(p, vs);
+ glAttachShader(p, fs);
+ glLinkProgram(p);
+ GLint ok = 0;
+ glGetProgramiv(p, GL_LINK_STATUS, &ok);
+ if (!ok)
+ {
+ char log[1024];
+ glGetProgramInfoLog(p, sizeof(log), NULL, log);
+ EINA_LOG_ERR("kawase link: %s", log);
+ glDeleteProgram(p);
+ return 0;
+ }
+ return p;
+}
+
+static void _init(void)
+{
+ if (_inited) return;
+ if (!glGetString(GL_VERSION)) return;
+
+ GLuint vs = _compile(GL_VERTEX_SHADER, vs_src);
+ GLuint fd = _compile(GL_FRAGMENT_SHADER, down_src);
+ GLuint fu = _compile(GL_FRAGMENT_SHADER, up_src);
+ GLuint fp = _compile(GL_FRAGMENT_SHADER, passthrough_fs);
+ if (!vs || !fd || !fu || !fp) return;
+ _down = _link(vs, fd);
+ _up = _link(vs, fu);
+ _pass = _link(vs, fp);
+ glDeleteShader(vs); glDeleteShader(fd); glDeleteShader(fu); glDeleteShader(fp);
+ if (!_down || !_up || !_pass)
+ {
+ FILE *f = (getenv("E27_FG_DEBUG")?fopen("/home/valera/.e-blur-preswap.log", "a"):NULL);
+ if (f) { fprintf(f, "KAWASE _init FAIL down=%u up=%u pass=%u\n",
+ _down, _up, _pass); fclose(f); }
+ return;
+ }
+
+ static const float verts[] = {
+ -1,-1, 0,0, 1,-1, 1,0, -1,1, 0,1, 1,1, 1,1
+ };
+ glGenVertexArrays(1, &_vao);
+ glBindVertexArray(_vao);
+ glGenBuffers(1, &_vbo);
+ glBindBuffer(GL_ARRAY_BUFFER, _vbo);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_STATIC_DRAW);
+ glEnableVertexAttribArray(0);
+ glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 4*sizeof(float), (void*)0);
+ glEnableVertexAttribArray(1);
+ glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 4*sizeof(float), (void*)(2*sizeof(float)));
+ glBindVertexArray(0);
+
+ glGenTextures(MAX_ITER, _tex);
+ glGenFramebuffers(MAX_ITER, _fbo);
+ glGenTextures(1, &_result_tex);
+ glGenFramebuffers(1, &_result_fbo);
+
+ /* perf-2 cache uniform locations */
+ _down_hp = glGetUniformLocation(_down, "hp");
+ _down_tex = glGetUniformLocation(_down, "tex");
+ _up_hp = glGetUniformLocation(_up, "hp");
+ _up_tex = glGetUniformLocation(_up, "tex");
+ _inited = 1;
+}
+
+int
+e_comp_blur_kawase_fullscreen(int src_fbo, int w, int h, int radius)
+{
+
+ if (radius < 1 || w <= 0 || h <= 0) return 0;
+ _init();
+ if (!_inited) return 0;
+
+ int iter = 2 + radius / 10;
+ if (iter > MAX_ITER) iter = MAX_ITER;
+
+ GLint prev_fbo = 0, prev_vp[4] = {0};
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, &prev_fbo);
+ glGetIntegerv(GL_VIEWPORT, prev_vp);
+
+ GLint prev_program, prev_vao, prev_tex, prev_active_tex;
+ GLint prev_blend, prev_blend_src, prev_blend_dst;
+ GLint prev_scissor, prev_scissor_box[4];
+ glGetIntegerv(GL_CURRENT_PROGRAM, &prev_program);
+ glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &prev_vao);
+ glGetIntegerv(GL_ACTIVE_TEXTURE, &prev_active_tex);
+ glActiveTexture(GL_TEXTURE0);
+ glGetIntegerv(GL_TEXTURE_BINDING_2D, &prev_tex);
+ glGetIntegerv(GL_BLEND, &prev_blend);
+ glGetIntegerv(GL_BLEND_SRC_RGB, &prev_blend_src);
+ glGetIntegerv(GL_BLEND_DST_RGB, &prev_blend_dst);
+ glGetIntegerv(GL_SCISSOR_TEST, &prev_scissor);
+ glGetIntegerv(GL_SCISSOR_BOX, prev_scissor_box);
+
+ static GLuint src_tex = 0;
+ static int src_w = 0, src_h = 0;
+ if (src_w != w || src_h != h)
+ {
+ if (src_tex) glDeleteTextures(1, &src_tex);
+ glGenTextures(1, &src_tex);
+ glBindTexture(GL_TEXTURE_2D, src_tex);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ src_w = w; src_h = h;
+ }
+
+ glBindFramebuffer(GL_FRAMEBUFFER, src_fbo);
+ glBindTexture(GL_TEXTURE_2D, src_tex);
+ glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, w, h);
+
+ /* 2. Kawase down */
+ GLuint cur_tex = src_tex;
+ int cw = w, ch = h;
+ glUseProgram(_down);
+ glUniform1i(_down_tex, 0);
+ glDisable(GL_BLEND);
+ glDisable(GL_SCISSOR_TEST);
+ for (int i = 0; i < iter; i++)
+ {
+ int tw = (cw + 1) / 2, th = (ch + 1) / 2;
+ if (_tw[i] != tw || _th[i] != th)
+ {
+ _tw[i] = tw; _th[i] = th;
+ glBindTexture(GL_TEXTURE_2D, _tex[i]);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tw, th, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glBindFramebuffer(GL_FRAMEBUFFER, _fbo[i]);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _tex[i], 0);
+ }
+ glBindFramebuffer(GL_FRAMEBUFFER, _fbo[i]);
+ glViewport(0, 0, tw, th);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, cur_tex);
+ glUniform2f(_down_hp, 0.5f / cw, 0.5f / ch);
+ glBindVertexArray(_vao);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ cur_tex = _tex[i]; cw = tw; ch = th;
+ }
+
+ /* 3. up */
+ glUseProgram(_up);
+ glUniform1i(_up_tex, 0);
+ for (int i = iter - 1; i >= 0; i--)
+ {
+ GLuint dst_fbo;
+ int dw, dh;
+ if (i > 0) { dst_fbo = _fbo[i-1]; dw = _tw[i-1]; dh = _th[i-1]; }
+ else { dst_fbo = _result_fbo; dw = w; dh = h; }
+ if (i == 0)
+ {
+ if (_result_w != w || _result_h != h)
+ {
+ _result_w = w; _result_h = h;
+ glBindTexture(GL_TEXTURE_2D, _result_tex);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glBindFramebuffer(GL_FRAMEBUFFER, _result_fbo);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _result_tex, 0);
+ }
+ }
+ glBindFramebuffer(GL_FRAMEBUFFER, dst_fbo);
+ glViewport(0, 0, dw, dh);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, _tex[i]);
+ glUniform2f(_up_hp, 0.5f / _tw[i], 0.5f / _th[i]);
+ glBindVertexArray(_vao);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ }
+
+ glBindFramebuffer(GL_FRAMEBUFFER, prev_fbo);
+ glViewport(prev_vp[0], prev_vp[1], prev_vp[2], prev_vp[3]);
+
+ glUseProgram(prev_program);
+ glBindVertexArray(prev_vao);
+ glActiveTexture(prev_active_tex);
+ glBindTexture(GL_TEXTURE_2D, prev_tex);
+ if (prev_blend) glEnable(GL_BLEND); else glDisable(GL_BLEND);
+ glBlendFunc(prev_blend_src, prev_blend_dst);
+ if (prev_scissor) glEnable(GL_SCISSOR_TEST); else glDisable(GL_SCISSOR_TEST);
+ glScissor(prev_scissor_box[0], prev_scissor_box[1], prev_scissor_box[2], prev_scissor_box[3]);
+ return 1;
+}
+
+void
+e_comp_blur_kawase_draw_regions(int dst_fbo, int screen_w, int screen_h,
+ int *regions_xywh, int n_regions)
+{
+ if (!_inited || !_result_tex || n_regions <= 0) return;
+
+ GLint prev_fbo = 0, prev_vp[4] = {0};
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, &prev_fbo);
+ glGetIntegerv(GL_VIEWPORT, prev_vp);
+
+ glBindFramebuffer(GL_FRAMEBUFFER, dst_fbo);
+ glViewport(0, 0, screen_w, screen_h);
+ glUseProgram(_pass);
+ glUniform1i(glGetUniformLocation(_pass, "tex"), 0);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, _result_tex);
+
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_SCISSOR_TEST);
+
+ for (int i = 0; i < n_regions; i++)
+ {
+ int x = regions_xywh[i*4 + 0];
+ int y = regions_xywh[i*4 + 1];
+ int w = regions_xywh[i*4 + 2];
+ int h = regions_xywh[i*4 + 3];
+
+ glScissor(x, screen_h - y - h, w, h);
+ glBindVertexArray(_vao);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ }
+
+ glDisable(GL_SCISSOR_TEST);
+ glDisable(GL_BLEND);
+ glBindFramebuffer(GL_FRAMEBUFFER, prev_fbo);
+ glViewport(prev_vp[0], prev_vp[1], prev_vp[2], prev_vp[3]);
+ glBindVertexArray(0);
+ glUseProgram(0);
+}
+
+void
+e_comp_blur_kawase_draw_fullscreen(int dst_fbo, int w, int h)
+{
+ if (!_inited || !_result_tex) return;
+ GLint prev_fbo = 0, prev_vp[4] = {0};
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, &prev_fbo);
+ glGetIntegerv(GL_VIEWPORT, prev_vp);
+
+ glBindFramebuffer(GL_FRAMEBUFFER, dst_fbo);
+ glViewport(0, 0, w, h);
+ glUseProgram(_pass);
+ glUniform1i(glGetUniformLocation(_pass, "tex"), 0);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, _result_tex);
+ glDisable(GL_BLEND);
+ glDisable(GL_SCISSOR_TEST);
+ glBindVertexArray(_vao);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+ glBindFramebuffer(GL_FRAMEBUFFER, prev_fbo);
+ glViewport(prev_vp[0], prev_vp[1], prev_vp[2], prev_vp[3]);
+ glBindVertexArray(0);
+ glUseProgram(0);
+}
+
+/* === Kawase на offscreen FBO (in-place) === */
+void
+e_comp_blur_kawase_offscreen(Evas *e, void *surface, int w, int h, int radius)
+{
+ unsigned int fbo_id;
+ if ((!e) || (!surface) || (w <= 0) || (h <= 0) || (radius < 1))
+
+ fbo_id = evas_gl_offscreen_fbo_get(e, surface);
+ if (!fbo_id) return;
+
+ _init();
+ if (!_inited) return;
+
+ int iter = 2 + radius / 10;
+ if (iter > MAX_ITER) iter = MAX_ITER;
+
+ GLint prev_fbo = 0, prev_vp[4] = {0};
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, &prev_fbo);
+ glGetIntegerv(GL_VIEWPORT, prev_vp);
+
+/* perf-1 glBlitFramebuffer — GPU→GPU, без CPU sync */
+ {
+ int dw0 = (w + 1) / 2, dh0 = (h + 1) / 2;
+ if (_tw[0] != dw0 || _th[0] != dh0)
+ {
+ _tw[0] = dw0; _th[0] = dh0;
+ glBindTexture(GL_TEXTURE_2D, _tex[0]);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, dw0, dh0, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glBindFramebuffer(GL_FRAMEBUFFER, _fbo[0]);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D, _tex[0], 0);
+ }
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo_id);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _fbo[0]);
+ glBlitFramebuffer(0, 0, w, h, 0, 0, dw0, dh0,
+ GL_COLOR_BUFFER_BIT, GL_LINEAR);
+ glBindFramebuffer(GL_FRAMEBUFFER, prev_fbo);
+ }
+
+ GLuint cur_tex = _tex[0];
+ int cw = (w + 1) / 2, ch = (h + 1) / 2;
+ glUseProgram(_down);
+ glUniform1i(_down_tex, 0);
+ glDisable(GL_BLEND);
+ glDisable(GL_SCISSOR_TEST);
+ for (int i = 0; i < iter; i++)
+ {
+ int tw = (cw + 1) / 2, th = (ch + 1) / 2;
+ if (_tw[i] != tw || _th[i] != th)
+ {
+ _tw[i] = tw; _th[i] = th;
+
+ if (tw > _alloc_w[i] || th > _alloc_h[i])
+ {
+ _alloc_w[i] = (tw > _alloc_w[i]) ? tw : _alloc_w[i];
+ _alloc_h[i] = (th > _alloc_h[i]) ? th : _alloc_h[i];
+ glBindTexture(GL_TEXTURE_2D, _tex[i]);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,
+ _alloc_w[i], _alloc_h[i], 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glBindFramebuffer(GL_FRAMEBUFFER, _fbo[i]);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D, _tex[i], 0);
+ }
+ }
+ glBindFramebuffer(GL_FRAMEBUFFER, _fbo[i]);
+ glViewport(0, 0, tw, th);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, cur_tex);
+ glUniform2f(_down_hp, 0.5f / cw, 0.5f / ch);
+ glBindVertexArray(_vao);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ cur_tex = _tex[i]; cw = tw; ch = th;
+ }
+
+ glUseProgram(_up);
+ glUniform1i(_up_tex, 0);
+ for (int i = iter - 1; i >= 0; i--)
+ {
+ GLuint dst_fbo;
+ int dw, dh;
+ if (i > 0) { dst_fbo = _fbo[i-1]; dw = _tw[i-1]; dh = _th[i-1]; }
+ else { dst_fbo = _result_fbo; dw = w; dh = h; }
+ if (i == 0)
+ {
+ if (_result_w != w || _result_h != h)
+ {
+ _result_w = w; _result_h = h;
+ glBindTexture(GL_TEXTURE_2D, _result_tex);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glBindFramebuffer(GL_FRAMEBUFFER, _result_fbo);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _result_tex, 0);
+ }
+ }
+ glBindFramebuffer(GL_FRAMEBUFFER, dst_fbo);
+ glViewport(0, 0, dw, dh);
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, _tex[i]);
+ glUniform2f(_up_hp, 0.5f / _tw[i], 0.5f / _th[i]);
+ glBindVertexArray(_vao);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ }
+
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, _result_fbo);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo_id);
+ glBlitFramebuffer(0, 0, w, h, 0, 0, w, h, GL_COLOR_BUFFER_BIT, GL_NEAREST);
+
+ glBindFramebuffer(GL_FRAMEBUFFER, prev_fbo);
+ glViewport(prev_vp[0], prev_vp[1], prev_vp[2], prev_vp[3]);
+ glBindVertexArray(0);
+ glUseProgram(0);
+}
diff --git a/src/bin/e_comp_blur_kawase.h b/src/bin/e_comp_blur_kawase.h
new file mode 100644
index 000000000..32609ac60
--- /dev/null
+++ b/src/bin/e_comp_blur_kawase.h
@@ -0,0 +1,15 @@
+#ifndef E_COMP_BLUR_KAWASE_H
+#define E_COMP_BLUR_KAWASE_H
+
+#include <Evas.h>
+
+
+int e_comp_blur_kawase_fullscreen(int src_fbo, int w, int h, int radius);
+void e_comp_blur_kawase_draw_regions(int dst_fbo, int screen_w, int screen_h,
+ int *regions_xywh, int n_regions);
+
+int e_comp_blur_kawase_fullscreen(int src_fbo, int w, int h, int radius);
+void e_comp_blur_kawase_draw_fullscreen(int dst_fbo, int w, int h);
+
+void e_comp_blur_kawase_offscreen(Evas *e, void *surface, int w, int h, int radius);
+#endif
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.