sfc->pbuffer.color_fmt = cfg->color_format;
sfc->pbuffer.is_pbuffer = EINA_TRUE;
- // Set the context current with resource context/surface
- if (!_internal_resource_make_current(eng_data, NULL))
- {
- ERR("Error doing an internal resource make current");
- goto error;
- }
-
// If the surface is defined as RGB or RGBA, then create an FBO
if (sfc->pbuffer.color_fmt != EVAS_GL_NO_FBO)
{
evas_gl_common_error_set(eng_data, EVAS_GL_BAD_CONFIG);
goto error;
}
-
- // Create internal buffers
- if (!_surface_buffers_create(sfc))
- {
- ERR("Unable Create Specificed Surfaces.");
- evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ALLOC);
- goto error;
- };
-
- // Allocate resources for fallback unless the flag is on
- // Note: we don't care about sfc->direct_mem_opt, as DR makes no sense with PBuffer.
- if (!evgl_engine->direct_mem_opt)
- {
- if (!_surface_buffers_allocate(eng_data, sfc, sfc->w, sfc->h, 0))
- {
- ERR("Unable Create Allocate Memory for Surface.");
- evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ALLOC);
- goto error;
- }
- }
}
- // Not calling make_current
-
pbuffer = evgl_engine->funcs->pbuffer_surface_create
(eng_data, sfc, attrib_list);
sfc->pbuffer.native_surface = pbuffer;
- if (dbg) DBG("Calling make_current(NULL, NULL)");
- if (!evgl_engine->funcs->make_current(eng_data, NULL, NULL, 0))
- {
- ERR("Error doing make_current(NULL, NULL).");
- goto error;
- }
-
// Keep track of all the created surfaces
LKL(evgl_engine->resource_lock);
evgl_engine->surfaces = eina_list_prepend(evgl_engine->surfaces, sfc);
// Allocate or free resources depending on what mode (direct of fbo) it's
// running only if the env var EVAS_GL_DIRECT_MEM_OPT is set.
- if (evgl_engine->direct_mem_opt)
+ if (sfc->direct_mem_opt)
{
if (_evgl_direct_renderable(rsc, sfc))
{
}
else
{
- if (evgl_engine->direct_override)
+ if (sfc->direct_override)
{
DBG("Not creating fallback surfaces even though it should. Use at OWN discretion!");
}
ERR("Unable Create Specificed Surfaces. Unsupported format!");
evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ALLOC);
return 0;
- };
+ }
sfc->buffers_allocated = 1;
}
}
glViewport(ctx->viewport_coord[0], ctx->viewport_coord[1], ctx->viewport_coord[2], ctx->viewport_coord[3]);
if ((ctx->direct_scissor) && (!ctx->scissor_enabled))
glDisable(GL_SCISSOR_TEST);
- }
+ }
ctx->current_fbo = 0;
rsc->direct.rendered = 0;
if ((rsc->current_ctx != ctx) || (ctx->current_sfc != sfc) || (rsc->direct.rendered))
{
sfc->current_ctx = ctx;
- if ((evgl_engine->direct_mem_opt) && (evgl_engine->direct_override))
+ if ((sfc->direct_mem_opt) && (sfc->direct_override))
{
DBG("Not creating fallback surfaces even though it should. Use at OWN discretion!");
}