diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
commit | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch) | |
tree | 52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/WebKit/efl | |
parent | cd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff) | |
download | qtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz |
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/WebKit/efl')
-rw-r--r-- | Source/WebKit/efl/ChangeLog | 196 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_cookies.h | 2 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_frame.cpp | 49 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_frame.h | 2 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_history.cpp | 30 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_main.cpp | 14 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_network.h | 2 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_private.h | 7 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp | 307 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_tiled_backing_store.h | 74 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp | 44 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_tiled_matrix.h | 44 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_tiled_model.cpp | 20 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_tiled_model.h | 43 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_util.h | 2 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_view.cpp | 123 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_view.h | 6 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_view_single.cpp | 14 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_view_tiled.cpp | 32 |
19 files changed, 599 insertions, 412 deletions
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog index dd94c852f..6a52fa252 100644 --- a/Source/WebKit/efl/ChangeLog +++ b/Source/WebKit/efl/ChangeLog @@ -1,3 +1,199 @@ +2012-02-07 Krzysztof Czech <k.czech@samsung.com> + + [EFL] Add missing initialization of editable variable. + https://bugs.webkit.org/show_bug.cgi?id=77948 + + Reviewed by Eric Seidel. + + The value of editable in Ewk_Frame_Smart_Data struct is not set. + + * ewk/ewk_frame.cpp: + (ewk_frame_editable_set): + +2012-02-06 JungJik Lee <jungjik.lee@samsung.com> + + [EFL] Define to prevent a single backing-store application from calling the tiled view function. + https://bugs.webkit.org/show_bug.cgi?id=77842 + + Reviewed by Andreas Kling. + + The define prevents an application using single backing store from calling tiled cache function. + The tiled APIs opened to outer should check the view type before being called. + + * ewk/ewk_private.h: + * ewk/ewk_view.cpp: + (_Ewk_View_Private_Data): + (ewk_view_frame_view_creation_notify): + * ewk/ewk_view_tiled.cpp: + (ewk_view_tiled_unused_cache_get): + (ewk_view_tiled_unused_cache_set): + +2012-02-06 JungJik Lee <jungjik.lee@samsung.com> + + [EFL] Adopt C++ style using camelCase and full variable names. + https://bugs.webkit.org/show_bug.cgi?id=76378 + + Reviewed by Andreas Kling. + + Modify the code to use camelCase and spell out variable names instead of using abbreviations. + Modify the comments which do not match with actual parameters and correct misspelled words. + Adopt EFL Coding style in header files. + The logic of the code is not changed. + + * ewk/ewk_cookies.h: + * ewk/ewk_frame.cpp: + (ewk_frame_selection_get): + (ewk_frame_feed_focus_in): + (EWKPrivate::coreFrame): + * ewk/ewk_frame.h: + * ewk/ewk_history.cpp: + (ewk_history_item_new): + (ewk_history_item_title_get): + (ewk_history_item_title_alternate_get): + (ewk_history_item_uri_get): + (ewk_history_item_uri_original_get): + * ewk/ewk_network.h: + * ewk/ewk_tiled_backing_store.cpp: + (_Ewk_Tiled_Backing_Store_Item): + (_Ewk_Tiled_Backing_Store_Data): + (_ewk_tiled_backing_store_tile_associate): + (_ewk_tiled_backing_store_tile_dissociate): + (_ewk_tiled_backing_store_pre_render_request_clear): + (_ewk_tiled_backing_store_pre_render_request_process_single): + (_ewk_tiled_backing_store_item_fill): + (_ewk_tiled_backing_store_item_add): + (_ewk_tiled_backing_store_item_smooth_scale_set): + (_ewk_tiled_backing_store_view_cols_end_add): + (_ewk_tiled_backing_store_view_rows_all_del): + (_ewk_tiled_backing_store_render): + (_ewk_tiled_backing_store_mem_dbg): + (_ewk_tiled_backing_store_sig_usr): + (_ewk_tiled_backing_store_smart_add): + (_ewk_tiled_backing_store_smart_del): + (_ewk_tiled_backing_store_smart_move): + (_ewk_tiled_backing_store_smart_resize): + (_ewk_tiled_backing_store_recalc_renderers): + (_ewk_tiled_backing_store_view_dbg): + (_ewk_tiled_backing_store_view_wrap_up): + (_ewk_tiled_backing_store_view_wrap_down): + (_ewk_tiled_backing_store_view_wrap_left): + (_ewk_tiled_backing_store_view_refill): + (_ewk_tiled_backing_store_view_pos_apply): + (_ewk_tiled_backing_store_smart_calculate_offset_force): + (_ewk_tiled_backing_store_smart_calculate_offset): + (_ewk_tiled_backing_store_smart_calculate_pos): + (_ewk_tiled_backing_store_smart_calculate): + (_ewk_tiled_backing_store_scroll_full_offset_set_internal): + (ewk_tiled_backing_store_scroll_full_offset_set): + (ewk_tiled_backing_store_scroll_full_offset_add): + (_ewk_tiled_backing_store_zoom_set_internal): + (ewk_tiled_backing_store_zoom_set): + (ewk_tiled_backing_store_zoom_weak_set): + (ewk_tiled_backing_store_fix_offsets): + (ewk_tiled_backing_store_flush): + (ewk_tiled_backing_store_pre_render_region): + (ewk_tiled_backing_store_pre_render_relative_radius): + * ewk/ewk_tiled_backing_store.h: + (_Ewk_Tile): + * ewk/ewk_tiled_matrix.cpp: + (_Ewk_Tile_Matrix): + (_ewk_tile_matrix_cell_free): + (_ewk_tile_matrix_tile_free): + (ewk_tile_matrix_new): + (ewk_tile_matrix_free): + (ewk_tile_matrix_unused_cache_get): + (ewk_tile_matrix_tile_exact_get): + (ewk_tile_matrix_tile_new): + (ewk_tile_matrix_tile_put): + (ewk_tile_matrix_dbg): + (ewk_tile_matrix_freeze): + (ewk_tile_matrix_thaw): + * ewk/ewk_tiled_matrix.h: + * ewk/ewk_tiled_model.cpp: + (tile_account): + (ewk_tile_updates_process): + (ewk_tile_unused_cache_tile_put): + (ewk_tile_unused_cache_dbg): + * ewk/ewk_tiled_model.h: + * ewk/ewk_util.h: + * ewk/ewk_view.cpp: + (_Ewk_View_Private_Data): + (_ewk_view_smart_focus_in): + (_ewk_view_smart_pre_render_region): + (ewk_view_pre_render_region): + (ewk_view_toolbars_visible_get): + (ewk_view_statusbar_visible_get): + (ewk_view_scrollbars_visible_get): + (ewk_view_menubar_visible_get): + (ewk_view_zoom_range_set): + * ewk/ewk_view.h: + * ewk/ewk_view_single.cpp: + (_ewk_view_single_smart_repaints_process): + * ewk/ewk_view_tiled.cpp: + (_ewk_view_tiled_smart_backing_store_add): + (_ewk_view_tiled_smart_add): + (ewk_view_tiled_unused_cache_get): + (ewk_view_tiled_unused_cache_set): + +2012-02-05 ChangSeok Oh <shivamidow@gmail.com> + + [EFL] Enable WebGL with glx backend + https://bugs.webkit.org/show_bug.cgi?id=77308 + + Reviewed by Martin Robinson. + + Activated WebGL feature. + + * ewk/ewk_view.cpp: + (_Ewk_View_Private_Data): + (_ewk_view_priv_new): + +2012-02-05 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + [EFL] Remove g_thread_init() calls + https://bugs.webkit.org/show_bug.cgi?id=77828 + + Reviewed by Andreas Kling. + + g_thread_init has been deprecated since glib 2.32. This function is no longer necessary. + The GLib threading system is automatically initialized at the start of your program. + + * ewk/ewk_main.cpp: + (_ewk_init_body): + +2012-02-02 KwangHyuk Kim <hyuki.kim@samsung.com> + + [EFL] Add contentsSize flag into ewk_tiled_backing_store's private data. + https://bugs.webkit.org/show_bug.cgi?id=77586 + + Reviewed by Andreas Kling. + + As both zoom and content size change are identified by model flag, + ewk_tiled_backing_store can not detect the conflict between them. + In order to prevent conflict between zoom and contents size change, + contentsSize flag is newly added. + + * ewk/ewk_tiled_backing_store.cpp: + (_Ewk_Tiled_Backing_Store_Item): + (_Ewk_Tiled_Backing_Store_Data): + (_ewk_tiled_backing_store_smart_calculate): + (ewk_tiled_backing_store_contents_resize): + +2012-02-02 Raphael Kubo da Costa <kubo@profusion.mobi> + + [EFL] Remove check for ENABLE_GTK_PLUGINS_SUPPORT + https://bugs.webkit.org/show_bug.cgi?id=77647 + + Reviewed by Martin Robinson. + + There is no clear reason why this check was in place (it came with the + upstreaming of the port), but ENABLE_GTK_PLUGINS_SUPPORT is not set + anywhere, and the build system does not even check for the presence of + GTK+ when building. + + * ewk/ewk_main.cpp: + (_ewk_init_body): + 2012-01-31 Ryuan Choi <ryuan.choi@samsung.com> [EFL] Add basic DRT/Efl implementation to support viewport test. diff --git a/Source/WebKit/efl/ewk/ewk_cookies.h b/Source/WebKit/efl/ewk/ewk_cookies.h index acd15596f..40e69d56c 100644 --- a/Source/WebKit/efl/ewk/ewk_cookies.h +++ b/Source/WebKit/efl/ewk/ewk_cookies.h @@ -95,7 +95,7 @@ EAPI void ewk_cookies_clear(void); * * @return an @c Eina_List with all the cookies in the cookie jar */ -EAPI Eina_List* ewk_cookies_get_all(void); +EAPI Eina_List *ewk_cookies_get_all(void); /** * Deletes a cookie from the cookie jar. diff --git a/Source/WebKit/efl/ewk/ewk_frame.cpp b/Source/WebKit/efl/ewk/ewk_frame.cpp index 961fa0b1d..8dc140150 100644 --- a/Source/WebKit/efl/ewk/ewk_frame.cpp +++ b/Source/WebKit/efl/ewk/ewk_frame.cpp @@ -86,28 +86,28 @@ struct Eina_Iterator_Ewk_Frame { #ifndef EWK_TYPE_CHECK #define EWK_FRAME_TYPE_CHECK(ewkFrame, ...) do { } while (0) #else -#define EWK_FRAME_TYPE_CHECK(ewkFrame, ...) \ - do { \ - const char* _tmp_otype = evas_object_type_get(ewkFrame); \ - if (EINA_UNLIKELY(_tmp_otype != EWK_FRAME_TYPE_STR)) { \ - EINA_LOG_CRIT \ - ("%p (%s) is not of an ewk_frame!", ewkFrame, \ - _tmp_otype ? _tmp_otype : "(null)"); \ - return __VA_ARGS__; \ - } \ +#define EWK_FRAME_TYPE_CHECK(ewkFrame, ...) \ + do { \ + const char* _tmp_otype = evas_object_type_get(ewkFrame); \ + if (EINA_UNLIKELY(_tmp_otype != EWK_FRAME_TYPE_STR)) { \ + EINA_LOG_CRIT \ + ("%p (%s) is not of an ewk_frame!", ewkFrame, \ + _tmp_otype ? _tmp_otype : "(null)"); \ + return __VA_ARGS__; \ + } \ } while (0) #endif -#define EWK_FRAME_SD_GET(ewkFrame, ptr) \ - Ewk_Frame_Smart_Data* ptr = static_cast<Ewk_Frame_Smart_Data*>(evas_object_smart_data_get(ewkFrame)) +#define EWK_FRAME_SD_GET(ewkFrame, pointer) \ + Ewk_Frame_Smart_Data* pointer = static_cast<Ewk_Frame_Smart_Data*>(evas_object_smart_data_get(ewkFrame)) -#define EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, ptr, ...) \ - EWK_FRAME_TYPE_CHECK(ewkFrame, __VA_ARGS__); \ - EWK_FRAME_SD_GET(ewkFrame, ptr); \ - if (!ptr) { \ - CRITICAL("no smart data for object %p (%s)", \ - ewkFrame, evas_object_type_get(ewkFrame)); \ - return __VA_ARGS__; \ +#define EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, pointer, ...) \ + EWK_FRAME_TYPE_CHECK(ewkFrame, __VA_ARGS__); \ + EWK_FRAME_SD_GET(ewkFrame, pointer); \ + if (!pointer) { \ + CRITICAL("no smart data for object %p (%s)", \ + ewkFrame, evas_object_type_get(ewkFrame)); \ + return __VA_ARGS__; \ } static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL; @@ -459,6 +459,7 @@ Eina_Bool ewk_frame_editable_set(Evas_Object* ewkFrame, Eina_Bool editable) editable = !!editable; if (smartData->editable == editable) return true; + smartData->editable = editable; if (editable) smartData->frame->editor()->applyEditingStyleToBodyElement(); return true; @@ -468,10 +469,10 @@ char* ewk_frame_selection_get(const Evas_Object* ewkFrame) { EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, 0); - WTF::CString s = smartData->frame->editor()->selectedText().utf8(); - if (s.isNull()) + WTF::CString selectedText = smartData->frame->editor()->selectedText().utf8(); + if (selectedText.isNull()) return 0; - return strdup(s.data()); + return strdup(selectedText.data()); } Eina_Bool ewk_frame_text_search(const Evas_Object* ewkFrame, const char* text, Eina_Bool caseSensitive, Eina_Bool forward, Eina_Bool wrap) @@ -834,8 +835,8 @@ Eina_Bool ewk_frame_feed_focus_in(Evas_Object* ewkFrame) { EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false); EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false); - WebCore::FocusController* c = smartData->frame->page()->focusController(); - c->setFocusedFrame(smartData->frame); + WebCore::FocusController* focusController = smartData->frame->page()->focusController(); + focusController->setFocusedFrame(smartData->frame); return true; } @@ -1774,7 +1775,7 @@ void ewk_frame_mixed_content_run_set(Evas_Object* ewkFrame, bool hasRun) namespace EWKPrivate { -WebCore::Frame *coreFrame(const Evas_Object *ewkFrame) +WebCore::Frame* coreFrame(const Evas_Object* ewkFrame) { EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, 0); return smartData->frame; diff --git a/Source/WebKit/efl/ewk/ewk_frame.h b/Source/WebKit/efl/ewk/ewk_frame.h index 0df8c51f5..f74555e5a 100644 --- a/Source/WebKit/efl/ewk/ewk_frame.h +++ b/Source/WebKit/efl/ewk/ewk_frame.h @@ -857,7 +857,7 @@ EAPI Eina_List *ewk_frame_resources_location_get(const Evas_Object *o); * @return A newly allocated string (which must be freed by the caller with @c free()) * or @c 0 in case of failure. */ -EAPI char* ewk_frame_plain_text_get(const Evas_Object* o); +EAPI char *ewk_frame_plain_text_get(const Evas_Object *o); /** * Returns whether the frame has displayed mixed content. diff --git a/Source/WebKit/efl/ewk/ewk_history.cpp b/Source/WebKit/efl/ewk/ewk_history.cpp index a39875911..faef0c805 100644 --- a/Source/WebKit/efl/ewk/ewk_history.cpp +++ b/Source/WebKit/efl/ewk/ewk_history.cpp @@ -255,9 +255,9 @@ Ewk_History_Item* ewk_history_item_new_from_core(WebCore::HistoryItem* core) Ewk_History_Item* ewk_history_item_new(const char* uri, const char* title) { - WTF::String u = WTF::String::fromUTF8(uri); - WTF::String t = WTF::String::fromUTF8(title); - WTF::RefPtr<WebCore::HistoryItem> core = WebCore::HistoryItem::create(u, t, 0); + WTF::String historyUri = WTF::String::fromUTF8(uri); + WTF::String historyTitle = WTF::String::fromUTF8(title); + WTF::RefPtr<WebCore::HistoryItem> core = WebCore::HistoryItem::create(historyUri, historyTitle, 0); Ewk_History_Item* item = ewk_history_item_new_from_core(core.release().leakRef()); return item; } @@ -287,19 +287,19 @@ const char* ewk_history_item_title_get(const Ewk_History_Item* item) { EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); // hide the following optimzation from outside - Ewk_History_Item* item1 = const_cast<Ewk_History_Item*>(item); - eina_stringshare_replace(&item1->title, core->title().utf8().data()); - return item1->title; + Ewk_History_Item* historyItem = const_cast<Ewk_History_Item*>(item); + eina_stringshare_replace(&historyItem->title, core->title().utf8().data()); + return historyItem->title; } const char* ewk_history_item_title_alternate_get(const Ewk_History_Item* item) { EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); // hide the following optimzation from outside - Ewk_History_Item* item1 = const_cast<Ewk_History_Item*>(item); - eina_stringshare_replace(&item1->alternateTitle, + Ewk_History_Item* historyItem = const_cast<Ewk_History_Item*>(item); + eina_stringshare_replace(&historyItem->alternateTitle, core->alternateTitle().utf8().data()); - return item1->alternateTitle; + return historyItem->alternateTitle; } void ewk_history_item_title_alternate_set(Ewk_History_Item* item, const char* title) @@ -314,19 +314,19 @@ const char* ewk_history_item_uri_get(const Ewk_History_Item* item) { EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); // hide the following optimzation from outside - Ewk_History_Item* i = const_cast<Ewk_History_Item*>((item)); - eina_stringshare_replace(&i->uri, core->urlString().utf8().data()); - return i->uri; + Ewk_History_Item* historyItem = const_cast<Ewk_History_Item*>((item)); + eina_stringshare_replace(&historyItem->uri, core->urlString().utf8().data()); + return historyItem->uri; } const char* ewk_history_item_uri_original_get(const Ewk_History_Item* item) { EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); // hide the following optimzation from outside - Ewk_History_Item* i = const_cast<Ewk_History_Item*>(item); - eina_stringshare_replace(&i->originalUri, + Ewk_History_Item* historyItem = const_cast<Ewk_History_Item*>(item); + eina_stringshare_replace(&historyItem->originalUri, core->originalURLString().utf8().data()); - return i->originalUri; + return historyItem->originalUri; } double ewk_history_item_time_last_visited_get(const Ewk_History_Item* item) diff --git a/Source/WebKit/efl/ewk/ewk_main.cpp b/Source/WebKit/efl/ewk/ewk_main.cpp index e821a4a18..cead2de72 100644 --- a/Source/WebKit/efl/ewk/ewk_main.cpp +++ b/Source/WebKit/efl/ewk/ewk_main.cpp @@ -44,11 +44,6 @@ #if ENABLE(GLIB_SUPPORT) #include <glib-object.h> #include <glib.h> - -#ifdef ENABLE_GTK_PLUGINS_SUPPORT -#include <gtk/gtk.h> -#endif - #endif #if USE(SOUP) @@ -146,15 +141,6 @@ Eina_Bool _ewk_init_body(void) #if ENABLE(GLIB_SUPPORT) g_type_init(); - if (!g_thread_supported()) - g_thread_init(0); - -#ifdef ENABLE_GTK_PLUGINS_SUPPORT - gdk_threads_init(); - if (!gtk_init_check(0, 0)) - WRN("Could not initialize GTK support."); -#endif - if (!ecore_main_loop_glib_integrate()) WRN("Ecore was not compiled with GLib support, some plugins will not " "work (ie: Adobe Flash)"); diff --git a/Source/WebKit/efl/ewk/ewk_network.h b/Source/WebKit/efl/ewk/ewk_network.h index 612c2f7ce..3977e9978 100644 --- a/Source/WebKit/efl/ewk/ewk_network.h +++ b/Source/WebKit/efl/ewk/ewk_network.h @@ -119,7 +119,7 @@ EAPI void ewk_network_tls_ca_certificates_path_set(const char *path) * @return The default @c SoupSession in use, or @c NULL if another network * backend was used. */ -EAPI SoupSession* ewk_network_default_soup_session_get(void); +EAPI SoupSession *ewk_network_default_soup_session_get(void); #ifdef __cplusplus } diff --git a/Source/WebKit/efl/ewk/ewk_private.h b/Source/WebKit/efl/ewk/ewk_private.h index bbff734fc..b4a8dd936 100644 --- a/Source/WebKit/efl/ewk/ewk_private.h +++ b/Source/WebKit/efl/ewk/ewk_private.h @@ -62,6 +62,13 @@ struct _Ewk_JS_Object { const char ewkViewTiledName[] = "Ewk_View_Tiled"; const char ewkViewSingleName[] = "Ewk_View_Single"; +// Define to prevent an application using different view type from calling the function. +#define EWK_VIEW_TYPE_CHECK_OR_RETURN(ewkView, viewName, ...) \ + if (!evas_object_smart_type_check(ewkView, viewName)) { \ + INF("ewkView isn't an instance of %s", viewName); \ + return __VA_ARGS__; \ + } + // forward declarations namespace WebCore { struct PopupMenuClient; diff --git a/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp b/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp index 4cdd72d85..e0dde4d74 100644 --- a/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp +++ b/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp @@ -33,7 +33,7 @@ #include <stdlib.h> #include <string.h> -#define IDX(col, row, rowspan) (col + (row * rowspan)) +#define IDX(column, row, rowspan) (column + (row * rowspan)) typedef struct _Ewk_Tiled_Backing_Store_Data Ewk_Tiled_Backing_Store_Data; typedef struct _Ewk_Tiled_Backing_Store_Item Ewk_Tiled_Backing_Store_Item; @@ -45,7 +45,7 @@ struct _Ewk_Tiled_Backing_Store_Item { struct { Evas_Coord x, y, width, height; } geometry; - bool smooth_scale; + bool smoothScale; }; struct _Ewk_Tiled_Backing_Store_Pre_Render_Request { @@ -61,7 +61,7 @@ struct _Ewk_Tiled_Backing_Store_Data { struct { Eina_Inlist** items; Evas_Coord x, y, width, height; - long cols, rows; + long columns, rows; struct { Evas_Coord width, height; float zoom; @@ -71,7 +71,7 @@ struct _Ewk_Tiled_Backing_Store_Data { struct { struct { Evas_Coord x, y; - } cur, old, base, zoomCenter; + } current, old, base, zoomCenter; } offset; bool visible : 1; } view; @@ -106,20 +106,21 @@ struct _Ewk_Tiled_Backing_Store_Data { bool size : 1; bool model : 1; bool offset : 1; + bool contentsSize : 1; } changed; #ifdef DEBUG_MEM_LEAKS - Ecore_Event_Handler* sig_usr; + Ecore_Event_Handler* signalUser; #endif }; static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL; int _ewk_tiled_log_dom = -1; -#define PRIV_DATA_GET_OR_RETURN(obj, ptr, ...) \ +#define PRIV_DATA_GET_OR_RETURN(obj, ptr, ...) \ Ewk_Tiled_Backing_Store_Data* ptr = static_cast<Ewk_Tiled_Backing_Store_Data*>(evas_object_smart_data_get(obj)); \ - if (!ptr) { \ - CRITICAL("no private data in obj=%p", obj); \ - return __VA_ARGS__; \ + if (!ptr) { \ + CRITICAL("no private data in obj=%p", obj); \ + return __VA_ARGS__; \ } static void _ewk_tiled_backing_store_fill_renderers(Ewk_Tiled_Backing_Store_Data* priv); @@ -203,13 +204,13 @@ static void _ewk_tiled_backing_store_item_resize(Ewk_Tiled_Backing_Store_Item* i static void _ewk_tiled_backing_store_tile_associate(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tile* tile, Ewk_Tiled_Backing_Store_Item* item) { if (item->tile) - CRITICAL("it->tile=%p, but it should be 0!", item->tile); + CRITICAL("item->tile=%p, but it should be 0!", item->tile); item->tile = tile; evas_object_move(item->tile->image, item->geometry.x, item->geometry.y); evas_object_resize(item->tile->image, item->geometry.width, item->geometry.height); evas_object_image_fill_set (item->tile->image, 0, 0, item->geometry.width, item->geometry.height); - evas_object_image_smooth_scale_set(item->tile->image, item->smooth_scale); + evas_object_image_smooth_scale_set(item->tile->image, item->smoothScale); evas_object_image_alpha_set(item->tile->image, priv->view.tile.hasAlpha); if (!ewk_tile_visible_get(tile)) @@ -220,13 +221,13 @@ static void _ewk_tiled_backing_store_tile_associate(Ewk_Tiled_Backing_Store_Data static void _ewk_tiled_backing_store_tile_dissociate(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tiled_Backing_Store_Item* item, double lastUsed) { - Ewk_Tile_Unused_Cache* tiledUnusedCache; + Ewk_Tile_Unused_Cache* tileUnusedCache; ewk_tile_hide(item->tile); if (!ewk_tile_visible_get(item->tile)) evas_object_smart_member_del(item->tile->image); ewk_tile_matrix_tile_put(priv->model.matrix, item->tile, lastUsed); - tiledUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix); - ewk_tile_unused_cache_auto_flush(tiledUnusedCache); + tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix); + ewk_tile_unused_cache_auto_flush(tileUnusedCache); item->tile = 0; } @@ -292,26 +293,26 @@ static void _ewk_tiled_backing_store_pre_render_request_flush(Ewk_Tiled_Backing_ static void _ewk_tiled_backing_store_pre_render_request_clear(Ewk_Tiled_Backing_Store_Data* priv) { Eina_Inlist** preRenderList = &priv->render.preRenderRequests; - Eina_Inlist* iter = *preRenderList, *tmp; + Eina_Inlist* iter = *preRenderList, *next; while (iter) { Ewk_Tiled_Backing_Store_Pre_Render_Request* request = EINA_INLIST_CONTAINER_GET( iter, Ewk_Tiled_Backing_Store_Pre_Render_Request); - tmp = iter->next; + next = iter->next; *preRenderList = eina_inlist_remove(*preRenderList, iter); - iter = tmp; + iter = next; free(request); } } -/* assumes priv->process.pre_cb was called if required! */ +/* assumes priv->process.preCallback was called if required! */ static void _ewk_tiled_backing_store_pre_render_request_process_single(Ewk_Tiled_Backing_Store_Data* priv) { Ewk_Tiled_Backing_Store_Pre_Render_Request* request; Eina_Rectangle area; Ewk_Tile_Matrix* tileMatrix = priv->model.matrix; Ewk_Tile* tile; - Ewk_Tile_Unused_Cache* tiledUnusedCache; + Ewk_Tile_Unused_Cache* tileUnusedCache; unsigned long column, row; float zoom; double last_used = ecore_loop_time_get(); @@ -348,8 +349,8 @@ static void _ewk_tiled_backing_store_pre_render_request_process_single(Ewk_Tiled end: _ewk_tiled_backing_store_pre_render_request_del(priv, request); - tiledUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix); - ewk_tile_unused_cache_auto_flush(tiledUnusedCache); + tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix); + ewk_tile_unused_cache_auto_flush(tileUnusedCache); } static Eina_Bool _ewk_tiled_backing_store_item_process_idler_cb(void* data) @@ -430,18 +431,18 @@ static inline Eina_Bool _ewk_tiled_backing_store_item_fill(Ewk_Tiled_Backing_Sto if (item->tile) { Ewk_Tile* old = item->tile; - if (old->row != currentRow || old->col != currentColumn || old->zoom != zoom) + if (old->row != currentRow || old->column != currentColumn || old->zoom != zoom) _ewk_tiled_backing_store_tile_dissociate(priv, item, lastUsed); - else if (old->row == currentRow && old->col == currentColumn && old->zoom == zoom) + else if (old->row == currentRow && old->column == currentColumn && old->zoom == zoom) goto end; } tile = ewk_tile_matrix_tile_exact_get(priv->model.matrix, currentColumn, currentRow, zoom); if (!tile) { - /* NOTE: it never returns 0 if it->tile was set! */ + /* NOTE: it never returns 0 if item->tile was set! */ if (item->tile) { - CRITICAL("it->tile=%p, but it should be 0!", item->tile); + CRITICAL("item->tile=%p, but it should be 0!", item->tile); _ewk_tiled_backing_store_tile_dissociate(priv, item, lastUsed); } @@ -473,7 +474,7 @@ static Ewk_Tiled_Backing_Store_Item* _ewk_tiled_backing_store_item_add(Ewk_Tiled Ewk_Tiled_Backing_Store_Item* item; Evas_Coord x, y, tileWidth, tileHeight; - DBG("ewkBackingStore%p", priv->self); + DBG("ewkBackingStore=%p", priv->self); item = static_cast<Ewk_Tiled_Backing_Store_Item*>(malloc(sizeof(*item))); if (!item) @@ -481,12 +482,12 @@ static Ewk_Tiled_Backing_Store_Item* _ewk_tiled_backing_store_item_add(Ewk_Tiled tileWidth = priv->view.tile.width; tileHeight = priv->view.tile.height; - x = priv->view.offset.base.x + priv->view.x + tileWidth *column; - y = priv->view.offset.base.y + priv->view.y + tileHeight *row; + x = priv->view.offset.base.x + priv->view.x + tileWidth * column; + y = priv->view.offset.base.y + priv->view.y + tileHeight * row; item->tile = 0; - item->smooth_scale = priv->view.tile.zoomWeakSmoothScale; + item->smoothScale = priv->view.tile.zoomWeakSmoothScale; _ewk_tiled_backing_store_item_move(item, x, y); _ewk_tiled_backing_store_item_resize(item, tileWidth, tileHeight); if (!_ewk_tiled_backing_store_item_fill(priv, item, column, row)) { @@ -509,7 +510,7 @@ static void _ewk_tiled_backing_store_item_del(Ewk_Tiled_Backing_Store_Data* priv static void _ewk_tiled_backing_store_item_smooth_scale_set(Ewk_Tiled_Backing_Store_Item* item, Eina_Bool smoothScale) { - if (item->smooth_scale == smoothScale) + if (item->smoothScale == smoothScale) return; if (item->tile) @@ -548,16 +549,16 @@ static Eina_Bool _ewk_tiled_backing_store_view_cols_end_add(Ewk_Tiled_Backing_St unsigned int i, row = rowList - priv->view.items; for (i = 0; i < count; i++, baseColumn++) { - Ewk_Tiled_Backing_Store_Item* it; + Ewk_Tiled_Backing_Store_Item* item; - it = _ewk_tiled_backing_store_item_add(priv, baseColumn, row); - if (!it) { + item = _ewk_tiled_backing_store_item_add(priv, baseColumn, row); + if (!item) { CRITICAL("failed to add column %u of %u in row %u.", i, count, row); _ewk_tiled_backing_store_view_cols_end_del(priv, rowList, i); return false; } - *rowList = eina_inlist_append(*rowList, EINA_INLIST_GET(it)); + *rowList = eina_inlist_append(*rowList, EINA_INLIST_GET(item)); } return true; } @@ -591,7 +592,7 @@ static void _ewk_tiled_backing_store_view_rows_all_del(Ewk_Tiled_Backing_Store_D free(priv->view.items); priv->view.items = 0; - priv->view.cols = 0; + priv->view.columns = 0; priv->view.rows = 0; } @@ -600,7 +601,7 @@ static void _ewk_tiled_backing_store_render(void* data, Ewk_Tile* tile, const Ei Ewk_Tiled_Backing_Store_Data* priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(data); INF("TODO %p (visible? %d) [%lu,%lu] %d,%d + %dx%d", - tile, tile->visible, tile->col, tile->row, area->x, area->y, area->w, area->h); + tile, tile->visible, tile->column, tile->row, area->x, area->y, area->w, area->h); if (!tile->visible) return; @@ -657,7 +658,7 @@ static void _ewk_tiled_backing_store_mem_dbg(Ewk_Tiled_Backing_Store_Data* priv) run++; printf("\n--- BEGIN DEBUG TILED BACKING STORE MEMORY [%d] --\n" - "t=%0.2f, obj=%p, priv=%p, view.items=%p, matrix=%p\n", + "tile=%0.2f, obj=%p, priv=%p, view.items=%p, matrix=%p\n", run, ecore_loop_time_get(), priv->self, priv, priv->view.items, priv->model.matrix); @@ -669,13 +670,13 @@ static void _ewk_tiled_backing_store_mem_dbg(Ewk_Tiled_Backing_Store_Data* priv) static Eina_Bool _ewk_tiled_backing_store_sig_usr(void* data, int type, void* event) { - Ecore_Event_Signal_User* sig = (Ecore_Event_Signal_User*)event; + Ecore_Event_Signal_User* signalUser = (Ecore_Event_Signal_User*)event; Ewk_Tiled_Backing_Store_Data* priv = (Ewk_Tiled_Backing_Store_Data*)data; - if (sig->number == 2) { - Ewk_Tile_Unused_Cache* tilieUnusedCache; - tilieUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix); - ewk_tile_unused_cache_auto_flush(tilieUnusedCache); + if (signalUser->number == 2) { + Ewk_Tile_Unused_Cache* tileUnusedCache; + tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix); + ewk_tile_unused_cache_auto_flush(tileUnusedCache); } _ewk_tiled_backing_store_view_dbg(priv); @@ -698,8 +699,8 @@ static void _ewk_tiled_backing_store_smart_add(Evas_Object* ewkBackingStore) priv->view.tile.zoom = 1.0; priv->view.tile.width = defaultTileWidth; priv->view.tile.height = defaultTileHeigth; - priv->view.offset.cur.x = 0; - priv->view.offset.cur.y = 0; + priv->view.offset.current.x = 0; + priv->view.offset.current.y = 0; priv->view.offset.old.x = 0; priv->view.offset.old.y = 0; priv->view.offset.base.x = 0; @@ -734,7 +735,7 @@ static void _ewk_tiled_backing_store_smart_add(Evas_Object* ewkBackingStore) evas_object_clip_set(priv->contentsClipper, priv->base.clipper); #ifdef DEBUG_MEM_LEAKS - priv->sig_usr = ecore_event_handler_add + priv->signalUser = ecore_event_handler_add (ECORE_EVENT_SIGNAL_USER, _ewk_tiled_backing_store_sig_usr, priv); #endif } @@ -742,7 +743,7 @@ static void _ewk_tiled_backing_store_smart_add(Evas_Object* ewkBackingStore) static void _ewk_tiled_backing_store_smart_del(Evas_Object* ewkBackingStore) { PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv); - DBG("ewkBackingStore%p", ewkBackingStore); + DBG("ewkBackingStore=%p", ewkBackingStore); Ewk_Tile_Unused_Cache* tileUnusedCache; tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix); @@ -774,7 +775,7 @@ static void _ewk_tiled_backing_store_smart_del(Evas_Object* ewkBackingStore) static void _ewk_tiled_backing_store_smart_move(Evas_Object* ewkBackingStore, Evas_Coord x, Evas_Coord y) { - DBG("ewkBackingStore%p, new pos: %dx%d", ewkBackingStore, x, y); + DBG("ewkBackingStore=%p, new pos: %dx%d", ewkBackingStore, x, y); PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv); @@ -790,7 +791,7 @@ static void _ewk_tiled_backing_store_smart_move(Evas_Object* ewkBackingStore, Ev static void _ewk_tiled_backing_store_smart_resize(Evas_Object* ewkBackingStore, Evas_Coord width, Evas_Coord height) { - DBG("ewkBackingStore%p, new size: %dx%d", ewkBackingStore, width, height); + DBG("ewkBackingStore=%p, new size: %dx%d", ewkBackingStore, width, height); PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv); @@ -824,18 +825,18 @@ static void _ewk_tiled_backing_store_smart_hide(Evas_Object* ewkBackingStore) static void _ewk_tiled_backing_store_recalc_renderers(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord width, Evas_Coord height, Evas_Coord tileWidth, Evas_Coord tileHeight) { long columns, rows, oldRows, oldCols; - INF("ewkBackingStore%p, new size: %dx%d", priv->self, width, height); + INF("ewkBackingStore=%p, new size: %dx%d", priv->self, width, height); columns = 1 + static_cast<int>(ceil(width / static_cast<float>(tileWidth))); rows = 1 + static_cast<int>(ceil(height / static_cast<float>(tileHeight))); - INF("ewkBackingStore%p new grid size cols: %ld, rows: %ld, was %ld, %ld", - priv->self, columns, rows, priv->view.cols, priv->view.rows); + INF("ewkBackingStore=%p new grid size columns: %ld, rows: %ld, was %ld, %ld", + priv->self, columns, rows, priv->view.columns, priv->view.rows); - if (priv->view.cols == columns && priv->view.rows == rows) + if (priv->view.columns == columns && priv->view.rows == rows) return; - oldCols = priv->view.cols; + oldCols = priv->view.columns; oldRows = priv->view.rows; if (rows < oldRows) { @@ -851,14 +852,14 @@ static void _ewk_tiled_backing_store_recalc_renderers(Ewk_Tiled_Backing_Store_Da priv->view.items = static_cast<Eina_Inlist**>(newItems); priv->view.rows = rows; - priv->view.cols = columns; + priv->view.columns = columns; if (rows > oldRows) { Eina_Inlist** start = priv->view.items + oldRows; Eina_Inlist** end = priv->view.items + rows; for (; start < end; start++) { *start = 0; - Eina_Bool r = _ewk_tiled_backing_store_view_cols_end_add(priv, start, 0, columns); - if (!r) { + Eina_Bool result = _ewk_tiled_backing_store_view_cols_end_add(priv, start, 0, columns); + if (!result) { CRITICAL("failed to allocate %ld columns", columns); _ewk_tiled_backing_store_view_rows_range_del(priv, priv->view.items + oldRows, start); priv->view.rows = oldRows; @@ -914,11 +915,11 @@ static inline void _ewk_tiled_backing_store_view_dbg(const Ewk_Tiled_Backing_Sto { Eina_Inlist** start, **end; printf("tiles=%2ld,%2ld model=%2ld,%2ld [%dx%d] base=%+3ld,%+4ld offset=%+4d,%+4d old=%+4d,%+4d base=%+3d,%+3d\n", - priv->view.cols, priv->view.rows, + priv->view.columns, priv->view.rows, priv->model.current.columns, priv->model.current.rows, priv->model.width, priv->model.height, priv->model.base.column, priv->model.base.row, - priv->view.offset.cur.x, priv->view.offset.cur.y, + priv->view.offset.current.x, priv->view.offset.current.y, priv->view.offset.old.x, priv->view.offset.old.y, priv->view.offset.base.x, priv->view.offset.base.y); @@ -933,7 +934,7 @@ static inline void _ewk_tiled_backing_store_view_dbg(const Ewk_Tiled_Backing_Sto if (!item->tile) printf(" ;"); else - printf("%8p %lu,%lu;", item->tile, item->tile->col, item->tile->row); + printf("%8p %lu,%lu;", item->tile, item->tile->column, item->tile->row); } printf("\n"); } @@ -971,7 +972,7 @@ static void _ewk_tiled_backing_store_view_wrap_up(Ewk_Tiled_Backing_Store_Data* Eina_Inlist* temp = *iteratorStart; Ewk_Tiled_Backing_Store_Item* item; Evas_Coord tilePositionX = originX; - int count1 = 0; + int column = 0; for (iteratorList = iteratorStart; iteratorList < iteratorEnd; iteratorList++) *iteratorList = *(iteratorList + 1); @@ -981,8 +982,8 @@ static void _ewk_tiled_backing_store_view_wrap_up(Ewk_Tiled_Backing_Store_Data* EINA_INLIST_FOREACH(temp, item) { _ewk_tiled_backing_store_item_move(item, tilePositionX, tilePositionY); tilePositionX += tileWidth; - _ewk_tiled_backing_store_item_fill(priv, item, count1, lastRow); - count1++; + _ewk_tiled_backing_store_item_fill(priv, item, column, lastRow); + column++; } tilePositionY += tileHeight; } @@ -1019,7 +1020,7 @@ static void _ewk_tiled_backing_store_view_wrap_down(Ewk_Tiled_Backing_Store_Data Eina_Inlist* temp = *iteratorStart; Ewk_Tiled_Backing_Store_Item* item; Evas_Coord tilePositionX = originX; - int count1 = 0; + int column = 0; for (iteratorList = iteratorStart; iteratorList > iteratorEnd; iteratorList--) *iteratorList = *(iteratorList - 1); @@ -1029,8 +1030,8 @@ static void _ewk_tiled_backing_store_view_wrap_down(Ewk_Tiled_Backing_Store_Data EINA_INLIST_FOREACH(temp, item) { _ewk_tiled_backing_store_item_move(item, tilePositionX, tilePositionY); tilePositionX += tileWidth; - _ewk_tiled_backing_store_item_fill(priv, item, count1, 0); - count1++; + _ewk_tiled_backing_store_item_fill(priv, item, column, 0); + column++; } tilePositionY -= tileHeight; } @@ -1041,22 +1042,22 @@ static void _ewk_tiled_backing_store_view_wrap_down(Ewk_Tiled_Backing_Store_Data * @internal * Move left-most (first) column right as last (right-most). * - * The final result is visually the same, but logically the first col that + * The final result is visually the same, but logically the first column that * went out of screen is now at last and filled with new model items. * * This is worth just when @a count is smaller than @c - * priv->view.cols, after that one is refilling the whole matrix so it + * priv->view.columns, after that one is refilling the whole matrix so it * is better to trigger full refill. * * @param count the number of times to repeat the process. */ static void _ewk_tiled_backing_store_view_wrap_left(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y, unsigned int count) { - unsigned int row, lastColumn = priv->view.cols - 1; + unsigned int row, lastColumn = priv->view.columns - 1; Evas_Coord tileWidth = priv->view.tile.width; Evas_Coord tileHeight = priv->view.tile.height; Evas_Coord offsetX = priv->view.offset.base.x + count * tileWidth; - Evas_Coord oy = y + priv->view.offset.base.y; + Evas_Coord offsetY = y + priv->view.offset.base.y; Eina_Inlist** iterator; Eina_Inlist** iteratorEnd; unsigned int baseColumn = lastColumn - count + 1; @@ -1077,10 +1078,10 @@ static void _ewk_tiled_backing_store_view_wrap_left(Ewk_Tiled_Backing_Store_Data it = EINA_INLIST_CONTAINER_GET(*iterator, Ewk_Tiled_Backing_Store_Item); *iterator = eina_inlist_demote(*iterator, *iterator); - _ewk_tiled_backing_store_item_move(it, tilePositionX, oy); + _ewk_tiled_backing_store_item_move(it, tilePositionX, offsetY); _ewk_tiled_backing_store_item_fill(priv, it, column, row); } - oy += tileHeight; + offsetY += tileHeight; } priv->view.offset.base.x = offsetX; @@ -1090,11 +1091,11 @@ static void _ewk_tiled_backing_store_view_wrap_left(Ewk_Tiled_Backing_Store_Data * @internal * Move right-most (last) column left as first (left-most). * - * The final result is visually the same, but logically the last col that + * The final result is visually the same, but logically the last column that * went out of screen is now at first and filled with new model items. * * This is worth just when @a count is smaller than @c - * priv->view.cols, after that one is refilling the whole matrix so it + * priv->view.columns, after that one is refilling the whole matrix so it * is better to trigger full refill. * * @param count the number of times to repeat the process. @@ -1138,7 +1139,7 @@ static void _ewk_tiled_backing_store_view_refill(Ewk_Tiled_Backing_Store_Data* p { Eina_Inlist** iterator, **iteratorEnd; Evas_Coord baseTilePositionX, tilePositionY, tileWidth, tileHeight; - unsigned int r; + unsigned int row; evas_object_move(priv->base.clipper, x, y); @@ -1150,19 +1151,19 @@ static void _ewk_tiled_backing_store_view_refill(Ewk_Tiled_Backing_Store_Data* p iterator = priv->view.items; iteratorEnd = iterator + priv->view.rows; - r = 0; + row = 0; priv->model.base.column -= stepX; priv->model.base.row -= stepY; - for (; iterator < iteratorEnd; iterator++, r++) { + for (; iterator < iteratorEnd; iterator++, row++) { Ewk_Tiled_Backing_Store_Item* item; Evas_Coord newTilePositionX = baseTilePositionX; - unsigned int count = 0; + unsigned int column = 0; EINA_INLIST_FOREACH(*iterator, item) { - _ewk_tiled_backing_store_item_fill(priv, item, count, r); + _ewk_tiled_backing_store_item_fill(priv, item, column, row); _ewk_tiled_backing_store_item_move(item, newTilePositionX, tilePositionY); - count++; + column++; newTilePositionX += tileWidth; } tilePositionY += tileHeight; @@ -1185,11 +1186,11 @@ static void _ewk_tiled_backing_store_view_pos_apply(Ewk_Tiled_Backing_Store_Data iterator = priv->view.items; iteratorEnd = iterator + priv->view.rows; for (; iterator < iteratorEnd; iterator++) { - Ewk_Tiled_Backing_Store_Item* it; - Evas_Coord ox = baseTilePositionX; - EINA_INLIST_FOREACH(*iterator, it) { - _ewk_tiled_backing_store_item_move(it, ox, baseTilePositionY); - ox += tileWidth; + Ewk_Tiled_Backing_Store_Item* item; + Evas_Coord offsetX = baseTilePositionX; + EINA_INLIST_FOREACH(*iterator, item) { + _ewk_tiled_backing_store_item_move(item, offsetX, baseTilePositionY); + offsetX += tileWidth; } baseTilePositionY += tileHeight; } @@ -1197,28 +1198,28 @@ static void _ewk_tiled_backing_store_view_pos_apply(Ewk_Tiled_Backing_Store_Data static void _ewk_tiled_backing_store_smart_calculate_offset_force(Ewk_Tiled_Backing_Store_Data* priv) { - Evas_Coord deltaX = priv->view.offset.cur.x - priv->view.offset.old.x; - Evas_Coord deltaY = priv->view.offset.cur.y - priv->view.offset.old.y; + Evas_Coord deltaX = priv->view.offset.current.x - priv->view.offset.old.x; + Evas_Coord deltaY = priv->view.offset.current.y - priv->view.offset.old.y; Evas_Coord tileWidth, tileHeight; int stepY, stepX; - INF("ewkBackingStore%p, offset: %+4d, %+4d (%+4d, %+4d)", - priv->self, deltaX, deltaY, priv->view.offset.cur.x, priv->view.offset.cur.y); + INF("ewkBackingStore=%p, offset: %+4d, %+4d (%+4d, %+4d)", + priv->self, deltaX, deltaY, priv->view.offset.current.x, priv->view.offset.current.y); tileWidth = priv->view.tile.width; tileHeight = priv->view.tile.height; - long newColumn = -priv->view.offset.cur.x / tileWidth; + long newColumn = -priv->view.offset.current.x / tileWidth; stepX = priv->model.base.column - newColumn; - long newRow = -priv->view.offset.cur.y / tileHeight; + long newRow = -priv->view.offset.current.y / tileHeight; stepY = priv->model.base.row - newRow; - priv->view.offset.old.x = priv->view.offset.cur.x; - priv->view.offset.old.y = priv->view.offset.cur.y; + priv->view.offset.old.x = priv->view.offset.current.x; + priv->view.offset.old.y = priv->view.offset.current.y; evas_object_move( priv->contentsClipper, - priv->view.offset.cur.x + priv->view.x, - priv->view.offset.cur.y + priv->view.y); + priv->view.offset.current.x + priv->view.x, + priv->view.offset.current.y + priv->view.y); priv->view.offset.base.x += deltaX - stepX * tileWidth; priv->view.offset.base.y += deltaY - stepY * tileHeight; @@ -1229,13 +1230,13 @@ static void _ewk_tiled_backing_store_smart_calculate_offset_force(Ewk_Tiled_Back static void _ewk_tiled_backing_store_smart_calculate_offset(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y) { - Evas_Coord deltaX = priv->view.offset.cur.x - priv->view.offset.old.x; - Evas_Coord deltaY = priv->view.offset.cur.y - priv->view.offset.old.y; + Evas_Coord deltaX = priv->view.offset.current.x - priv->view.offset.old.x; + Evas_Coord deltaY = priv->view.offset.current.y - priv->view.offset.old.y; Evas_Coord tileWidth, tileHeight; int stepY, stepX; - INF("ewkBackingStore%p, offset: %+4d, %+4d (%+4d, %+4d)", - priv->self, deltaX, deltaY, priv->view.offset.cur.x, priv->view.offset.cur.y); + INF("ewkBackingStore=%p, offset: %+4d, %+4d (%+4d, %+4d)", + priv->self, deltaX, deltaY, priv->view.offset.current.x, priv->view.offset.current.y); if (!deltaX && !deltaY) return; @@ -1243,20 +1244,20 @@ static void _ewk_tiled_backing_store_smart_calculate_offset(Ewk_Tiled_Backing_St tileWidth = priv->view.tile.width; tileHeight = priv->view.tile.height; - long newCol = -priv->view.offset.cur.x / tileWidth; + long newCol = -priv->view.offset.current.x / tileWidth; stepX = priv->model.base.column - newCol; - long newRow = -priv->view.offset.cur.y / tileHeight; + long newRow = -priv->view.offset.current.y / tileHeight; stepY = priv->model.base.row - newRow; - priv->view.offset.old.x = priv->view.offset.cur.x; - priv->view.offset.old.y = priv->view.offset.cur.y; + priv->view.offset.old.x = priv->view.offset.current.x; + priv->view.offset.old.y = priv->view.offset.current.y; evas_object_move( priv->contentsClipper, - priv->view.offset.cur.x + priv->view.x, - priv->view.offset.cur.y + priv->view.y); + priv->view.offset.current.x + priv->view.x, + priv->view.offset.current.y + priv->view.y); - if ((stepX < 0 && stepX <= -priv->view.cols) - || (stepX > 0 && stepX >= priv->view.cols) + if ((stepX < 0 && stepX <= -priv->view.columns) + || (stepX > 0 && stepX >= priv->view.columns) || (stepY < 0 && stepY <= -priv->view.rows) || (stepY > 0 && stepY >= priv->view.rows)) { @@ -1291,8 +1292,8 @@ static void _ewk_tiled_backing_store_smart_calculate_pos(Ewk_Tiled_Backing_Store priv->view.y = y; evas_object_move( priv->contentsClipper, - priv->view.offset.cur.x + priv->view.x, - priv->view.offset.cur.y + priv->view.y); + priv->view.offset.current.x + priv->view.x, + priv->view.offset.current.y + priv->view.y); } static void _ewk_tiled_backing_store_fill_renderers(Ewk_Tiled_Backing_Store_Data* priv) @@ -1314,7 +1315,7 @@ static void _ewk_tiled_backing_store_smart_calculate(Evas_Object* ewkBackingStor Evas_Coord x, y, width, height; evas_object_geometry_get(ewkBackingStore, &x, &y, &width, &height); - DBG("ewkBackingStore%p at %d,%d + %dx%d", ewkBackingStore, x, y, width, height); + DBG("ewkBackingStore=%p at %d,%d + %dx%d", ewkBackingStore, x, y, width, height); PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv); @@ -1322,10 +1323,10 @@ static void _ewk_tiled_backing_store_smart_calculate(Evas_Object* ewkBackingStor ewk_tile_matrix_freeze(priv->model.matrix); - if (priv->changed.model && !priv->changed.size) + if (priv->changed.contentsSize) ewk_tile_matrix_invalidate(priv->model.matrix); - if (!priv->render.suspend && priv->changed.model) { + if (!priv->render.suspend && (priv->changed.model || priv->changed.contentsSize)) { unsigned long columns, rows; columns = priv->model.width / priv->view.tile.width + 1; @@ -1356,7 +1357,7 @@ static void _ewk_tiled_backing_store_smart_calculate(Evas_Object* ewkBackingStor priv->changed.size = false; } - if (!priv->render.suspend && priv->changed.model) { + if (!priv->render.suspend && (priv->changed.model || priv->changed.contentsSize)) { _ewk_tiled_backing_store_fill_renderers(priv); ewk_tile_matrix_resize(priv->model.matrix, priv->model.current.columns, @@ -1371,6 +1372,8 @@ static void _ewk_tiled_backing_store_smart_calculate(Evas_Object* ewkBackingStor { 0, 0, priv->model.width, priv->model.height }; ewk_tile_matrix_update(priv->model.matrix, &rect, priv->view.tile.zoom); + + priv->changed.contentsSize = false; } ewk_tile_matrix_thaw(priv->model.matrix); @@ -1381,10 +1384,10 @@ static void _ewk_tiled_backing_store_smart_calculate(Evas_Object* ewkBackingStor || priv->view.offset.base.x <= - priv->view.tile.width || priv->view.offset.base.y > 0 || priv->view.offset.base.y <= - priv->view.tile.height) - ERR("incorrect base offset %+4d,%+4d, tile=%dx%d, cur=%+4d,%+4d\n", + ERR("incorrect base offset %+4d,%+4d, tile=%dx%d, current=%+4d,%+4d\n", priv->view.offset.base.x, priv->view.offset.base.y, priv->view.tile.width, priv->view.tile.height, - priv->view.offset.cur.x, priv->view.offset.cur.y); + priv->view.offset.current.x, priv->view.offset.current.y); } @@ -1448,8 +1451,8 @@ static Eina_Bool _ewk_tiled_backing_store_scroll_full_offset_set_internal(Ewk_Ti if (priv->render.disabled) return false; - priv->view.offset.cur.x = x; - priv->view.offset.cur.y = y; + priv->view.offset.current.x = x; + priv->view.offset.current.y = y; priv->changed.offset = true; _ewk_tiled_backing_store_changed(priv); @@ -1459,10 +1462,10 @@ static Eina_Bool _ewk_tiled_backing_store_scroll_full_offset_set_internal(Ewk_Ti Eina_Bool ewk_tiled_backing_store_scroll_full_offset_set(Evas_Object* ewkBackingStore, Evas_Coord x, Evas_Coord y) { - DBG("ewkBackingStore%p, x=%d, y=%d", ewkBackingStore, x, y); + DBG("ewkBackingStore=%p, x=%d, y=%d", ewkBackingStore, x, y); PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false); - if (x == priv->view.offset.cur.x && y == priv->view.offset.cur.y) + if (x == priv->view.offset.current.x && y == priv->view.offset.current.y) return true; return _ewk_tiled_backing_store_scroll_full_offset_set_internal(priv, x, y); @@ -1470,20 +1473,20 @@ Eina_Bool ewk_tiled_backing_store_scroll_full_offset_set(Evas_Object* ewkBacking Eina_Bool ewk_tiled_backing_store_scroll_full_offset_add(Evas_Object* ewkBackingStore, Evas_Coord deltaX, Evas_Coord deltaY) { - DBG("ewkBackingStore%p, deltaX=%d, deltaY=%d", ewkBackingStore, deltaX, deltaY); + DBG("ewkBackingStore=%p, deltaX=%d, deltaY=%d", ewkBackingStore, deltaX, deltaY); PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false); if (!deltaX && !deltaY) return true; return _ewk_tiled_backing_store_scroll_full_offset_set_internal - (priv, priv->view.offset.cur.x + deltaX, priv->view.offset.cur.y + deltaY); + (priv, priv->view.offset.current.x + deltaX, priv->view.offset.current.y + deltaY); } static Eina_Bool _ewk_tiled_backing_store_zoom_set_internal(Ewk_Tiled_Backing_Store_Data* priv, float* zoom, Evas_Coord currentX, Evas_Coord currentY, Evas_Coord* offsetX, Evas_Coord* offsetY) { - *offsetX = priv->view.offset.cur.x; - *offsetY = priv->view.offset.cur.y; + *offsetX = priv->view.offset.current.x; + *offsetY = priv->view.offset.current.y; if (fabsf(priv->view.tile.zoom - *zoom) < zoomStepMinimum) { DBG("ignored as zoom difference is < %f: %f", @@ -1514,10 +1517,10 @@ static Eina_Bool _ewk_tiled_backing_store_zoom_set_internal(Ewk_Tiled_Backing_St return true; } Eina_Inlist** iterator, **iteratorEnd; - Ewk_Tiled_Backing_Store_Item* it; + Ewk_Tiled_Backing_Store_Item* item; - Evas_Coord newX = currentX + (priv->view.offset.cur.x - currentX) * scale; - Evas_Coord newY = currentY + (priv->view.offset.cur.y - currentY) * scale; + Evas_Coord newX = currentX + (priv->view.offset.current.x - currentX) * scale; + Evas_Coord newY = currentY + (priv->view.offset.current.y - currentY) * scale; Evas_Coord modelWidth = priv->model.width * scale; Evas_Coord modelHeight = priv->model.height * scale; @@ -1541,15 +1544,15 @@ static Eina_Bool _ewk_tiled_backing_store_zoom_set_internal(Ewk_Tiled_Backing_St priv->changed.model = true; _ewk_tiled_backing_store_changed(priv); - priv->view.offset.cur.x = newX; - priv->view.offset.cur.y = newY; + priv->view.offset.current.x = newX; + priv->view.offset.current.y = newY; priv->view.offset.base.x = baseX; priv->view.offset.base.y = baseY; - priv->view.offset.old.x = priv->view.offset.cur.x; - priv->view.offset.old.y = priv->view.offset.cur.y; - *offsetX = priv->view.offset.cur.x; - *offsetY = priv->view.offset.cur.y; + priv->view.offset.old.x = priv->view.offset.current.x; + priv->view.offset.old.y = priv->view.offset.current.y; + *offsetX = priv->view.offset.current.x; + *offsetY = priv->view.offset.current.y; evas_object_move( priv->contentsClipper, @@ -1568,9 +1571,9 @@ static Eina_Bool _ewk_tiled_backing_store_zoom_set_internal(Ewk_Tiled_Backing_St Evas_Coord tilePositionX = baseTilePositionX; Eina_Inlist* lst = *iterator; - EINA_INLIST_FOREACH(lst, it) { - _ewk_tiled_backing_store_item_move(it, tilePositionX, tilePositionY); - _ewk_tiled_backing_store_item_resize(it, tileWidth, tileHeight); + EINA_INLIST_FOREACH(lst, item) { + _ewk_tiled_backing_store_item_move(item, tilePositionX, tilePositionY); + _ewk_tiled_backing_store_item_resize(item, tileWidth, tileHeight); tilePositionX += tileWidth; } tilePositionY += tileHeight; @@ -1581,7 +1584,7 @@ static Eina_Bool _ewk_tiled_backing_store_zoom_set_internal(Ewk_Tiled_Backing_St Eina_Bool ewk_tiled_backing_store_zoom_set(Evas_Object* ewkBackingStore, float* zoom, Evas_Coord currentX, Evas_Coord currentY, Evas_Coord* offsetX, Evas_Coord* offsetY) { - DBG("ewkBackingStore%p, zoom=%f", ewkBackingStore, *zoom); + DBG("ewkBackingStore=%p, zoom=%f", ewkBackingStore, *zoom); PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false); @@ -1590,7 +1593,7 @@ Eina_Bool ewk_tiled_backing_store_zoom_set(Evas_Object* ewkBackingStore, float* Eina_Bool ewk_tiled_backing_store_zoom_weak_set(Evas_Object* ewkBackingStore, float zoom, Evas_Coord currentX, Evas_Coord currentY) { - DBG("ewkBackingStore%p, zoom=%f", ewkBackingStore, zoom); + DBG("ewkBackingStore=%p, zoom=%f", ewkBackingStore, zoom); PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false); if (!priv->view.width || !priv->view.height) return false; @@ -1613,8 +1616,8 @@ Eina_Bool ewk_tiled_backing_store_zoom_weak_set(Evas_Object* ewkBackingStore, fl int vrows = static_cast<int>(ceil(priv->view.height /static_cast<float>(tileHeight)) + 1); int vcols = static_cast<int>(ceil(priv->view.width / static_cast<float>(tileWidth)) + 1); - Evas_Coord newX = currentX + (priv->view.offset.cur.x - currentX) * scale; - Evas_Coord newY = currentY + (priv->view.offset.cur.y - currentY) * scale; + Evas_Coord newX = currentX + (priv->view.offset.current.x - currentX) * scale; + Evas_Coord newY = currentY + (priv->view.offset.current.y - currentY) * scale; Evas_Coord baseX = newX % tileWidth; Evas_Coord baseY = newY % tileHeight; unsigned long baseRow = -newY / tileHeight; @@ -1626,7 +1629,7 @@ Eina_Bool ewk_tiled_backing_store_zoom_weak_set(Evas_Object* ewkBackingStore, fl reCalculate = true; } - if (vrows > priv->view.rows || vcols > priv->view.cols) + if (vrows > priv->view.rows || vcols > priv->view.columns) reCalculate = true; if (reCalculate) { @@ -1667,8 +1670,8 @@ void ewk_tiled_backing_store_fix_offsets(Evas_Object* ewkBackingStore, Evas_Coor PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv); Eina_Inlist** iterator, **iteratorEnd; Ewk_Tiled_Backing_Store_Item* item; - Evas_Coord newX = priv->view.offset.cur.x; - Evas_Coord newY = priv->view.offset.cur.y; + Evas_Coord newX = priv->view.offset.current.x; + Evas_Coord newY = priv->view.offset.current.y; Evas_Coord baseX = priv->view.offset.base.x; Evas_Coord baseY = priv->view.offset.base.y; Evas_Coord tileWidth = priv->view.tile.width; @@ -1696,8 +1699,8 @@ void ewk_tiled_backing_store_fix_offsets(Evas_Object* ewkBackingStore, Evas_Coor priv->model.base.row = -newY / tileHeight; } - priv->view.offset.cur.x = newX; - priv->view.offset.cur.y = newY; + priv->view.offset.current.x = newX; + priv->view.offset.current.y = newY; priv->view.offset.old.x = newX; priv->view.offset.old.y = newY; priv->view.offset.base.x = baseX; @@ -1796,7 +1799,7 @@ void ewk_tiled_backing_store_contents_resize(Evas_Object* ewkBackingStore, Evas_ priv->model.width = width; priv->model.height = height; - priv->changed.model = true; + priv->changed.contentsSize = true; DBG("w,h=%d, %d", width, height); _ewk_tiled_backing_store_changed(priv); @@ -1815,8 +1818,8 @@ void ewk_tiled_backing_store_flush(Evas_Object* ewkBackingStore) PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv); Ewk_Tile_Unused_Cache* tileUnusedCache = 0; - priv->view.offset.cur.x = 0; - priv->view.offset.cur.y = 0; + priv->view.offset.current.x = 0; + priv->view.offset.current.y = 0; priv->view.offset.old.x = 0; priv->view.offset.old.y = 0; priv->view.offset.base.x = 0; @@ -1956,7 +1959,7 @@ Eina_Bool ewk_tiled_backing_store_pre_render_region(Evas_Object* ewkBackingStore { PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false); Eina_Tile_Grid_Slicer slicer; - const Eina_Tile_Grid_Info* info; + const Eina_Tile_Grid_Info* gridInfo; Evas_Coord tileWidth, tileHeight; Ewk_Tile_Unused_Cache* tileUnusedCache; @@ -1970,10 +1973,10 @@ Eina_Bool ewk_tiled_backing_store_pre_render_region(Evas_Object* ewkBackingStore return false; } - while (eina_tile_grid_slicer_next(&slicer, &info)) { - const unsigned long c = info->col; - const unsigned long r = info->row; - if (!_ewk_tiled_backing_store_pre_render_request_add(priv, c, r, zoom)) + while (eina_tile_grid_slicer_next(&slicer, &gridInfo)) { + const unsigned long column = gridInfo->col; + const unsigned long row = gridInfo->row; + if (!_ewk_tiled_backing_store_pre_render_request_add(priv, column, row, zoom)) break; } @@ -1997,7 +2000,7 @@ Eina_Bool ewk_tiled_backing_store_pre_render_relative_radius(Evas_Object* ewkBac endRow = std::min(priv->model.current.rows - 1, priv->model.base.row + priv->view.rows + n - 1); endCol = std::min(priv->model.current.columns - 1, - priv->model.base.column + priv->view.cols + n - 1); + priv->model.base.column + priv->view.columns + n - 1); INF("startRow=%lu, endRow=%lu, startCol=%lu, endCol=%lu", startRow, endRow, startCol, endCol); diff --git a/Source/WebKit/efl/ewk/ewk_tiled_backing_store.h b/Source/WebKit/efl/ewk/ewk_tiled_backing_store.h index e93ccf799..7b8ce0d6f 100644 --- a/Source/WebKit/efl/ewk/ewk_tiled_backing_store.h +++ b/Source/WebKit/efl/ewk/ewk_tiled_backing_store.h @@ -62,9 +62,9 @@ struct _Ewk_Tile_Stats { }; struct _Ewk_Tile { - Eina_Tiler* updates; /**< updated/dirty areas */ + Eina_Tiler *updates; /**< updated/dirty areas */ Ewk_Tile_Stats stats; /**< tile usage statistics */ - unsigned long col, row; /**< tile tile position */ + unsigned long column, row; /**< tile tile position */ Evas_Coord x, y; /**< tile coordinate position */ /** Never ever change those after tile is created (respect const!) */ @@ -76,45 +76,45 @@ struct _Ewk_Tile { * alignement! */ int visible; /**< visibility counter of this tile */ - Evas_Object* image; /**< Evas Image, the tile to be rendered */ - uint8_t* pixels; + Evas_Object *image; /**< Evas Image, the tile to be rendered */ + uint8_t *pixels; }; #include "ewk_tiled_matrix.h" #include "ewk_tiled_model.h" /* view */ -Evas_Object* ewk_tiled_backing_store_add(Evas* e); - -void ewk_tiled_backing_store_render_cb_set(Evas_Object *o, Eina_Bool (*cb)(void* data, Ewk_Tile* t, const Eina_Rectangle* area), const void* data); - -Eina_Bool ewk_tiled_backing_store_scroll_full_offset_set(Evas_Object* o, Evas_Coord x, Evas_Coord y); -Eina_Bool ewk_tiled_backing_store_scroll_full_offset_add(Evas_Object* o, Evas_Coord dx, Evas_Coord dy); -Eina_Bool ewk_tiled_backing_store_scroll_inner_offset_add(Evas_Object* o, Evas_Coord dx, Evas_Coord dy, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); - -Eina_Bool ewk_tiled_backing_store_zoom_set(Evas_Object* o, float* zoom, Evas_Coord cx, Evas_Coord cy, Evas_Coord* offx, Evas_Coord* offy); -Eina_Bool ewk_tiled_backing_store_zoom_weak_set(Evas_Object* o, float zoom, Evas_Coord cx, Evas_Coord cy); -void ewk_tiled_backing_store_fix_offsets(Evas_Object* o, Evas_Coord w, Evas_Coord h); -void ewk_tiled_backing_store_zoom_weak_smooth_scale_set(Evas_Object* o, Eina_Bool smooth_scale); -void ewk_tiled_backing_store_alpha_set(Evas_Object* o, Eina_Bool has_alpha); -Eina_Bool ewk_tiled_backing_store_update(Evas_Object* o, const Eina_Rectangle* update); -void ewk_tiled_backing_store_updates_process_pre_set(Evas_Object* o, void*(*cb)(void* data, Evas_Object *o), const void* data); -void ewk_tiled_backing_store_updates_process_post_set(Evas_Object* o, void*(*cb)(void* data, void* pre_data, Evas_Object *o), const void* data); -void ewk_tiled_backing_store_updates_process(Evas_Object* o); -void ewk_tiled_backing_store_updates_clear(Evas_Object* o); -void ewk_tiled_backing_store_contents_resize(Evas_Object* o, Evas_Coord width, Evas_Coord height); -void ewk_tiled_backing_store_disabled_update_set(Evas_Object* o, Eina_Bool value); -void ewk_tiled_backing_store_flush(Evas_Object* o); -void ewk_tiled_backing_store_enable_scale_set(Evas_Object* o, Eina_Bool value); - -Ewk_Tile_Unused_Cache* ewk_tiled_backing_store_tile_unused_cache_get(const Evas_Object* o); -void ewk_tiled_backing_store_tile_unused_cache_set(Evas_Object* o, Ewk_Tile_Unused_Cache* tuc); - -Eina_Bool ewk_tiled_backing_store_pre_render_region(Evas_Object* o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom); -Eina_Bool ewk_tiled_backing_store_pre_render_relative_radius(Evas_Object* o, unsigned int n, float zoom); -Eina_Bool ewk_tiled_backing_store_pre_render_spiral_queue(Evas_Object* o, Eina_Rectangle* view_rect, Eina_Rectangle* render_rect, int max_memory, float zoom); -void ewk_tiled_backing_store_pre_render_cancel(Evas_Object* o); - -Eina_Bool ewk_tiled_backing_store_disable_render(Evas_Object* o); -Eina_Bool ewk_tiled_backing_store_enable_render(Evas_Object* o); +Evas_Object *ewk_tiled_backing_store_add(Evas *e); + +void ewk_tiled_backing_store_render_cb_set(Evas_Object *o, Eina_Bool (*cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *area), const void *data); + +Eina_Bool ewk_tiled_backing_store_scroll_full_offset_set(Evas_Object *o, Evas_Coord x, Evas_Coord y); +Eina_Bool ewk_tiled_backing_store_scroll_full_offset_add(Evas_Object *o, Evas_Coord dx, Evas_Coord dy); +Eina_Bool ewk_tiled_backing_store_scroll_inner_offset_add(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); + +Eina_Bool ewk_tiled_backing_store_zoom_set(Evas_Object *o, float *zoom, Evas_Coord cx, Evas_Coord cy, Evas_Coord *offx, Evas_Coord *offy); +Eina_Bool ewk_tiled_backing_store_zoom_weak_set(Evas_Object *o, float zoom, Evas_Coord cx, Evas_Coord cy); +void ewk_tiled_backing_store_fix_offsets(Evas_Object *o, Evas_Coord w, Evas_Coord h); +void ewk_tiled_backing_store_zoom_weak_smooth_scale_set(Evas_Object *o, Eina_Bool smooth_scale); +void ewk_tiled_backing_store_alpha_set(Evas_Object *o, Eina_Bool has_alpha); +Eina_Bool ewk_tiled_backing_store_update(Evas_Object *o, const Eina_Rectangle *update); +void ewk_tiled_backing_store_updates_process_pre_set(Evas_Object *o, void*(*cb)(void *data, Evas_Object *o), const void *data); +void ewk_tiled_backing_store_updates_process_post_set(Evas_Object *o, void*(*cb)(void *data, void *pre_data, Evas_Object *o), const void *data); +void ewk_tiled_backing_store_updates_process(Evas_Object *o); +void ewk_tiled_backing_store_updates_clear(Evas_Object *o); +void ewk_tiled_backing_store_contents_resize(Evas_Object *o, Evas_Coord width, Evas_Coord height); +void ewk_tiled_backing_store_disabled_update_set(Evas_Object *o, Eina_Bool value); +void ewk_tiled_backing_store_flush(Evas_Object *o); +void ewk_tiled_backing_store_enable_scale_set(Evas_Object *o, Eina_Bool value); + +Ewk_Tile_Unused_Cache *ewk_tiled_backing_store_tile_unused_cache_get(const Evas_Object *o); +void ewk_tiled_backing_store_tile_unused_cache_set(Evas_Object *o, Ewk_Tile_Unused_Cache *tuc); + +Eina_Bool ewk_tiled_backing_store_pre_render_region(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom); +Eina_Bool ewk_tiled_backing_store_pre_render_relative_radius(Evas_Object *o, unsigned int n, float zoom); +Eina_Bool ewk_tiled_backing_store_pre_render_spiral_queue(Evas_Object *o, Eina_Rectangle* view_rect, Eina_Rectangle *render_rect, int max_memory, float zoom); +void ewk_tiled_backing_store_pre_render_cancel(Evas_Object *o); + +Eina_Bool ewk_tiled_backing_store_disable_render(Evas_Object *o); +Eina_Bool ewk_tiled_backing_store_enable_render(Evas_Object *o); #endif // ewk_tiled_backing_store_h diff --git a/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp b/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp index ab06042ce..5d991b436 100644 --- a/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp +++ b/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp @@ -44,7 +44,7 @@ typedef struct _Ewk_Tile_Matrix_Entry Ewk_Tile_Matrix_Entry; struct _Ewk_Tile_Matrix { Eina_Matrixsparse* matrix; Eina_Inlist* matrices; - Ewk_Tile_Unused_Cache* tilieUnusedCache; + Ewk_Tile_Unused_Cache* tileUnusedCache; Evas_Colorspace cspace; struct { void (*callback)(void* data, Ewk_Tile* tile, const Eina_Rectangle* update); @@ -94,7 +94,7 @@ static void _ewk_tile_matrix_cell_free(void* userData, void* cellData) if (!tile) return; - ewk_tile_unused_cache_freeze(tileMatrix->tilieUnusedCache); + ewk_tile_unused_cache_freeze(tileMatrix->tileUnusedCache); if (tile->updates || tile->stats.full_update) tileMatrix->updates = eina_list_remove(tileMatrix->updates, tile); @@ -102,8 +102,8 @@ static void _ewk_tile_matrix_cell_free(void* userData, void* cellData) if (tile->visible) ERR("freeing cell that is visible, leaking tile %p", tile); else { - if (!ewk_tile_unused_cache_tile_get(tileMatrix->tilieUnusedCache, tile)) - ERR("tile %p was not in cache %p? leaking...", tile, tileMatrix->tilieUnusedCache); + if (!ewk_tile_unused_cache_tile_get(tileMatrix->tileUnusedCache, tile)) + ERR("tile %p was not in cache %p? leaking...", tile, tileMatrix->tileUnusedCache); else { Ewk_Tile_Matrix_Entry* entry; DBG("tile cell does not exist anymore, free it %p", tile); @@ -121,7 +121,7 @@ static void _ewk_tile_matrix_cell_free(void* userData, void* cellData) } } - ewk_tile_unused_cache_thaw(tileMatrix->tilieUnusedCache); + ewk_tile_unused_cache_thaw(tileMatrix->tileUnusedCache); } /* called when cache of unused tile is flushed */ @@ -137,7 +137,7 @@ static void _ewk_tile_matrix_tile_free(void* data, Ewk_Tile* tile) return; } - if (!eina_matrixsparse_cell_idx_get(entry->matrix, tile->row, tile->col, &cell)) { + if (!eina_matrixsparse_cell_idx_get(entry->matrix, tile->row, tile->column, &cell)) { ERR("removing tile %p that was not in the matrix? Leaking...", tile); return; @@ -184,7 +184,7 @@ static void _ewk_tile_matrix_tile_free(void* data, Ewk_Tile* tile) * existing tiles and give them back, allowing them to be * freed/replaced by the cache. * - * @param tuc cache of unused tiles or @c 0 to create one + * @param tileUnusedCache cache of unused tiles or @c 0 to create one * automatically. * @param columns number of columns in the matrix. * @param rows number of rows in the matrix. @@ -211,10 +211,10 @@ Ewk_Tile_Matrix* ewk_tile_matrix_new(Ewk_Tile_Unused_Cache* tileUnusedCache, uns ewk_tile_matrix_zoom_level_set(tileMatrix, zoomLevel); if (tileUnusedCache) - tileMatrix->tilieUnusedCache = ewk_tile_unused_cache_ref(tileUnusedCache); + tileMatrix->tileUnusedCache = ewk_tile_unused_cache_ref(tileUnusedCache); else { - tileMatrix->tilieUnusedCache = ewk_tile_unused_cache_new(DEFAULT_CACHE_SIZE); - if (!tileMatrix->tilieUnusedCache) { + tileMatrix->tileUnusedCache = ewk_tile_unused_cache_new(DEFAULT_CACHE_SIZE); + if (!tileMatrix->tileUnusedCache) { ERR("no cache of unused tile!"); eina_matrixsparse_free(tileMatrix->matrix); free(tileMatrix); @@ -298,7 +298,7 @@ void ewk_tile_matrix_free(Ewk_Tile_Matrix* tileMatrix) EINA_SAFETY_ON_NULL_RETURN(tileMatrix); - ewk_tile_unused_cache_freeze(tileMatrix->tilieUnusedCache); + ewk_tile_unused_cache_freeze(tileMatrix->tileUnusedCache); ewk_tile_matrix_invalidate(tileMatrix); entry = EINA_INLIST_CONTAINER_GET(tileMatrix->matrices, Ewk_Tile_Matrix_Entry); eina_matrixsparse_free(entry->matrix); @@ -306,8 +306,8 @@ void ewk_tile_matrix_free(Ewk_Tile_Matrix* tileMatrix) free(entry); tileMatrix->matrices = 0; - ewk_tile_unused_cache_thaw(tileMatrix->tilieUnusedCache); - ewk_tile_unused_cache_unref(tileMatrix->tilieUnusedCache); + ewk_tile_unused_cache_thaw(tileMatrix->tileUnusedCache); + ewk_tile_unused_cache_unref(tileMatrix->tileUnusedCache); #ifdef DEBUG_MEM_LEAKS tiles = tileMatrix->stats.tiles.allocated - tileMatrix->stats.tiles.freed; @@ -355,7 +355,7 @@ void ewk_tile_matrix_resize(Ewk_Tile_Matrix* tileMatrix, unsigned long cols, uns Ewk_Tile_Unused_Cache* ewk_tile_matrix_unused_cache_get(const Ewk_Tile_Matrix* tileMatrix) { EINA_SAFETY_ON_NULL_RETURN_VAL(tileMatrix, 0); - return tileMatrix->tilieUnusedCache; + return tileMatrix->tileUnusedCache; } /** @@ -390,7 +390,7 @@ Ewk_Tile* ewk_tile_matrix_tile_exact_get(Ewk_Tile_Matrix* tileMatrix, unsigned l end: if (!tile->visible) { - if (!ewk_tile_unused_cache_tile_get(tileMatrix->tilieUnusedCache, tile)) + if (!ewk_tile_unused_cache_tile_get(tileMatrix->tileUnusedCache, tile)) WRN("Ewk_Tile was unused but not in cache? bug!"); } @@ -459,7 +459,7 @@ Ewk_Tile* ewk_tile_matrix_tile_new(Ewk_Tile_Matrix* tileMatrix, Evas* canvas, un return 0; } - tile->col = column; + tile->column = column; tile->row = row; tile->x = column * tileWidth; tile->y = row * tileHeight; @@ -486,7 +486,7 @@ Ewk_Tile* ewk_tile_matrix_tile_new(Ewk_Tile_Matrix* tileMatrix, Evas* canvas, un * unused cache. * * @param tileMatrix the tile matrix to return tile to. - * @param t the tile instance to return, must @b not be @c 0. + * @param tile the tile instance to return, must @b not be @c 0. * @param last_used time in which tile.widthas last used. * * @return #true on success or #false on failure. @@ -500,7 +500,7 @@ Eina_Bool ewk_tile_matrix_tile_put(Ewk_Tile_Matrix* tileMatrix, Ewk_Tile* tile, return true; tile->stats.last_used = lastUsed; - return ewk_tile_unused_cache_tile_put(tileMatrix->tilieUnusedCache, tile, _ewk_tile_matrix_tile_free, tileMatrix); + return ewk_tile_unused_cache_tile_put(tileMatrix->tileUnusedCache, tile, _ewk_tile_matrix_tile_free, tileMatrix); } Eina_Bool ewk_tile_matrix_tile_update(Ewk_Tile_Matrix* tileMatrix, unsigned long col, unsigned long row, const Eina_Rectangle* update) @@ -706,7 +706,7 @@ void ewk_tile_matrix_dbg(const Ewk_Tile_Matrix* tileMatrix) printf("\n"); } printf("%3lu,%3lu %10p:", column, row, tile); - printf(" [%3lu,%3lu + %dx%d @ %0.3f]%c", tile->col, tile->row, tile->width, tile->height, tile->zoom, tile->visible ? '*' : ' '); + printf(" [%3lu,%3lu + %dx%d @ %0.3f]%c", tile->column, tile->row, tile->width, tile->height, tile->zoom, tile->visible ? '*' : ' '); printf("\n"); } } @@ -714,7 +714,7 @@ void ewk_tile_matrix_dbg(const Ewk_Tile_Matrix* tileMatrix) printf("\n"); eina_iterator_free(iterator); - ewk_tile_unused_cache_dbg(tileMatrix->tilieUnusedCache); + ewk_tile_unused_cache_dbg(tileMatrix->tileUnusedCache); } /** @@ -730,7 +730,7 @@ void ewk_tile_matrix_freeze(Ewk_Tile_Matrix* tileMatrix) { EINA_SAFETY_ON_NULL_RETURN(tileMatrix); if (!tileMatrix->frozen) - ewk_tile_unused_cache_freeze(tileMatrix->tilieUnusedCache); + ewk_tile_unused_cache_freeze(tileMatrix->tileUnusedCache); tileMatrix->frozen++; } @@ -750,5 +750,5 @@ void ewk_tile_matrix_thaw(Ewk_Tile_Matrix* tileMatrix) tileMatrix->frozen--; if (!tileMatrix->frozen) - ewk_tile_unused_cache_thaw(tileMatrix->tilieUnusedCache); + ewk_tile_unused_cache_thaw(tileMatrix->tileUnusedCache); } diff --git a/Source/WebKit/efl/ewk/ewk_tiled_matrix.h b/Source/WebKit/efl/ewk/ewk_tiled_matrix.h index fe6b66850..98b95921b 100644 --- a/Source/WebKit/efl/ewk/ewk_tiled_matrix.h +++ b/Source/WebKit/efl/ewk/ewk_tiled_matrix.h @@ -26,36 +26,34 @@ #include <Evas.h> /* matrix of tiles */ -Ewk_Tile_Matrix* ewk_tile_matrix_new(Ewk_Tile_Unused_Cache* tileUnusedCache, unsigned long columns, unsigned long rows, float zoomLevel, Evas_Colorspace colorSpace, void (*render_callback)(void* data, Ewk_Tile* tile, const Eina_Rectangle* update), const void* renderData); -void ewk_tile_matrix_free(Ewk_Tile_Matrix* tm); +Ewk_Tile_Matrix *ewk_tile_matrix_new(Ewk_Tile_Unused_Cache *tuc, unsigned long cols, unsigned long rows, float zoom_level, Evas_Colorspace color_space, void (*render_callback)(void *data, Ewk_Tile *t, const Eina_Rectangle *update), const void *render_data); +void ewk_tile_matrix_free(Ewk_Tile_Matrix *tm); -void ewk_tile_matrix_resize(Ewk_Tile_Matrix* tm, unsigned long cols, unsigned long rows); -void ewk_tile_matrix_zoom_level_set(Ewk_Tile_Matrix* tileMatrix, float zoom); -void ewk_tile_matrix_invalidate(Ewk_Tile_Matrix* tileMatrix); +void ewk_tile_matrix_resize(Ewk_Tile_Matrix *tm, unsigned long cols, unsigned long rows); +void ewk_tile_matrix_zoom_level_set(Ewk_Tile_Matrix *tm, float zoom); +void ewk_tile_matrix_invalidate(Ewk_Tile_Matrix *tm); -Ewk_Tile_Unused_Cache* ewk_tile_matrix_unused_cache_get(const Ewk_Tile_Matrix* tm); +Ewk_Tile_Unused_Cache *ewk_tile_matrix_unused_cache_get(const Ewk_Tile_Matrix *tm); -Ewk_Tile* ewk_tile_matrix_tile_exact_get(Ewk_Tile_Matrix* tm, unsigned long col, unsigned long row, float zoom); -Eina_Bool ewk_tile_matrix_tile_exact_exists(Ewk_Tile_Matrix* tm, unsigned long col, unsigned long row, float zoom); -Ewk_Tile* ewk_tile_matrix_tile_nearest_get(Ewk_Tile_Matrix* tm, unsigned long col, unsigned long row, float zoom); -Ewk_Tile* ewk_tile_matrix_tile_new(Ewk_Tile_Matrix* tm, Evas* evas, unsigned long col, unsigned long row, float zoom); -Eina_Bool ewk_tile_matrix_tile_put(Ewk_Tile_Matrix* tm, Ewk_Tile* t, double last_used); +Ewk_Tile *ewk_tile_matrix_tile_exact_get(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row, float zoom); +Eina_Bool ewk_tile_matrix_tile_exact_exists(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row, float zoom); +Ewk_Tile *ewk_tile_matrix_tile_nearest_get(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row, float zoom); +Ewk_Tile *ewk_tile_matrix_tile_new(Ewk_Tile_Matrix *tm, Evas *evas, unsigned long col, unsigned long row, float zoom); +Eina_Bool ewk_tile_matrix_tile_put(Ewk_Tile_Matrix *tm, Ewk_Tile *t, double last_used); -Eina_Bool ewk_tile_matrix_tile_update(Ewk_Tile_Matrix* tm, unsigned long col, unsigned long row, const Eina_Rectangle* update); -Eina_Bool ewk_tile_matrix_tile_update_full(Ewk_Tile_Matrix* tm, unsigned long col, unsigned long row); -void ewk_tile_matrix_tile_updates_clear(Ewk_Tile_Matrix* tm, Ewk_Tile* t); +Eina_Bool ewk_tile_matrix_tile_update(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row, const Eina_Rectangle *update); +Eina_Bool ewk_tile_matrix_tile_update_full(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row); +void ewk_tile_matrix_tile_updates_clear(Ewk_Tile_Matrix *tm, Ewk_Tile *t); -Eina_Bool ewk_tile_matrix_update(Ewk_Tile_Matrix* tm, const Eina_Rectangle* update, float zoom); -void ewk_tile_matrix_updates_process(Ewk_Tile_Matrix* tm); -void ewk_tile_matrix_updates_clear(Ewk_Tile_Matrix* tm); -void ewk_tile_matrix_freeze(Ewk_Tile_Matrix* tm); -void ewk_tile_matrix_thaw(Ewk_Tile_Matrix* tm); +Eina_Bool ewk_tile_matrix_update(Ewk_Tile_Matrix *tm, const Eina_Rectangle *update, float zoom); +void ewk_tile_matrix_updates_process(Ewk_Tile_Matrix *tm); +void ewk_tile_matrix_updates_clear(Ewk_Tile_Matrix *tm); +void ewk_tile_matrix_freeze(Ewk_Tile_Matrix *tm); +void ewk_tile_matrix_thaw(Ewk_Tile_Matrix *tm); // remove me! -void ewk_tile_matrix_dbg(const Ewk_Tile_Matrix* tm); -void ewk_tile_unused_cache_dbg(const Ewk_Tile_Unused_Cache* tuc); +void ewk_tile_matrix_dbg(const Ewk_Tile_Matrix *tm); +void ewk_tile_unused_cache_dbg(const Ewk_Tile_Unused_Cache *tuc); void ewk_tile_accounting_dbg(); - #endif // ewk_tiled_matrix_h - diff --git a/Source/WebKit/efl/ewk/ewk_tiled_model.cpp b/Source/WebKit/efl/ewk/ewk_tiled_model.cpp index 84048cbf6..87fa83c11 100644 --- a/Source/WebKit/efl/ewk/ewk_tiled_model.cpp +++ b/Source/WebKit/efl/ewk/ewk_tiled_model.cpp @@ -345,16 +345,16 @@ void ewk_tile_updates_process(Ewk_Tile* tile, void (*callback)(void* data, Ewk_T rect.h = tile->height; #ifdef TILE_STATS_ACCOUNT_RENDER_TIME struct timeval timev; - double render_start; + double renderStartTime; gettimeofday(&timev, 0); - render_startile = (double)timev.tv_sec + + renderStartTime = (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); #endif callback((void*)data, tile, &rect); #ifdef TILE_STATS_ACCOUNT_RENDER_TIME gettimeofday(&timev, 0); tile->stats.render_time = (double)timev.tv_sec + - (((double)timev.tv_usec) / 1000000) - render_start; + (((double)timev.tv_usec) / 1000000) - renderStartTime; #endif } else if (tile->updates) { Eina_Iterator* itr = eina_tiler_iterator_new(tile->updates); @@ -520,7 +520,7 @@ void ewk_tile_unused_cache_clear(Ewk_Tile_Unused_Cache* tileUnusedCache) } /** - * heightold reference to cache. + * Hold reference to cache. * * @return same pointer as taken. * @@ -630,7 +630,7 @@ void ewk_tile_unused_cache_auto_flush(Ewk_Tile_Unused_Cache* tileUnusedCache) * Freeze cache to not do maintenance tasks. * * Maintenance tasks optimize cache usage, but maybe we know we should - * heightold on them until we do the last operation, in this case we freeze + * hold on them until we do the last operation, in this case we freeze * while operating and then thaw when we're done. * * @see ewk_tile_unused_cache_thaw() @@ -707,8 +707,8 @@ Eina_Bool ewk_tile_unused_cache_tile_get(Ewk_Tile_Unused_Cache* tileUnusedCache, * because usually we want a lazy operation for better performance. * * @param tileUnusedCache cache of unused tiles - * @param t tile to be added to cache. - * @param tile_free_cb function used to free tiles. + * @param tile tile to be added to cache. + * @param tileFreeCallback function used to free tiles. * @param data context to give back to @a tile_free_cb as first argument. * * @return #true on success, #false otherwise. If @c tile->visible @@ -716,7 +716,7 @@ Eina_Bool ewk_tile_unused_cache_tile_get(Ewk_Tile_Unused_Cache* tileUnusedCache, * * @see ewk_tile_unused_cache_auto_flush() */ -Eina_Bool ewk_tile_unused_cache_tile_put(Ewk_Tile_Unused_Cache* tileUnusedCache, Ewk_Tile* tile, void (* tileFreeCb)(void* data, Ewk_Tile* tile), const void* data) +Eina_Bool ewk_tile_unused_cache_tile_put(Ewk_Tile_Unused_Cache* tileUnusedCache, Ewk_Tile* tile, void (* tileFreeCallback)(void* data, Ewk_Tile* tile), const void* data) { Ewk_Tile_Unused_Cache_Entry* unusedCacheEntry; @@ -737,7 +737,7 @@ Eina_Bool ewk_tile_unused_cache_tile_put(Ewk_Tile_Unused_Cache* tileUnusedCache, unusedCacheEntry->tile = tile; unusedCacheEntry->weight = 0; /* calculated just before sort */ - unusedCacheEntry->tile_free.callback = tileFreeCb; + unusedCacheEntry->tile_free.callback = tileFreeCallback; unusedCacheEntry->tile_free.data = (void*)data; tileUnusedCache->entries.count++; @@ -758,7 +758,7 @@ void ewk_tile_unused_cache_dbg(const Ewk_Tile_Unused_Cache* tileUnusedCache) EINA_LIST_FOREACH(tileUnusedCache->entries.list, list, item) { const Ewk_Tile* tile = static_cast<Ewk_Tile_Unused_Cache_Entry*>(item)->tile; printf(" [%3lu,%3lu + %dx%d @ %0.3f]%c", - tile->col, tile->row, tile->width, tile->height, tile->zoom, + tile->column, tile->row, tile->width, tile->height, tile->zoom, tile->visible ? '*' : ' '); if (!(count % 4)) diff --git a/Source/WebKit/efl/ewk/ewk_tiled_model.h b/Source/WebKit/efl/ewk/ewk_tiled_model.h index 58716c563..daaf21389 100644 --- a/Source/WebKit/efl/ewk/ewk_tiled_model.h +++ b/Source/WebKit/efl/ewk/ewk_tiled_model.h @@ -26,32 +26,31 @@ #include <Evas.h> /* model */ -Ewk_Tile* ewk_tile_new(Evas* evas, Evas_Coord w, Evas_Coord h, float zoom, Evas_Colorspace cspace); -void ewk_tile_free(Ewk_Tile* t); -void ewk_tile_unused_cache_clear(Ewk_Tile_Unused_Cache* tuc); -void ewk_tile_show(Ewk_Tile* t); -void ewk_tile_hide(Ewk_Tile* t); -size_t ewk_tile_memory_size_get(const Ewk_Tile* t); -Eina_Bool ewk_tile_visible_get(Ewk_Tile* t); -void ewk_tile_update_full(Ewk_Tile* t); -void ewk_tile_update_area(Ewk_Tile* t, const Eina_Rectangle* r); -void ewk_tile_updates_process(Ewk_Tile* t, void (*cb)(void* data, Ewk_Tile* t, const Eina_Rectangle* update), const void* data); -void ewk_tile_updates_clear(Ewk_Tile* t); +Ewk_Tile *ewk_tile_new(Evas *evas, Evas_Coord w, Evas_Coord h, float zoom, Evas_Colorspace cspace); +void ewk_tile_free(Ewk_Tile *t); +void ewk_tile_unused_cache_clear(Ewk_Tile_Unused_Cache *tuc); +void ewk_tile_show(Ewk_Tile *t); +void ewk_tile_hide(Ewk_Tile *t); +size_t ewk_tile_memory_size_get(const Ewk_Tile *t); +Eina_Bool ewk_tile_visible_get(Ewk_Tile *t); +void ewk_tile_update_full(Ewk_Tile *t); +void ewk_tile_update_area(Ewk_Tile *t, const Eina_Rectangle *r); +void ewk_tile_updates_process(Ewk_Tile *t, void (*cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *update), const void *data); +void ewk_tile_updates_clear(Ewk_Tile *t); /* cache of unused tiles */ -Ewk_Tile_Unused_Cache* ewk_tile_unused_cache_new(size_t max); -void ewk_tile_unused_cache_lock_area(Ewk_Tile_Unused_Cache* tuc, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom); -void ewk_tile_unused_cache_unlock_area(Ewk_Tile_Unused_Cache* tuc); -Ewk_Tile_Unused_Cache* ewk_tile_unused_cache_ref(Ewk_Tile_Unused_Cache* tuc); -void ewk_tile_unused_cache_unref(Ewk_Tile_Unused_Cache* tuc); +Ewk_Tile_Unused_Cache *ewk_tile_unused_cache_new(size_t max); +void ewk_tile_unused_cache_lock_area(Ewk_Tile_Unused_Cache *tuc, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom); +void ewk_tile_unused_cache_unlock_area(Ewk_Tile_Unused_Cache *tuc); +Ewk_Tile_Unused_Cache *ewk_tile_unused_cache_ref(Ewk_Tile_Unused_Cache *tuc); +void ewk_tile_unused_cache_unref(Ewk_Tile_Unused_Cache *tuc); -void ewk_tile_unused_cache_dirty(Ewk_Tile_Unused_Cache* tuc); +void ewk_tile_unused_cache_dirty(Ewk_Tile_Unused_Cache *tuc); -void ewk_tile_unused_cache_freeze(Ewk_Tile_Unused_Cache* tuc); -void ewk_tile_unused_cache_thaw(Ewk_Tile_Unused_Cache* tuc); +void ewk_tile_unused_cache_freeze(Ewk_Tile_Unused_Cache *tuc); +void ewk_tile_unused_cache_thaw(Ewk_Tile_Unused_Cache *tuc); -Eina_Bool ewk_tile_unused_cache_tile_get(Ewk_Tile_Unused_Cache* tuc, Ewk_Tile* t); -Eina_Bool ewk_tile_unused_cache_tile_put(Ewk_Tile_Unused_Cache* tuc, Ewk_Tile* t, void (* tile_free_cb)(void* data, Ewk_Tile* t), const void* data); +Eina_Bool ewk_tile_unused_cache_tile_get(Ewk_Tile_Unused_Cache *tuc, Ewk_Tile *t); +Eina_Bool ewk_tile_unused_cache_tile_put(Ewk_Tile_Unused_Cache *tuc, Ewk_Tile *t, void (* tile_free_cb)(void *data, Ewk_Tile *t), const void *data); #endif // ewk_tiled_model_h - diff --git a/Source/WebKit/efl/ewk/ewk_util.h b/Source/WebKit/efl/ewk/ewk_util.h index 2371888a0..3b32d9c88 100644 --- a/Source/WebKit/efl/ewk/ewk_util.h +++ b/Source/WebKit/efl/ewk/ewk_util.h @@ -29,6 +29,6 @@ #include <Evas.h> #include <cairo.h> -Evas_Object* ewk_util_image_from_cairo_surface_add(Evas* canvas, cairo_surface_t* surface); +Evas_Object *ewk_util_image_from_cairo_surface_add(Evas *canvas, cairo_surface_t *surface); #endif // ewk_util_h diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp index 853b342eb..9789c1c30 100644 --- a/Source/WebKit/efl/ewk/ewk_view.cpp +++ b/Source/WebKit/efl/ewk/ewk_view.cpp @@ -216,59 +216,53 @@ struct _Ewk_View_Private_Data { #ifndef EWK_TYPE_CHECK #define EWK_VIEW_TYPE_CHECK(ewkView, ...) do { } while (0) #else -#define EWK_VIEW_TYPE_CHECK(ewkView, ...) \ - do { \ - const char* _tmp_otype = evas_object_type_get(ewkView); \ - const Evas_Smart* _tmp_s = evas_object_smart_smart_get(ewkView); \ - if (EINA_UNLIKELY(!_tmp_s)) { \ - EINA_LOG_CRIT \ - ("%p (%s) is not a smart object!", ewkView, \ - _tmp_otype ? _tmp_otype : "(null)"); \ - return __VA_ARGS__; \ - } \ +#define EWK_VIEW_TYPE_CHECK(ewkView, ...) \ + do { \ + const char* _tmp_otype = evas_object_type_get(ewkView); \ + const Evas_Smart* _tmp_s = evas_object_smart_smart_get(ewkView); \ + if (EINA_UNLIKELY(!_tmp_s)) { \ + EINA_LOG_CRIT \ + ("%p (%s) is not a smart object!", ewkView, \ + _tmp_otype ? _tmp_otype : "(null)"); \ + return __VA_ARGS__; \ + } \ const Evas_Smart_Class* _tmp_sc = evas_smart_class_get(_tmp_s); \ - if (EINA_UNLIKELY(!_tmp_sc)) { \ - EINA_LOG_CRIT \ - ("%p (%s) is not a smart object!", ewkView, \ - _tmp_otype ? _tmp_otype : "(null)"); \ - return __VA_ARGS__; \ - } \ - if (EINA_UNLIKELY(_tmp_sc->data != ewkViewTypeString)) { \ - EINA_LOG_CRIT \ - ("%p (%s) is not of an ewk_view (need %p, got %p)!", \ - ewkView, _tmp_otype ? _tmp_otype : "(null)", \ - ewkViewTypeString, _tmp_sc->data); \ - return __VA_ARGS__; \ - } \ + if (EINA_UNLIKELY(!_tmp_sc)) { \ + EINA_LOG_CRIT \ + ("%p (%s) is not a smart object!", ewkView, \ + _tmp_otype ? _tmp_otype : "(null)"); \ + return __VA_ARGS__; \ + } \ + if (EINA_UNLIKELY(_tmp_sc->data != ewkViewTypeString)) { \ + EINA_LOG_CRIT \ + ("%p (%s) is not of an ewk_view (need %p, got %p)!", \ + ewkView, _tmp_otype ? _tmp_otype : "(null)", \ + ewkViewTypeString, _tmp_sc->data); \ + return __VA_ARGS__; \ + } \ } while (0) #endif -#define EWK_VIEW_SD_GET(ewkView, ptr) \ - Ewk_View_Smart_Data* ptr = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(ewkView)) +#define EWK_VIEW_SD_GET(ewkView, pointer) \ + Ewk_View_Smart_Data* pointer = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(ewkView)) -#define EWK_VIEW_SD_GET_OR_RETURN(ewkView, ptr, ...) \ - EWK_VIEW_TYPE_CHECK(ewkView, __VA_ARGS__); \ - EWK_VIEW_SD_GET(ewkView, ptr); \ - if (!ptr) { \ - CRITICAL("no smart data for object %p (%s)", \ - ewkView, evas_object_type_get(ewkView)); \ - return __VA_ARGS__; \ +#define EWK_VIEW_SD_GET_OR_RETURN(ewkView, pointer, ...) \ + EWK_VIEW_TYPE_CHECK(ewkView, __VA_ARGS__); \ + EWK_VIEW_SD_GET(ewkView, pointer); \ + if (!pointer) { \ + CRITICAL("no smart data for object %p (%s)", \ + ewkView, evas_object_type_get(ewkView)); \ + return __VA_ARGS__; \ } -#define EWK_VIEW_PRIV_GET(smartData, ptr) \ - Ewk_View_Private_Data *ptr = smartData->_priv - -#define EWK_VIEW_PRIV_GET_OR_RETURN(smartData, ptr, ...) \ - EWK_VIEW_PRIV_GET(smartData, ptr); \ - if (!ptr) { \ - CRITICAL("no private data for object %p (%s)", \ - smartData->self, evas_object_type_get(smartData->self)); \ - return __VA_ARGS__; \ - } +#define EWK_VIEW_PRIV_GET(smartData, pointer) \ + Ewk_View_Private_Data* pointer = smartData->_priv -#define EWK_VIEW_TILED_TYPE_CHECK_OR_RETURN(ewkView, ...) \ - if (!evas_object_smart_type_check(ewkView, ewkViewTiledName)) { \ - INF("object isn't an instance of %s", ewkViewTiledName); \ +#define EWK_VIEW_PRIV_GET_OR_RETURN(smartData, pointer, ...) \ + EWK_VIEW_PRIV_GET(smartData, pointer); \ + if (!pointer) { \ + CRITICAL("no private data for object %p (%s)", \ + smartData->self, evas_object_type_get(smartData->self)); \ return __VA_ARGS__; \ } @@ -410,12 +404,12 @@ static void _ewk_view_scrolls_flush(Ewk_View_Private_Data* priv) static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* smartData) { EWK_VIEW_PRIV_GET(smartData, priv); - WebCore::FocusController* fc = priv->page->focusController(); - DBG("ewkView=%p, fc=%p", smartData->self, fc); - EINA_SAFETY_ON_NULL_RETURN_VAL(fc, false); + WebCore::FocusController* focusController = priv->page->focusController(); + DBG("ewkView=%p, focusController=%p", smartData->self, focusController); + EINA_SAFETY_ON_NULL_RETURN_VAL(focusController, false); - fc->setActive(true); - fc->setFocused(true); + focusController->setActive(true); + focusController->setFocused(true); return true; } @@ -648,6 +642,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) priv->pageSettings->setOfflineWebApplicationCacheEnabled(true); priv->pageSettings->setUsesPageCache(true); priv->pageSettings->setUsesEncodingDetector(false); + priv->pageSettings->setWebGLEnabled(true); url = priv->pageSettings->userStyleSheetLocation(); priv->settings.userStylesheet = eina_stringshare_add(url.string().utf8().data()); @@ -994,7 +989,7 @@ static void _ewk_view_smart_flush(Ewk_View_Smart_Data* smartData) static Eina_Bool _ewk_view_smart_pre_render_region(Ewk_View_Smart_Data* smartData, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom) { - WRN("not supported by engine. smartDAta=%p area=%d,%d+%dx%d, zoom=%f", + WRN("not supported by engine. smartData=%p area=%d,%d+%dx%d, zoom=%f", smartData, x, y, width, height, zoom); return false; } @@ -1790,7 +1785,7 @@ Eina_Bool ewk_view_pre_render_region(Evas_Object* ewkView, Evas_Coord x, Evas_Co EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false); EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false); EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api->pre_render_region, false); - float cur_zoom; + float currentZoom; Evas_Coord contentsWidth, contentsHeight; /* When doing animated zoom it's not possible to call pre-render since it @@ -1799,15 +1794,15 @@ Eina_Bool ewk_view_pre_render_region(Evas_Object* ewkView, Evas_Coord x, Evas_Co if (priv->animatedZoom.animator) return false; - cur_zoom = ewk_frame_page_zoom_get(smartData->main_frame); + currentZoom = ewk_frame_page_zoom_get(smartData->main_frame); - if (cur_zoom < 0.00001) + if (currentZoom < 0.00001) return false; if (!ewk_frame_contents_size_get(smartData->main_frame, &contentsWidth, &contentsHeight)) return false; - contentsWidth *= zoom / cur_zoom; - contentsHeight *= zoom / cur_zoom; + contentsWidth *= zoom / currentZoom; + contentsHeight *= zoom / currentZoom; DBG("region %d,%d+%dx%d @ %f contents=%dx%d", x, y, width, height, zoom, contentsWidth, contentsHeight); if (x + width > contentsWidth) @@ -2957,8 +2952,8 @@ void ewk_view_restore_state(Evas_Object* ewkView, Evas_Object* frame) * @param ewkView Current view. * @param javascript @c true if the new window is originated from javascript, * @c false otherwise - * @param widthindow_features Features of the new window being created. If it's @c - * NULL, it will be created a window with default features. + * @param window_features Features of the new window being created. If it's @c + * 0, it will be created a window with default features. * * @return New view, in case smart class implements the creation of new windows; * else, current view @param ewkView or @c 0 on failure. @@ -3050,7 +3045,7 @@ void ewk_view_toolbars_visible_set(Evas_Object* ewkView, bool visible) */ void ewk_view_toolbars_visible_get(Evas_Object* ewkView, bool* visible) { - DBG("%s, o=%p", __func__, ewkView); + DBG("%s, ewkView=%p", __func__, ewkView); *visible = false; evas_object_smart_callback_call(ewkView, "toolbars,visible,get", visible); } @@ -3083,7 +3078,7 @@ void ewk_view_statusbar_visible_set(Evas_Object* ewkView, bool visible) */ void ewk_view_statusbar_visible_get(Evas_Object* ewkView, bool* visible) { - DBG("%s, o=%p", __func__, ewkView); + DBG("%s, ewkView=%p", __func__, ewkView); *visible = false; evas_object_smart_callback_call(ewkView, "statusbar,visible,get", visible); } @@ -3132,7 +3127,7 @@ void ewk_view_scrollbars_visible_set(Evas_Object* ewkView, bool visible) */ void ewk_view_scrollbars_visible_get(Evas_Object* ewkView, bool* visible) { - DBG("%s, o=%p", __func__, ewkView); + DBG("%s, ewkView=%p", __func__, ewkView); *visible = false; evas_object_smart_callback_call(ewkView, "scrollbars,visible,get", visible); } @@ -3165,7 +3160,7 @@ void ewk_view_menubar_visible_set(Evas_Object* ewkView, bool visible) */ void ewk_view_menubar_visible_get(Evas_Object* ewkView, bool* visible) { - DBG("%s, o=%p", __func__, ewkView); + DBG("%s, ewkView=%p", __func__, ewkView); *visible = false; evas_object_smart_callback_call(ewkView, "menubar,visible,get", visible); } @@ -3215,7 +3210,7 @@ void ewk_view_add_console_message(Evas_Object* ewkView, const char* message, uns */ void ewk_view_frame_view_creation_notify(Evas_Object* ewkView) { - EWK_VIEW_TILED_TYPE_CHECK_OR_RETURN(ewkView); + EWK_VIEW_TYPE_CHECK_OR_RETURN(ewkView, ewkViewTiledName); EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); ewk_frame_paint_full_set(smartData->main_frame, true); } @@ -3593,7 +3588,7 @@ Eina_Bool ewk_view_zoom_range_set(Evas_Object* ewkView, float minScale, float ma EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false); if (maxScale < minScale) { - WRN("min_scale is larger than max_scale"); + WRN("minScale is larger than maxScale"); return false; } diff --git a/Source/WebKit/efl/ewk/ewk_view.h b/Source/WebKit/efl/ewk/ewk_view.h index a4335374f..d3474a64b 100644 --- a/Source/WebKit/efl/ewk/ewk_view.h +++ b/Source/WebKit/efl/ewk/ewk_view.h @@ -1442,7 +1442,7 @@ EAPI Eina_Bool ewk_view_setting_enable_plugins_set(Evas_Object *o, Eina_Bool * @return @c EINA_TRUE if the frame flattening feature is enabled, * @c EINA_FALSE if not or on failure */ -EAPI Eina_Bool ewk_view_setting_enable_frame_flattening_get(const Evas_Object* o); +EAPI Eina_Bool ewk_view_setting_enable_frame_flattening_get(const Evas_Object *o); /** * Enables/disables the frame flattening feature. @@ -1453,7 +1453,7 @@ EAPI Eina_Bool ewk_view_setting_enable_frame_flattening_get(const Evas_Object * * @return @c EINA_TRUE on success or @c EINA_FALSE on failure */ -EAPI Eina_Bool ewk_view_setting_enable_frame_flattening_set(Evas_Object* o, Eina_Bool enable); +EAPI Eina_Bool ewk_view_setting_enable_frame_flattening_set(Evas_Object *o, Eina_Bool enable); /** * Queries if the scripts can open the new windows. @@ -2288,7 +2288,7 @@ typedef enum _Ewk_Page_Visibility_State Ewk_Page_Visibility_State; * * @return @c EINA_TRUE on success or @c EINA_FALSE on failure. */ -EAPI Eina_Bool ewk_view_visibility_state_set(Evas_Object* o, Ewk_Page_Visibility_State page_visible_state, Eina_Bool initial_state); +EAPI Eina_Bool ewk_view_visibility_state_set(Evas_Object *o, Ewk_Page_Visibility_State page_visible_state, Eina_Bool initial_state); /** * Gets the visibility state of the page. diff --git a/Source/WebKit/efl/ewk/ewk_view_single.cpp b/Source/WebKit/efl/ewk/ewk_view_single.cpp index 526524bdd..4981ef0cc 100644 --- a/Source/WebKit/efl/ewk/ewk_view_single.cpp +++ b/Source/WebKit/efl/ewk/ewk_view_single.cpp @@ -9,7 +9,7 @@ This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERchANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License @@ -216,8 +216,8 @@ static Eina_Bool _ewk_view_single_smart_repaints_process(Ewk_View_Smart_Data* sm Evas_Coord ow, oh; void* pixels; Eina_Rectangle* rect; - const Eina_Rectangle* pr; - const Eina_Rectangle* pr_end; + const Eina_Rectangle* paintRequest; + const Eina_Rectangle* paintRequestEnd; Eina_Tiler* tiler; Eina_Iterator* iterator; cairo_status_t status; @@ -284,10 +284,10 @@ static Eina_Bool _ewk_view_single_smart_repaints_process(Ewk_View_Smart_Data* sm ewk_view_layout_if_needed_recursive(smartData->_priv); - pr = ewk_view_repaints_pop(smartData->_priv, &count); - pr_end = pr + count; - for (; pr < pr_end; pr++) - eina_tiler_rect_add(tiler, pr); + paintRequest = ewk_view_repaints_pop(smartData->_priv, &count); + paintRequestEnd = paintRequest + count; + for (; paintRequest < paintRequestEnd; paintRequest++) + eina_tiler_rect_add(tiler, paintRequest); iterator = eina_tiler_iterator_new(tiler); if (!iterator) { diff --git a/Source/WebKit/efl/ewk/ewk_view_tiled.cpp b/Source/WebKit/efl/ewk/ewk_view_tiled.cpp index e5b826319..bfb2d95f8 100644 --- a/Source/WebKit/efl/ewk/ewk_view_tiled.cpp +++ b/Source/WebKit/efl/ewk/ewk_view_tiled.cpp @@ -77,12 +77,12 @@ static void* _ewk_view_tiled_updates_process_pre(void* data, Evas_Object* ewkVie static Evas_Object* _ewk_view_tiled_smart_backing_store_add(Ewk_View_Smart_Data* smartData) { - Evas_Object* bs = ewk_tiled_backing_store_add(smartData->base.evas); + Evas_Object* backingStore = ewk_tiled_backing_store_add(smartData->base.evas); ewk_tiled_backing_store_render_cb_set - (bs, _ewk_view_tiled_render_cb, smartData->_priv); + (backingStore, _ewk_view_tiled_render_cb, smartData->_priv); ewk_tiled_backing_store_updates_process_pre_set - (bs, _ewk_view_tiled_updates_process_pre, smartData->_priv); - return bs; + (backingStore, _ewk_view_tiled_updates_process_pre, smartData->_priv); + return backingStore; } static void @@ -97,17 +97,17 @@ _ewk_view_tiled_contents_size_changed_cb(void* data, Evas_Object* ewkView, void* static void _ewk_view_tiled_smart_add(Evas_Object* ewkView) { - Ewk_View_Smart_Data* sd; + Ewk_View_Smart_Data* smartData; _parent_sc.sc.add(ewkView); - sd = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(ewkView)); - if (!sd) + smartData = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(ewkView)); + if (!smartData) return; evas_object_smart_callback_add( - sd->main_frame, "contents,size,changed", - _ewk_view_tiled_contents_size_changed_cb, sd); + smartData->main_frame, "contents,size,changed", + _ewk_view_tiled_contents_size_changed_cb, smartData); } static Eina_Bool _ewk_view_tiled_smart_scrolls_process(Ewk_View_Smart_Data* smartData) @@ -392,14 +392,16 @@ Evas_Object* ewk_view_tiled_add(Evas* canvas) Ewk_Tile_Unused_Cache* ewk_view_tiled_unused_cache_get(const Evas_Object* ewkView) { - Ewk_View_Smart_Data* sd = ewk_view_smart_data_get(ewkView); - EINA_SAFETY_ON_NULL_RETURN_VAL(sd, 0); - return ewk_tiled_backing_store_tile_unused_cache_get(sd->backing_store); + EWK_VIEW_TYPE_CHECK_OR_RETURN(ewkView, ewkViewTiledName, 0); + Ewk_View_Smart_Data* smartData = ewk_view_smart_data_get(ewkView); + EINA_SAFETY_ON_NULL_RETURN_VAL(smartData, 0); + return ewk_tiled_backing_store_tile_unused_cache_get(smartData->backing_store); } void ewk_view_tiled_unused_cache_set(Evas_Object* ewkView, Ewk_Tile_Unused_Cache* cache) { - Ewk_View_Smart_Data* sd = ewk_view_smart_data_get(ewkView); - EINA_SAFETY_ON_NULL_RETURN(sd); - ewk_tiled_backing_store_tile_unused_cache_set(sd->backing_store, cache); + EWK_VIEW_TYPE_CHECK_OR_RETURN(ewkView, ewkViewTiledName); + Ewk_View_Smart_Data* smartData = ewk_view_smart_data_get(ewkView); + EINA_SAFETY_ON_NULL_RETURN(smartData); + ewk_tiled_backing_store_tile_unused_cache_set(smartData->backing_store, cache); } |