summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-10-27 14:31:37 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-10-27 14:58:38 +0900
commitec1acca74d2422165d9bb229043922d3f87a8790 (patch)
tree2907bc7a3471a3b5d207ae53a4ce58b1242ab6a0 /src/lib/evas
parent8329c98d5f5c3b3b8c974f39a461ef22f069c174 (diff)
evas vg: Add FIXME and fix strbuf use
This is the result of a really quick review of the new VG code. Most of it was moved around, but this merge includes the following: - Move logic from edje to evas - Create static lib for common VG handling - Add file_set() API - Add a basic VG cache in evas side - Add savers modules, implement loaders and savers.
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg.c24
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg.eo1
-rw-r--r--src/lib/evas/vg/evas_vg_cache.c1
3 files changed, 11 insertions, 15 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_vg.c b/src/lib/evas/canvas/efl_canvas_vg.c
index 15d0eb21b9..a869308651 100644
--- a/src/lib/evas/canvas/efl_canvas_vg.c
+++ b/src/lib/evas/canvas/efl_canvas_vg.c
@@ -244,22 +244,18 @@ _efl_canvas_vg_viewbox_align_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd, do
244EOLIAN static Eina_Bool 244EOLIAN static Eina_Bool
245_efl_canvas_vg_efl_file_file_set(Eo *obj, Efl_Canvas_Vg_Data *pd, const char *file, const char *key) 245_efl_canvas_vg_efl_file_file_set(Eo *obj, Efl_Canvas_Vg_Data *pd, const char *file, const char *key)
246{ 246{
247 Evas_Cache_Vg_Entry *old_entry;
247 int w, h; 248 int w, h;
248 Evas_Cache_Vg_Entry *entry;
249 249
250 if (!file) return EINA_FALSE; 250 if (!file) return EINA_FALSE;
251 251
252 old_entry = pd->vg_entry;
252 evas_object_geometry_get(obj, NULL, NULL, &w, &h); 253 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
253 entry = evas_cache_vg_entry_find(file, key, w, h); 254 pd->vg_entry = evas_cache_vg_entry_find(file, key, w, h);
254 if (entry != pd->vg_entry) 255 if (pd->vg_entry != old_entry)
255 { 256 evas_object_change(obj, efl_data_scope_get(obj, EFL_CANVAS_OBJECT_CLASS));
256 if (pd->vg_entry) 257 evas_cache_vg_entry_del(old_entry);
257 { 258
258 evas_cache_vg_entry_del(pd->vg_entry);
259 }
260 pd->vg_entry = entry;
261 }
262 evas_object_change(obj, efl_data_scope_get(obj, EFL_CANVAS_OBJECT_CLASS));
263 return EINA_TRUE; 259 return EINA_TRUE;
264} 260}
265 261
@@ -276,7 +272,7 @@ _efl_canvas_vg_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Canvas_Vg_Data *pd, co
276EOLIAN static Eina_Bool 272EOLIAN static Eina_Bool
277_efl_canvas_vg_efl_file_save(const Eo *obj, Efl_Canvas_Vg_Data *pd, const char *file, const char *key, const char *flags) 273_efl_canvas_vg_efl_file_save(const Eo *obj, Efl_Canvas_Vg_Data *pd, const char *file, const char *key, const char *flags)
278{ 274{
279 Vg_File_Data tmp; 275 Vg_File_Data tmp = {};
280 Vg_File_Data *info = &tmp; 276 Vg_File_Data *info = &tmp;
281 277
282 if (pd->vg_entry && pd->vg_entry->file) 278 if (pd->vg_entry && pd->vg_entry->file)
@@ -291,8 +287,7 @@ _efl_canvas_vg_efl_file_save(const Eo *obj, Efl_Canvas_Vg_Data *pd, const char *
291 info->root = pd->root; 287 info->root = pd->root;
292 info->preserve_aspect = EINA_FALSE; 288 info->preserve_aspect = EINA_FALSE;
293 } 289 }
294 evas_vg_save_to_file(info, file, key, flags); 290 return evas_vg_save_to_file(info, file, key, flags);
295 return EINA_TRUE;
296} 291}
297 292
298static void 293static void
@@ -431,7 +426,6 @@ _efl_canvas_vg_render(Evas_Object *eo_obj EINA_UNUSED,
431 { 426 {
432 root = vd->root; 427 root = vd->root;
433 } 428 }
434 //obj->layer->evas->engine.func->ector_begin(output, context,
435 obj->layer->evas->engine.func->ector_begin(engine, context, 429 obj->layer->evas->engine.func->ector_begin(engine, context,
436 ector, surface, 430 ector, surface,
437 vd->engine_data, 431 vd->engine_data,
diff --git a/src/lib/evas/canvas/efl_canvas_vg.eo b/src/lib/evas/canvas/efl_canvas_vg.eo
index c9fee6dd10..398dd6cf2c 100644
--- a/src/lib/evas/canvas/efl_canvas_vg.eo
+++ b/src/lib/evas/canvas/efl_canvas_vg.eo
@@ -73,6 +73,7 @@ class Efl.Canvas.Vg (Efl.Canvas.Object, Efl.File)
73 Efl.Object.constructor; 73 Efl.Object.constructor;
74 Efl.Object.finalize; 74 Efl.Object.finalize;
75 Efl.Object.destructor; 75 Efl.Object.destructor;
76 // FIXME: Implement mmap only (also fix cache keys)
76 Efl.File.file { get; set; } 77 Efl.File.file { get; set; }
77 Efl.File.save; 78 Efl.File.save;
78 } 79 }
diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c
index dae36cc290..aa32a6f826 100644
--- a/src/lib/evas/vg/evas_vg_cache.c
+++ b/src/lib/evas/vg/evas_vg_cache.c
@@ -324,5 +324,6 @@ evas_cache_vg_entry_del(Evas_Cache_Vg_Entry *svg_entry)
324 if (!svg_entry) return; 324 if (!svg_entry) return;
325 325
326 svg_entry->ref--; 326 svg_entry->ref--;
327 // FIXME implement delete logic (LRU)
327} 328}
328 329