Ector_Surface *ector;
RGBA_Draw_Context *ct;
Eina_Bool async_unref;
+ Eina_Bool error = EINA_FALSE;
// if the size changed in between path set and the draw call;
if (!(svg->w == obj->cur->geometry.w &&
NULL,
svg->w,
svg->h,
- EINA_TRUE);
+ EINA_TRUE, &error);
+ if (error)
+ return; // surface creation error
+
//3. draw into the buffer
ct = evas_common_draw_context_new();
evas_common_draw_context_set_render_op(ct, _EVAS_RENDER_COPY);
{
Evas_VG_Data *vd = type_private_data;
Ector_Surface *ector = evas_ector_get(obj->layer->evas);
+ Eina_Bool error = EINA_FALSE;
// FIXME: Set context (that should affect Ector_Surface) and
// then call Ector_Renderer render from bottom to top. Get the
vd->backing_store,
obj->cur->geometry.w,
obj->cur->geometry.h,
- EINA_FALSE);
+ EINA_FALSE, &error);
+ if (error)
+ return; // surface creation error
+
if (!vd->backing_store)
{
obj->layer->evas->engine.func->ector_begin(output, context, ector, surface,
void (*ector_begin) (void *data, void *context, Ector_Surface *ector, void *surface, int x, int y, Eina_Bool do_async);
void (*ector_renderer_draw) (void *data, void *context, void *surface, Ector_Renderer *r, Eina_Array *clips, Eina_Bool do_async);
void (*ector_end) (void *data, void *context, Ector_Surface *ector, void *surface, Eina_Bool do_async);
- void *(*ector_surface_create) (void *data, void *surface, int w, int h, Eina_Bool force);
+ void *(*ector_surface_create) (void *data, void *surface, int w, int h, Eina_Bool force, int *error);
void (*ector_surface_cache_set) (void *data, void *key, void *surface);
void *(*ector_surface_cache_get) (void *data, void *key);
};
}
static void*
-eng_ector_surface_create(void *data, void *surface, int width, int height, Eina_Bool force EINA_UNUSED)
+eng_ector_surface_create(void *data, void *surface, int width, int height, Eina_Bool force EINA_UNUSED, int *error)
{
Evas_GL_Image *glim;
int cur_w=0 , cur_h=0;
+ *error = EINA_FALSE;
+
if (surface)
{
glim = surface;
}
surface = eng_image_new_from_copied_data(data, width, height, NULL, EINA_TRUE, EVAS_COLORSPACE_ARGB8888);
- //Use this hint for ZERO COPY texture upload.
- if (surface)
- eng_image_content_hint_set(data, surface, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
+ if (!surface)
+ {
+ *error = EINA_TRUE;
+ }
+ else
+ {
+ //Use this hint for ZERO COPY texture upload.
+ eng_image_content_hint_set(data, surface, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
+ }
return surface;
}
}
static void *
-eng_ector_surface_create(void *data, void *surface, int width, int height, Eina_Bool force)
+eng_ector_surface_create(void *data, void *surface, int width, int height, Eina_Bool force, int *error)
{
RGBA_Image *im;
void *pixels = NULL;
int cur_w=0 , cur_h=0;
+ *error = EINA_FALSE;
+
if (!force) return NULL;
if (surface)
{
im = surface;
eng_image_size_get(data, im, &cur_w, &cur_h);
- if ((width != cur_w) || (height == cur_h))
- {
- eng_image_free(data, surface);
- surface = NULL;
- }
+ if ((width == cur_w) && (height == cur_h)) return surface;
+ eng_image_free(data, surface);
+ surface = NULL;
}
- if (!surface)
- surface = eng_image_new_from_copied_data(data, width, height, NULL, EINA_TRUE, EVAS_COLORSPACE_ARGB8888);
+ surface = eng_image_new_from_copied_data(data, width, height, NULL, EINA_TRUE, EVAS_COLORSPACE_ARGB8888);
- im = surface;
- pixels = evas_cache_image_pixels(&im->cache_entry);
- memset(pixels, 0, (width * height * 4));
+ if (!surface)
+ {
+ *error = EINA_TRUE;
+ }
+ else
+ {
+ im = surface;
+ pixels = evas_cache_image_pixels(&im->cache_entry);
+ memset(pixels, 0, (width * height * 4));
+ }
return surface;
}