eve: Add support for Tiled Backing store
By enabling the Tiled Backing Store, memory consumption will be smaller, and scrolling and rendering large pages will also receive a substantial boost. The TBS implementation available on WebKit upstream, however, is still buggy -- this is being committed so that Eve is prepared whenever upstream WebKit is on a workable state again. Patch by Alex Grilo <abgrilo@profusion.mobi> SVN revision: 55455
This commit is contained in:
parent
c56265de61
commit
6cba300d84
|
@ -315,6 +315,18 @@ static More_Menu_Item more_menu_config[] =
|
|||
{ NULL, 0, EINA_FALSE },
|
||||
}
|
||||
}}, NULL, ITEM_FLAG_ARROW | ITEM_FLAG_SELECTABLE },
|
||||
{ ITEM_TYPE_CONFIG, "Backing Store",
|
||||
(More_Menu_Config[]) {{
|
||||
.type = CONFIG_TYPE_LIST_INT,
|
||||
.conf = EVE_CONFIG_MINIMUM_FONT_SIZE,
|
||||
.conf_get = config_backing_store_get,
|
||||
.conf_set = config_backing_store_set,
|
||||
.data = (More_Menu_Config_List_Int[]) {
|
||||
{ "Single", BACKING_STORE_SINGLE, EINA_TRUE },
|
||||
{ "Tiled", BACKING_STORE_TILED, EINA_FALSE },
|
||||
{ NULL, 0, EINA_FALSE }
|
||||
}
|
||||
}}, NULL, ITEM_FLAG_ARROW | ITEM_FLAG_SELECTABLE },
|
||||
{ ITEM_TYPE_LAST, NULL, NULL, NULL, ITEM_FLAG_NONE },
|
||||
}, NULL, ITEM_FLAG_ARROW },
|
||||
{ ITEM_TYPE_SEPARATOR, NULL, NULL, NULL, ITEM_FLAG_NONE },
|
||||
|
@ -2500,7 +2512,7 @@ chrome_add(Browser_Window *win, const char *url, Session_Item *session_item)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
view = view_add(win->win);
|
||||
view = view_add(win->win, config_backing_store_get(config));
|
||||
if (!view)
|
||||
{
|
||||
CRITICAL("Could not create view");
|
||||
|
|
|
@ -27,6 +27,7 @@ struct _Config {
|
|||
int minimum_font_size;
|
||||
const char *__eet_filename;
|
||||
int cookie_policy;
|
||||
int backing_store;
|
||||
};
|
||||
|
||||
struct _Hist_Item {
|
||||
|
@ -113,6 +114,7 @@ _config_init(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "text_only_zoom", text_only_zoom, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "minimum_font_size", minimum_font_size, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "cookie_policy", cookie_policy, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "backing_store", backing_store, EET_T_INT);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -124,7 +126,7 @@ _config_shutdown(void)
|
|||
}
|
||||
|
||||
Config *
|
||||
config_new(unsigned char allow_popup, unsigned char enable_auto_load_images, unsigned char enable_auto_shrink_images, unsigned char enable_javascript, unsigned char enable_mouse_cursor, unsigned char enable_plugins, unsigned char enable_private_mode, unsigned char enable_touch_interface, const char * home_page, const char * proxy, unsigned char restore_state, const char * user_agent, unsigned char frame_flattening, unsigned char text_only_zoom, int minimum_font_size, int cookie_policy)
|
||||
config_new(unsigned char allow_popup, unsigned char enable_auto_load_images, unsigned char enable_auto_shrink_images, unsigned char enable_javascript, unsigned char enable_mouse_cursor, unsigned char enable_plugins, unsigned char enable_private_mode, unsigned char enable_touch_interface, const char * home_page, const char * proxy, unsigned char restore_state, const char * user_agent, unsigned char frame_flattening, unsigned char text_only_zoom, int minimum_font_size, int cookie_policy, int backing_store)
|
||||
{
|
||||
Config *config = calloc(1, sizeof(Config));
|
||||
|
||||
|
@ -150,6 +152,7 @@ config_new(unsigned char allow_popup, unsigned char enable_auto_load_images, uns
|
|||
config->text_only_zoom = text_only_zoom;
|
||||
config->minimum_font_size = minimum_font_size;
|
||||
config->cookie_policy = cookie_policy;
|
||||
config->backing_store = backing_store;
|
||||
|
||||
return config;
|
||||
}
|
||||
|
@ -370,6 +373,19 @@ config_cookie_policy_set(Config *config, int cookie_policy)
|
|||
EINA_SAFETY_ON_NULL_RETURN(config);
|
||||
config->cookie_policy = cookie_policy;
|
||||
}
|
||||
|
||||
inline int
|
||||
config_backing_store_get(const Config *config)
|
||||
{
|
||||
return config->backing_store;
|
||||
}
|
||||
|
||||
inline void
|
||||
config_backing_store_set(Config *config, int backing_store)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN(config);
|
||||
config->backing_store = backing_store;
|
||||
}
|
||||
|
||||
Config *
|
||||
config_load(const char *filename)
|
||||
|
|
|
@ -15,6 +15,7 @@ Config {
|
|||
text_only_zoom : uchar;
|
||||
minimum_font_size : int;
|
||||
cookie_policy : int;
|
||||
backing_store : int;
|
||||
}
|
||||
|
||||
Hist_Item {
|
||||
|
|
|
@ -17,7 +17,7 @@ typedef struct _Session_Window Session_Window;
|
|||
typedef struct _Session Session;
|
||||
|
||||
/* Config */
|
||||
Config *config_new(unsigned char allow_popup, unsigned char enable_auto_load_images, unsigned char enable_auto_shrink_images, unsigned char enable_javascript, unsigned char enable_mouse_cursor, unsigned char enable_plugins, unsigned char enable_private_mode, unsigned char enable_touch_interface, const char * home_page, const char * proxy, unsigned char restore_state, const char * user_agent, unsigned char frame_flattening, unsigned char text_only_zoom, int minimum_font_size, int cookie_policy);
|
||||
Config *config_new(unsigned char allow_popup, unsigned char enable_auto_load_images, unsigned char enable_auto_shrink_images, unsigned char enable_javascript, unsigned char enable_mouse_cursor, unsigned char enable_plugins, unsigned char enable_private_mode, unsigned char enable_touch_interface, const char * home_page, const char * proxy, unsigned char restore_state, const char * user_agent, unsigned char frame_flattening, unsigned char text_only_zoom, int minimum_font_size, int cookie_policy, int backing_store);
|
||||
void config_free(Config *config);
|
||||
|
||||
void config_allow_popup_set(Config *config, unsigned char allow_popup);
|
||||
|
@ -52,6 +52,8 @@ void config_minimum_font_size_set(Config *config, int minimum_font_size);
|
|||
int config_minimum_font_size_get(const Config *config);
|
||||
void config_cookie_policy_set(Config *config, int cookie_policy);
|
||||
int config_cookie_policy_get(const Config *config);
|
||||
void config_backing_store_set(Config *config, int backing_store);
|
||||
int config_backing_store_get(const Config *config);
|
||||
|
||||
Config *config_load(const char *filename);
|
||||
Eina_Bool config_save(Config *config, const char *filename);
|
||||
|
|
|
@ -283,7 +283,7 @@ win_add(App *app, const char *url, Session_Window *session_window, Session_Item
|
|||
goto error_pager_create;
|
||||
}
|
||||
|
||||
elm_object_style_set(win->pager, "ewebkit");
|
||||
elm_object_style_set(win->pager, "flip");
|
||||
evas_object_size_hint_weight_set(win->pager, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win->win, win->pager);
|
||||
|
@ -365,6 +365,8 @@ static const Ecore_Getopt options = {
|
|||
"disable touch interface handling of mouse events", 1),
|
||||
ECORE_GETOPT_STORE_STR('U', "user-agent",
|
||||
"user agent string to use. Special cases=iphone,safari,chrome,firefox,android,ie,ie9,ie8,ie7."),
|
||||
ECORE_GETOPT_STORE_DEF_STR('B', "backing store",
|
||||
"backing store to use. single or tiled.", "single"),
|
||||
ECORE_GETOPT_STORE_DEF_UINT('R', "rotate", "Screen Rotation in degrees", 0),
|
||||
ECORE_GETOPT_VERSION('V', "version"),
|
||||
ECORE_GETOPT_COPYRIGHT('C', "copyright"),
|
||||
|
@ -624,6 +626,8 @@ elm_main(int argc, char **argv)
|
|||
Eina_Bool disable_touch_interface = 0xff;
|
||||
char *user_agent_option = NULL;
|
||||
const char *user_agent_str;
|
||||
char *backing_store_option = NULL;
|
||||
Backing_Store backing_store_enum;
|
||||
E_DBus_Connection *conn = NULL;
|
||||
size_t dirlen;
|
||||
Ecore_Timer *session_save_timer = NULL;
|
||||
|
@ -634,6 +638,7 @@ elm_main(int argc, char **argv)
|
|||
ECORE_GETOPT_VALUE_BOOL(disable_mouse_cursor),
|
||||
ECORE_GETOPT_VALUE_BOOL(disable_touch_interface),
|
||||
ECORE_GETOPT_VALUE_STR(user_agent_option),
|
||||
ECORE_GETOPT_VALUE_STR(backing_store_option),
|
||||
ECORE_GETOPT_VALUE_UINT(app.rotate),
|
||||
ECORE_GETOPT_VALUE_BOOL(quit_option),
|
||||
ECORE_GETOPT_VALUE_BOOL(quit_option),
|
||||
|
@ -700,6 +705,11 @@ elm_main(int argc, char **argv)
|
|||
user_agent_str = user_agent_option;
|
||||
}
|
||||
|
||||
if (backing_store_option && !strcasecmp(backing_store_option, "tiled"))
|
||||
backing_store_enum = BACKING_STORE_TILED;
|
||||
else
|
||||
backing_store_enum = BACKING_STORE_SINGLE;
|
||||
|
||||
elm_theme_extension_add(NULL, PACKAGE_DATA_DIR "/default.edj");
|
||||
ewk_init();
|
||||
eve_state_init();
|
||||
|
@ -771,13 +781,16 @@ elm_main(int argc, char **argv)
|
|||
EINA_FALSE /* frame_flattening */,
|
||||
EINA_FALSE /* text_only_zoom */,
|
||||
12 /* minimum_font_size */,
|
||||
ewk_cookies_policy_get());
|
||||
ewk_cookies_policy_get(),
|
||||
backing_store_enum);
|
||||
if (!config_save(config, path))
|
||||
{
|
||||
r = -1;
|
||||
goto end_config;
|
||||
}
|
||||
}
|
||||
else
|
||||
config_backing_store_set(config, backing_store_enum);
|
||||
|
||||
hist = hist_load(path);
|
||||
if (!hist)
|
||||
|
|
|
@ -65,6 +65,12 @@ struct _View_Zoom_Interactive
|
|||
float zoom;
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BACKING_STORE_SINGLE,
|
||||
BACKING_STORE_TILED
|
||||
} Backing_Store;
|
||||
|
||||
/**
|
||||
* Create new view object.
|
||||
*
|
||||
|
@ -81,7 +87,7 @@ Evas_Object * window_create(void);
|
|||
void window_mouse_enabled_set(Evas_Object *win, Eina_Bool setting);
|
||||
void window_title_set(Browser_Window *win, const char *title);
|
||||
|
||||
Evas_Object * view_add(Evas_Object *parent);
|
||||
Evas_Object * view_add(Evas_Object *parent, Backing_Store bs);
|
||||
void view_zoom_reset(Evas_Object *view);
|
||||
void view_zoom_next_up(Evas_Object *view);
|
||||
void view_zoom_next_down(Evas_Object *view);
|
||||
|
|
|
@ -1500,7 +1500,7 @@ _view_smart_window_close(Ewk_View_Smart_Data *esd)
|
|||
* @return newly added Evas_Object or @c NULL on errors.
|
||||
*/
|
||||
Evas_Object *
|
||||
view_add(Evas_Object *parent)
|
||||
view_add(Evas_Object *parent, Backing_Store bs)
|
||||
{
|
||||
static Evas_Smart *smart = NULL;
|
||||
Evas *canvas = evas_object_evas_get(parent);
|
||||
|
@ -1509,11 +1509,19 @@ view_add(Evas_Object *parent)
|
|||
if (!smart)
|
||||
{
|
||||
/* create ewk_view_single subclass, this is done only once! */
|
||||
static Ewk_View_Smart_Class api = EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION("EWK_View_Single_Demo");
|
||||
static Ewk_View_Smart_Class api = EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION("EWK_View_Demo");
|
||||
|
||||
/* set current and parent apis to vanilla ewk_view_single methods */
|
||||
ewk_view_single_smart_set(&api);
|
||||
ewk_view_single_smart_set(&_parent_sc);
|
||||
if (bs == BACKING_STORE_TILED)
|
||||
{
|
||||
ewk_view_tiled_smart_set(&api);
|
||||
ewk_view_tiled_smart_set(&_parent_sc);
|
||||
}
|
||||
else
|
||||
{
|
||||
ewk_view_single_smart_set(&api);
|
||||
ewk_view_single_smart_set(&_parent_sc);
|
||||
}
|
||||
|
||||
/* override methods we want custom behavior */
|
||||
api.sc.add = _view_smart_add;
|
||||
|
|
Loading…
Reference in New Issue