}
else
{
- // Create internal buffers if not yet created
- // TIZEN_ONLY(20171110) : Direct rendering render to map fix
- if (!sfc->buffers_allocated)
- {
- if (dbg) DBG("Allocating buffers for sfc %p", sfc);
- if (!_surface_buffers_allocate(eng_data, sfc, sfc->w, sfc->h, ctx->version))
- {
- ERR("Unable Create Specificed Surfaces. Unsupported format!");
- evas_gl_common_error_set(EVAS_GL_BAD_ALLOC);
- return 0;
- }
- sfc->buffers_allocated = 1;
- }
+ if ((sfc->direct_fb_opt) && (!sfc->direct_fallback))
+ {
+ DBG("Not creating fallback surfaces even though it should. Use at OWN discretion!");
+ }
+ else
+ {
+ // Create internal buffers if not yet created
+ if (!sfc->buffers_allocated)
+ {
+ if (dbg) DBG("Allocating buffers for sfc %p", sfc);
+ if (!_surface_buffers_allocate(eng_data, sfc, sfc->w, sfc->h, ctx->version))
+ {
+ ERR("Unable Create Specificed Surfaces. Unsupported format!");
+ evas_gl_common_error_set(EVAS_GL_BAD_ALLOC);
+ return 0;
+ }
+ sfc->buffers_allocated = 1;
+ }
+ }
}
}
else
if ((ctx_changed) || (ctx->current_sfc != sfc) || (rsc->direct.rendered))
{
sfc->current_ctx = ctx;
- // If it's transitioning from direct render to fbo render
- // Call end tiling
- // TIZEN_ONLY(20171110) : Direct rendering render to map fix
- if (rsc->direct.partial.enabled)
- evgl_direct_partial_render_end();
-
- if (!_surface_buffers_fbo_set(sfc, ctx->surface_fbo, ctx->version))
+ if ((sfc->direct_mem_opt) && (sfc->direct_fb_opt) && (!sfc->direct_fallback))
{
- ERR("Attaching buffers to context fbo failed. Engine: %p Surface: %p Context FBO: %u", evgl_engine, sfc, ctx->surface_fbo);
- evas_gl_common_error_set(EVAS_GL_BAD_CONTEXT);
- return 0;
+ DBG("Not creating fallback surfaces even though it should. Use at OWN discretion!");
}
+ else
+ {
+ // If it's transitioning from direct render to fbo render
+ // Call end tiling
+ if (rsc->direct.partial.enabled)
+ evgl_direct_partial_render_end();
- // Bind to the previously bound buffer
+ if (!_surface_buffers_fbo_set(sfc, ctx->surface_fbo, ctx->version))
+ {
+ ERR("Attaching buffers to context fbo failed. Engine: %p Surface: %p Context FBO: %u", evgl_engine, sfc, ctx->surface_fbo);
+ evas_gl_common_error_set(EVAS_GL_BAD_CONTEXT);
+ return 0;
+ }
- if (ctx->version == EVAS_GL_GLES_3_X)
- {
- if (ctx->current_draw_fbo)
- _framebuffer_draw_bind(ctx->current_draw_fbo, ctx->version);
+ // Bind to the previously bound buffer
- if (ctx->current_read_fbo)
- _framebuffer_read_bind(ctx->current_read_fbo, ctx->version);
- }
- else
- {
- if (ctx->current_fbo)
- _framebuffer_bind(ctx->current_fbo, ctx->version);
+ if (ctx->version == EVAS_GL_GLES_3_X)
+ {
+ if (ctx->current_draw_fbo)
+ _framebuffer_draw_bind(ctx->current_draw_fbo, ctx->version);
+
+ if (ctx->current_read_fbo)
+ _framebuffer_read_bind(ctx->current_read_fbo, ctx->version);
+ }
+ else
+ {
+ if (ctx->current_fbo)
+ _framebuffer_bind(ctx->current_fbo, ctx->version);
+ }
}
}
rsc->direct.rendered = 0;
return EINA_TRUE;
}
+// TIZEN_ONLY(20171110) : Skip FBO creation when direct_mem_opt is set, unless direct fallback is set
+void
+evgl_native_surface_direct_fallback_set(Evas_Native_Surface *ns,
+ Eina_Bool direct_fallback)
+{
+ EVGL_Surface *sfc;
+
+ if (!evgl_engine) return EINA_FALSE;
+ if (!ns) return EINA_FALSE;
+
+ if (ns->type == EVAS_NATIVE_SURFACE_EVASGL &&
+ ns->data.evasgl.surface)
+ {
+ sfc = ns->data.evasgl.surface;
+ }
+ else return;
+
+ sfc->direct_fallback = direct_fallback;
+}
+
void
evgl_direct_info_set(int win_w, int win_h, int rot, unsigned int map_tex,
int img_x, int img_y, int img_w, int img_h,