Changeset View
Changeset View
Standalone View
Standalone View
src/lib/evas/vg/evas_vg_cache.c
Show First 20 Lines • Show All 221 Lines • ▼ Show 20 Line(s) | 207 | { | |||
---|---|---|---|---|---|
222 | else if (vg_entry->root != vfd->root) | 222 | else if (vg_entry->root != vfd->root) | ||
223 | { | 223 | { | ||
224 | if (vg_entry->root) efl_unref(vg_entry->root); | 224 | if (vg_entry->root) efl_unref(vg_entry->root); | ||
225 | vg_entry->root = efl_ref(vfd->root); | 225 | vg_entry->root = efl_ref(vfd->root); | ||
226 | } | 226 | } | ||
227 | } | 227 | } | ||
228 | 228 | | |||
229 | static void | 229 | static void | ||
230 | _local_wrap_transform(Efl_VG *root, Vg_File_Data *vfd) | ||||
231 | { | ||||
232 | Eina_Matrix3 m; | ||||
233 | | ||||
234 | eina_matrix3_identity(&m); | ||||
235 | eina_matrix3_translate(&m, -vfd->bl, -vfd->bt); | ||||
236 | efl_canvas_vg_node_transformation_set(root, &m); | ||||
237 | } | ||||
238 | | ||||
239 | static void | ||||
230 | _local_transform(Efl_VG *root, double w, double h, Vg_File_Data *vfd) | 240 | _local_transform(Efl_VG *root, double w, double h, Vg_File_Data *vfd) | ||
231 | { | 241 | { | ||
232 | double sx = 0, sy= 0, scale; | 242 | double sx = 0, sy= 0, scale; | ||
233 | Eina_Matrix3 m; | 243 | Eina_Matrix3 m; | ||
234 | 244 | | |||
235 | if (!vfd->static_viewbox) return; | 245 | if (!vfd->static_viewbox) return; | ||
236 | if (EINA_DBL_EQ(vfd->view_box.w, w) && EINA_DBL_EQ(vfd->view_box.h, h)) return; | 246 | if (EINA_DBL_EQ(vfd->view_box.w, w) && EINA_DBL_EQ(vfd->view_box.h, h)) return; | ||
237 | 247 | | |||
▲ Show 20 Lines • Show All 271 Lines • ▼ Show 20 Line(s) | 515 | if (!vfd->static_viewbox) | |||
509 | } | 519 | } | ||
510 | 520 | | |||
511 | if (vfd->anim_data) vfd->anim_data->frame_num = frame_num; | 521 | if (vfd->anim_data) vfd->anim_data->frame_num = frame_num; | ||
512 | 522 | | |||
513 | if (!vfd->loader->file_data(vfd)) return NULL; | 523 | if (!vfd->loader->file_data(vfd)) return NULL; | ||
514 | 524 | | |||
515 | _root_update(vg_entry); | 525 | _root_update(vg_entry); | ||
516 | 526 | | |||
517 | _local_transform(vg_entry->root, vg_entry->w, vg_entry->h, vfd); | 527 | if (vfd->is_wrap) | ||
528 | _local_wrap_transform(vg_entry->root, vfd); | ||||
529 | else | ||||
530 | _local_transform(vg_entry->root, vg_entry->w, vg_entry->h, vfd); | ||||
518 | 531 | | |||
519 | return vg_entry->root; | 532 | return vg_entry->root; | ||
520 | } | 533 | } | ||
521 | 534 | | |||
522 | void | 535 | void | ||
523 | evas_cache_vg_entry_value_provider_update(Vg_Cache_Entry *vg_entry, Eina_List *vp_list) | 536 | evas_cache_vg_entry_value_provider_update(Vg_Cache_Entry *vg_entry, Eina_List *vp_list) | ||
524 | { | 537 | { | ||
525 | if (!vg_entry) return; | 538 | if (!vg_entry) return; | ||
Show All 16 Lines | |||||
542 | 555 | | |||
543 | Eina_Size2D | 556 | Eina_Size2D | ||
544 | evas_cache_vg_entry_default_size_get(const Vg_Cache_Entry *vg_entry) | 557 | evas_cache_vg_entry_default_size_get(const Vg_Cache_Entry *vg_entry) | ||
545 | { | 558 | { | ||
546 | if (!vg_entry) return EINA_SIZE2D(0, 0); | 559 | if (!vg_entry) return EINA_SIZE2D(0, 0); | ||
547 | return EINA_SIZE2D(vg_entry->vfd->w, vg_entry->vfd->h); | 560 | return EINA_SIZE2D(vg_entry->vfd->w, vg_entry->vfd->h); | ||
548 | } | 561 | } | ||
549 | 562 | | |||
563 | Eina_Size2D | ||||
564 | evas_cache_vg_entry_default_min_size_get(const Vg_Cache_Entry *vg_entry) | ||||
565 | { | ||||
566 | if (!vg_entry) return EINA_SIZE2D(0, 0); | ||||
567 | return EINA_SIZE2D(vg_entry->vfd->minw, vg_entry->vfd->minh); | ||||
568 | } | ||||
569 | | ||||
570 | Eina_Position2D | ||||
571 | evas_cache_vg_entry_default_position_get(const Vg_Cache_Entry *vg_entry) | ||||
572 | { | ||||
573 | if (!vg_entry) return EINA_POSITION2D(0, 0); | ||||
574 | return EINA_POSITION2D(vg_entry->vfd->bl, vg_entry->vfd->bt); | ||||
575 | } | ||||
576 | | ||||
577 | void | ||||
578 | evas_cache_vg_entry_wrap_mode_set(const Vg_Cache_Entry *vg_entry, Eina_Bool wrap_mode) | ||||
579 | { | ||||
580 | if (!vg_entry) return; | ||||
581 | vg_entry->vfd->is_wrap = wrap_mode; | ||||
582 | } | ||||
583 | | ||||
550 | Eina_Bool | 584 | Eina_Bool | ||
551 | evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info) | 585 | evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info) | ||
552 | { | 586 | { | ||
553 | Vg_File_Data *vfd = | 587 | Vg_File_Data *vfd = | ||
554 | evas_cache_vg_file_open(vg_entry->file, vg_entry->key, vg_entry->evas | 588 | evas_cache_vg_file_open(vg_entry->file, vg_entry->key, vg_entry->evas | ||
555 | ,vg_entry->vfd ? (vg_entry->vfd->vp_list ? EINA_FALSE : EINA_TRUE): EINA_TRUE); | 589 | ,vg_entry->vfd ? (vg_entry->vfd->vp_list ? EINA_FALSE : EINA_TRUE): EINA_TRUE); | ||
556 | 590 | | |||
557 | if (!vfd) return EINA_FALSE; | 591 | if (!vfd) return EINA_FALSE; | ||
Show All 18 Lines |