2010-11-22 Alex Grilo <abgrilo@profusion.mobi>

        Reviewed by Kenneth Rohde Christiansen.

        [EFL] Tiled Backing Store for Webkit-Efl
        https://bugs.webkit.org/show_bug.cgi?id=45397

        This tile based backing store is a grid of tiles where each tile is
        an Evas_Object showing a piece of the page content. The
        new ewk_view_tiled.c is an implementation of some of the functions of
        the original ewk_view, that makes calls to the Tiled Backing Store
        specific functions.

        The rendering occurs in the pixels stored in each tile (Evas_Object),
        in the same way as the previous single backing store. Tiles not being
        shown in the viewport are stored in a cache, and can be reused later
        to avoid having to be rendered again.

        Scrolling occurs as just moving the tiles, using Evas move operations,
        and when more than one tile size is scrolled, a shift of rows or
        columns needs to be done.

        * CMakeListsEfl.txt:
        * ewk/ewk_tiled_backing_store.c: Added.
        (_ewk_tiled_backing_store_updates_process):
        (_ewk_tiled_backing_store_flush):
        (_ewk_tiled_backing_store_tile_new):
        (_ewk_tiled_backing_store_item_move):
        (_ewk_tiled_backing_store_item_resize):
        (_ewk_tiled_backing_store_tile_associate):
        (_ewk_tiled_backing_store_tile_dissociate):
        (_ewk_tiled_backing_store_tile_dissociate_all):
        (_ewk_tiled_backing_store_pre_render_request_add):
        (_ewk_tiled_backing_store_pre_render_request_del):
        (_ewk_tiled_backing_store_pre_render_request_first):
        (_ewk_tiled_backing_store_pre_render_request_flush):
        (_ewk_tiled_backing_store_pre_render_request_remove_unassociated):
        (_ewk_tiled_backing_store_pre_render_request_remove_associated):
        (_ewk_tiled_backing_store_pre_render_request_process_single):
        (_ewk_tiled_backing_store_item_process_idler_cb):
        (_ewk_tiled_backing_store_item_process_idler_stop):
        (_ewk_tiled_backing_store_item_process_idler_start):
        (_ewk_tiled_backing_store_item_request_del):
        (_ewk_tiled_backing_store_item_request_add):
        (_ewk_tiled_backing_store_disable_render):
        (_ewk_tiled_backing_store_enable_render):
        (_ewk_tiled_backing_store_visible_tiles_rect):
        (_ewk_tiled_backing_store_tile_is_inside_viewport):
        (_ewk_tiled_backing_store_tile_is_adjacent_to_viewport):
        (_ewk_tiled_backing_store_item_fill):
        (_ewk_tiled_backing_store_item_add):
        (_ewk_tiled_backing_store_item_del):
        (_ewk_tiled_backing_store_item_smooth_scale_set):
        (_ewk_tiled_backing_store_changed):
        (_ewk_tiled_backing_store_view_cols_end_del):
        (_ewk_tiled_backing_store_view_cols_end_add):
        (_ewk_tiled_backing_store_view_row_del):
        (_ewk_tiled_backing_store_view_rows_range_del):
        (_ewk_tiled_backing_store_view_rows_all_del):
        (_ewk_tiled_backing_store_render):
        (_ewk_tiled_backing_store_model_matrix_create):
        (_ewk_tiled_backing_store_smart_member_del):
        (_ewk_tiled_backing_store_smart_member_add):
        (_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_smart_calculate_size):
        (_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_wrap_right):
        (_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_fill_renderers):
        (_ewk_tiled_backing_store_smart_calculate):
        (ewk_tiled_backing_store_add):
        (ewk_tiled_backing_store_render_cb_set):
        (ewk_tiled_backing_store_tile_unused_cache_get):
        (ewk_tiled_backing_store_tile_unused_cache_set):
        (_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_zoom_weak_smooth_scale_set):
        (ewk_tiled_backing_store_update):
        (ewk_tiled_backing_store_updates_process_pre_set):
        (ewk_tiled_backing_store_updates_process_post_set):
        (ewk_tiled_backing_store_updates_process):
        (ewk_tiled_backing_store_updates_clear):
        (ewk_tiled_backing_store_contents_resize):
        (ewk_tiled_backing_store_disabled_update_set):
        (ewk_tiled_backing_store_flush):
        (ewk_tiled_backing_store_pre_render_region):
        (ewk_tiled_backing_store_pre_render_relative_radius):
        (ewk_tiled_backing_store_pre_render_cancel):
        (ewk_tiled_backing_store_disable_render):
        (ewk_tiled_backing_store_enable_render):
        (ewk_tiled_backing_store_process_entire_queue_set):
        * ewk/ewk_tiled_backing_store.h: Added.
        * ewk/ewk_tiled_matrix.c: Added.
        (_ewk_tile_matrix_cell_free):
        (_ewk_tile_matrix_tile_free):
        (ewk_tile_matrix_new):
        (ewk_tile_matrix_free):
        (ewk_tile_matrix_resize):
        (ewk_tile_matrix_unused_cache_get):
        (ewk_tile_matrix_tile_exact_get):
        (ewk_tile_matrix_tile_exact_exists):
        (ewk_tile_matrix_tile_nearest_get):
        (ewk_tile_matrix_tile_new):
        (ewk_tile_matrix_tile_put):
        (ewk_tile_matrix_tile_update):
        (ewk_tile_matrix_tile_update_full):
        (ewk_tile_matrix_tile_updates_clear):
        (_ewk_tile_matrix_slicer_setup):
        (ewk_tile_matrix_update):
        (ewk_tile_matrix_updates_process):
        (ewk_tile_matrix_updates_clear):
        (ewk_tile_matrix_dbg):
        (ewk_tile_matrix_freeze):
        (ewk_tile_matrix_thaw):
        * ewk/ewk_tiled_matrix.h: Added.
        * ewk/ewk_tiled_model.c: Added.
        (_ewk_tile_account_get):
        (_ewk_tile_account_allocated):
        (_ewk_tile_account_freed):
        (ewk_tile_accounting_dbg):
        (_ewk_tile_paint_rgb888):
        (_ewk_tile_paint_rgb565):
        (_ewk_tile_paint):
        (ewk_tile_new):
        (ewk_tile_free):
        (ewk_tile_show):
        (ewk_tile_hide):
        (ewk_tile_visible_get):
        (ewk_tile_update_full):
        (ewk_tile_update_area):
        (ewk_tile_updates_process):
        (ewk_tile_updates_clear):
        (ewk_tile_unused_cache_new):
        (ewk_tile_unused_cache_lock_area):
        (ewk_tile_unused_cache_unlock_area):
        (ewk_tile_unused_cache_free):
        (ewk_tile_unused_cache_clear):
        (ewk_tile_unused_cache_ref):
        (ewk_tile_unused_cache_unref):
        (ewk_tile_unused_cache_max_set):
        (ewk_tile_unused_cache_max_get):
        (ewk_tile_unused_cache_used_get):
        (ewk_tile_unused_cache_flush):
        (ewk_tile_unused_cache_auto_flush):
        (ewk_tile_unused_cache_dirty):
        (ewk_tile_unused_cache_freeze):
        (ewk_tile_unused_cache_thaw):
        (ewk_tile_unused_cache_tile_get):
        (ewk_tile_unused_cache_tile_put):
        (ewk_tile_unused_cache_dbg):
        * ewk/ewk_tiled_model.h: Added.
        * ewk/ewk_tiled_private.h: Added.
        * ewk/ewk_view.cpp:
        (_ewk_view_smart_add):
        (_ewk_view_smart_calculate):
        (_ewk_view_smart_show):
        (_ewk_view_smart_hide):
        (_ewk_view_smart_pre_render_relative_radius):
        (_ewk_view_zoom_animator_cb):
        (_ewk_view_smart_disable_render):
        (_ewk_view_smart_enable_render):
        (ewk_view_base_smart_set):
        (ewk_view_pre_render_region):
        (ewk_view_pre_render_relative_radius):
        (ewk_view_enable_render):
        (ewk_view_disable_render):
        (ewk_view_scroll):
        (ewk_view_did_first_visually_nonempty_layout):
        (ewk_view_dispatch_did_finish_loading):
        (ewk_view_transition_to_commited_for_newpage):
        * ewk/ewk_view.h:
        * ewk/ewk_view_tiled.c: Added.
        (_ewk_view_tiled_render_cb):
        (_ewk_view_tiled_updates_process_pre):
        (_ewk_view_tiled_smart_backing_store_add):
        (_ewk_view_tiled_contents_size_changed_cb):
        (_ewk_view_tiled_smart_add):
        (_ewk_view_tiled_smart_scrolls_process):
        (_ewk_view_tiled_smart_repaints_process):
        (_ewk_view_tiled_smart_contents_resize):
        (_ewk_view_tiled_smart_zoom_set):
        (_ewk_view_tiled_smart_zoom_weak_set):
        (_ewk_view_tiled_smart_zoom_weak_smooth_scale_set):
        (_ewk_view_tiled_smart_flush):
        (_ewk_view_tiled_smart_pre_render_region):
        (_ewk_view_tiled_smart_pre_render_relative_radius):
        (_ewk_view_tiled_smart_pre_render_cancel):
        (_ewk_view_tiled_smart_disable_render):
        (_ewk_view_tiled_smart_enable_render):
        (ewk_view_tiled_smart_set):
        (_ewk_view_tiled_smart_class_new):
        (ewk_view_tiled_add):
        (ewk_view_tiled_unused_cache_get):
        (ewk_view_tiled_unused_cache_set):
        (ewk_view_tiled_process_entire_queue_set):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cc349764
......@@ -63,9 +63,13 @@ LIST(APPEND WebKit_SOURCES
efl/ewk/ewk_history.cpp
efl/ewk/ewk_main.cpp
efl/ewk/ewk_settings.cpp
efl/ewk/ewk_tiled_backing_store.c
efl/ewk/ewk_tiled_matrix.c
efl/ewk/ewk_tiled_model.c
efl/ewk/ewk_util.cpp
efl/ewk/ewk_view.cpp
efl/ewk/ewk_view_single.c
efl/ewk/ewk_view_tiled.c
efl/ewk/ewk_window_features.cpp
)
......
2010-11-22 Alex Grilo <abgrilo@profusion.mobi>
Reviewed by Kenneth Rohde Christiansen.
[EFL] Tiled Backing Store for Webkit-Efl
https://bugs.webkit.org/show_bug.cgi?id=45397
This tile based backing store is a grid of tiles where each tile is
an Evas_Object showing a piece of the page content. The
new ewk_view_tiled.c is an implementation of some of the functions of
the original ewk_view, that makes calls to the Tiled Backing Store
specific functions.
The rendering occurs in the pixels stored in each tile (Evas_Object),
in the same way as the previous single backing store. Tiles not being
shown in the viewport are stored in a cache, and can be reused later
to avoid having to be rendered again.
Scrolling occurs as just moving the tiles, using Evas move operations,
and when more than one tile size is scrolled, a shift of rows or
columns needs to be done.
* CMakeListsEfl.txt:
* ewk/ewk_tiled_backing_store.c: Added.
(_ewk_tiled_backing_store_updates_process):
(_ewk_tiled_backing_store_flush):
(_ewk_tiled_backing_store_tile_new):
(_ewk_tiled_backing_store_item_move):
(_ewk_tiled_backing_store_item_resize):
(_ewk_tiled_backing_store_tile_associate):
(_ewk_tiled_backing_store_tile_dissociate):
(_ewk_tiled_backing_store_tile_dissociate_all):
(_ewk_tiled_backing_store_pre_render_request_add):
(_ewk_tiled_backing_store_pre_render_request_del):
(_ewk_tiled_backing_store_pre_render_request_first):
(_ewk_tiled_backing_store_pre_render_request_flush):
(_ewk_tiled_backing_store_pre_render_request_remove_unassociated):
(_ewk_tiled_backing_store_pre_render_request_remove_associated):
(_ewk_tiled_backing_store_pre_render_request_process_single):
(_ewk_tiled_backing_store_item_process_idler_cb):
(_ewk_tiled_backing_store_item_process_idler_stop):
(_ewk_tiled_backing_store_item_process_idler_start):
(_ewk_tiled_backing_store_item_request_del):
(_ewk_tiled_backing_store_item_request_add):
(_ewk_tiled_backing_store_disable_render):
(_ewk_tiled_backing_store_enable_render):
(_ewk_tiled_backing_store_visible_tiles_rect):
(_ewk_tiled_backing_store_tile_is_inside_viewport):
(_ewk_tiled_backing_store_tile_is_adjacent_to_viewport):
(_ewk_tiled_backing_store_item_fill):
(_ewk_tiled_backing_store_item_add):
(_ewk_tiled_backing_store_item_del):
(_ewk_tiled_backing_store_item_smooth_scale_set):
(_ewk_tiled_backing_store_changed):
(_ewk_tiled_backing_store_view_cols_end_del):
(_ewk_tiled_backing_store_view_cols_end_add):
(_ewk_tiled_backing_store_view_row_del):
(_ewk_tiled_backing_store_view_rows_range_del):
(_ewk_tiled_backing_store_view_rows_all_del):
(_ewk_tiled_backing_store_render):
(_ewk_tiled_backing_store_model_matrix_create):
(_ewk_tiled_backing_store_smart_member_del):
(_ewk_tiled_backing_store_smart_member_add):
(_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_smart_calculate_size):
(_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_wrap_right):
(_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_fill_renderers):
(_ewk_tiled_backing_store_smart_calculate):
(ewk_tiled_backing_store_add):
(ewk_tiled_backing_store_render_cb_set):
(ewk_tiled_backing_store_tile_unused_cache_get):
(ewk_tiled_backing_store_tile_unused_cache_set):
(_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_zoom_weak_smooth_scale_set):
(ewk_tiled_backing_store_update):
(ewk_tiled_backing_store_updates_process_pre_set):
(ewk_tiled_backing_store_updates_process_post_set):
(ewk_tiled_backing_store_updates_process):
(ewk_tiled_backing_store_updates_clear):
(ewk_tiled_backing_store_contents_resize):
(ewk_tiled_backing_store_disabled_update_set):
(ewk_tiled_backing_store_flush):
(ewk_tiled_backing_store_pre_render_region):
(ewk_tiled_backing_store_pre_render_relative_radius):
(ewk_tiled_backing_store_pre_render_cancel):
(ewk_tiled_backing_store_disable_render):
(ewk_tiled_backing_store_enable_render):
(ewk_tiled_backing_store_process_entire_queue_set):
* ewk/ewk_tiled_backing_store.h: Added.
* ewk/ewk_tiled_matrix.c: Added.
(_ewk_tile_matrix_cell_free):
(_ewk_tile_matrix_tile_free):
(ewk_tile_matrix_new):
(ewk_tile_matrix_free):
(ewk_tile_matrix_resize):
(ewk_tile_matrix_unused_cache_get):
(ewk_tile_matrix_tile_exact_get):
(ewk_tile_matrix_tile_exact_exists):
(ewk_tile_matrix_tile_nearest_get):
(ewk_tile_matrix_tile_new):
(ewk_tile_matrix_tile_put):
(ewk_tile_matrix_tile_update):
(ewk_tile_matrix_tile_update_full):
(ewk_tile_matrix_tile_updates_clear):
(_ewk_tile_matrix_slicer_setup):
(ewk_tile_matrix_update):
(ewk_tile_matrix_updates_process):
(ewk_tile_matrix_updates_clear):
(ewk_tile_matrix_dbg):
(ewk_tile_matrix_freeze):
(ewk_tile_matrix_thaw):
* ewk/ewk_tiled_matrix.h: Added.
* ewk/ewk_tiled_model.c: Added.
(_ewk_tile_account_get):
(_ewk_tile_account_allocated):
(_ewk_tile_account_freed):
(ewk_tile_accounting_dbg):
(_ewk_tile_paint_rgb888):
(_ewk_tile_paint_rgb565):
(_ewk_tile_paint):
(ewk_tile_new):
(ewk_tile_free):
(ewk_tile_show):
(ewk_tile_hide):
(ewk_tile_visible_get):
(ewk_tile_update_full):
(ewk_tile_update_area):
(ewk_tile_updates_process):
(ewk_tile_updates_clear):
(ewk_tile_unused_cache_new):
(ewk_tile_unused_cache_lock_area):
(ewk_tile_unused_cache_unlock_area):
(ewk_tile_unused_cache_free):
(ewk_tile_unused_cache_clear):
(ewk_tile_unused_cache_ref):
(ewk_tile_unused_cache_unref):
(ewk_tile_unused_cache_max_set):
(ewk_tile_unused_cache_max_get):
(ewk_tile_unused_cache_used_get):
(ewk_tile_unused_cache_flush):
(ewk_tile_unused_cache_auto_flush):
(ewk_tile_unused_cache_dirty):
(ewk_tile_unused_cache_freeze):
(ewk_tile_unused_cache_thaw):
(ewk_tile_unused_cache_tile_get):
(ewk_tile_unused_cache_tile_put):
(ewk_tile_unused_cache_dbg):
* ewk/ewk_tiled_model.h: Added.
* ewk/ewk_tiled_private.h: Added.
* ewk/ewk_view.cpp:
(_ewk_view_smart_add):
(_ewk_view_smart_calculate):
(_ewk_view_smart_show):
(_ewk_view_smart_hide):
(_ewk_view_smart_pre_render_relative_radius):
(_ewk_view_zoom_animator_cb):
(_ewk_view_smart_disable_render):
(_ewk_view_smart_enable_render):
(ewk_view_base_smart_set):
(ewk_view_pre_render_region):
(ewk_view_pre_render_relative_radius):
(ewk_view_enable_render):
(ewk_view_disable_render):
(ewk_view_scroll):
(ewk_view_did_first_visually_nonempty_layout):
(ewk_view_dispatch_did_finish_loading):
(ewk_view_transition_to_commited_for_newpage):
* ewk/ewk_view.h:
* ewk/ewk_view_tiled.c: Added.
(_ewk_view_tiled_render_cb):
(_ewk_view_tiled_updates_process_pre):
(_ewk_view_tiled_smart_backing_store_add):
(_ewk_view_tiled_contents_size_changed_cb):
(_ewk_view_tiled_smart_add):
(_ewk_view_tiled_smart_scrolls_process):
(_ewk_view_tiled_smart_repaints_process):
(_ewk_view_tiled_smart_contents_resize):
(_ewk_view_tiled_smart_zoom_set):
(_ewk_view_tiled_smart_zoom_weak_set):
(_ewk_view_tiled_smart_zoom_weak_smooth_scale_set):
(_ewk_view_tiled_smart_flush):
(_ewk_view_tiled_smart_pre_render_region):
(_ewk_view_tiled_smart_pre_render_relative_radius):
(_ewk_view_tiled_smart_pre_render_cancel):
(_ewk_view_tiled_smart_disable_render):
(_ewk_view_tiled_smart_enable_render):
(ewk_view_tiled_smart_set):
(_ewk_view_tiled_smart_class_new):
(ewk_view_tiled_add):
(ewk_view_tiled_unused_cache_get):
(ewk_view_tiled_unused_cache_set):
(ewk_view_tiled_process_entire_queue_set):
2010-11-16 Leandro Pereira <leandro@profusion.mobi>
[EFL] Unreviewed. Build fix.
......
This diff is collapsed.
/*
Copyright (C) 2009-2010 Samsung Electronics
Copyright (C) 2009-2010 ProFUSION embedded systems
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef ewk_tiled_backing_store_h
#define ewk_tiled_backing_store_h
#include "EWebKit.h"
/* Enable accounting of render time in tile statistics */
// #define TILE_STATS_ACCOUNT_RENDER_TIME
/* If define ewk will do more accounting to check for memory leaks
* try "kill -USR1 $PID" to get instantaneous debug
* try "kill -USR2 $PID" to get instantaneous debug and force flush of cache
*/
#define DEBUG_MEM_LEAKS 1
#define TILE_W (256)
#define TILE_H (256)
#define ZOOM_STEP_MIN (0.01)
#define TILE_SIZE_AT_ZOOM(SIZE, ZOOM) ((int)roundf((SIZE) * (ZOOM)))
#define TILE_W_ZOOM_AT_SIZE(SIZE) ((float)SIZE / (float)TILE_W)
#define TILE_H_ZOOM_AT_SIZE(SIZE) ((float)SIZE / (float)TILE_H)
#ifdef __cplusplus
extern "C" {
#endif
#include <Evas.h>
#include <cairo.h>
typedef struct _Ewk_Tile Ewk_Tile;
typedef struct _Ewk_Tile_Stats Ewk_Tile_Stats;
typedef struct _Ewk_Tile_Matrix Ewk_Tile_Matrix;
struct _Ewk_Tile_Stats {
double last_used; /**< time of last use */
#ifdef TILE_STATS_ACCOUNT_RENDER_TIME
double render_time; /**< amount of time this tile took to render */
#endif
unsigned int area; /**< cache for (w * h) */
unsigned int misses; /**< number of times it became dirty but not
* repainted at all since it was not visible.
*/
Eina_Bool full_update:1; /**< tile requires full size update */
};
struct _Ewk_Tile {
EINA_INLIST; /**< sibling tiles at same (i, j) but other zoom */
Eina_Tiler *updates; /**< updated/dirty areas */
Ewk_Tile_Stats stats; /**< tile usage statistics */
unsigned long col, row; /**< tile tile position */
Evas_Coord x, y; /**< tile coordinate position */
/* TODO: does it worth to keep those or create on demand? */
cairo_surface_t *surface;
cairo_t *cairo;
/** Never ever change those after tile is created (respect const!) */
const Evas_Coord w, h; /**< tile size (see TILE_SIZE_AT_ZOOM()) */
const Evas_Colorspace cspace; /**< colorspace */
const float zoom; /**< zoom level contents were rendered at */
const size_t bytes; /**< bytes used in pixels. keep
* before pixels to guarantee
* alignement!
*/
int visible; /**< visibility counter of this tile */
Evas_Object *image; /**< Evas Image, the tile to be rendered */
uint8_t *pixels;
};
#include "ewk_tiled_matrix.h"
#include "ewk_tiled_model.h"
/* view */
EAPI Evas_Object *ewk_tiled_backing_store_add(Evas *e);
EAPI 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);
EAPI Eina_Bool ewk_tiled_backing_store_scroll_full_offset_set(Evas_Object *o, Evas_Coord x, Evas_Coord y);
EAPI Eina_Bool ewk_tiled_backing_store_scroll_full_offset_add(Evas_Object *o, Evas_Coord dx, Evas_Coord dy);
EAPI 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);
EAPI 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);
EAPI Eina_Bool ewk_tiled_backing_store_zoom_weak_set(Evas_Object *o, float zoom, Evas_Coord cx, Evas_Coord cy);
EAPI void ewk_tiled_backing_store_fix_offsets(Evas_Object *o, Evas_Coord w, Evas_Coord h);
EAPI Eina_Bool ewk_tiled_backing_store_update(Evas_Object *o, const Eina_Rectangle *update);
EAPI void ewk_tiled_backing_store_updates_process_pre_set(Evas_Object *o, void *(*cb)(void *data, Evas_Object *o), const void *data);
EAPI 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);
EAPI void ewk_tiled_backing_store_process_entire_queue_set(Evas_Object *o, Eina_Bool value);
EAPI void ewk_tiled_backing_store_updates_process(Evas_Object *o);
EAPI void ewk_tiled_backing_store_updates_clear(Evas_Object *o);
EAPI void ewk_tiled_backing_store_contents_resize(Evas_Object *o, Evas_Coord width, Evas_Coord height);
EAPI void ewk_tiled_backing_store_disabled_update_set(Evas_Object *o, Eina_Bool value);
EAPI void ewk_tiled_backing_store_flush(Evas_Object *o);
EAPI void ewk_tiled_backing_store_enable_scale_set(Evas_Object *o, Eina_Bool value);
EAPI Ewk_Tile_Unused_Cache *ewk_tiled_backing_store_tile_unused_cache_get(const Evas_Object *o);
EAPI void ewk_tiled_backing_store_tile_unused_cache_set(Evas_Object *o, Ewk_Tile_Unused_Cache *tuc);
EAPI 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);
EAPI Eina_Bool ewk_tiled_backing_store_pre_render_relative_radius(Evas_Object *o, unsigned int n, float zoom);
EAPI void ewk_tiled_backing_store_pre_render_cancel(Evas_Object *o);
EAPI Eina_Bool ewk_tiled_backing_store_disable_render(Evas_Object *o);
EAPI Eina_Bool ewk_tiled_backing_store_enable_render(Evas_Object *o);
#ifdef __cplusplus
}
#endif
#endif // ewk_tiled_backing_store_h
This diff is collapsed.
/*
Copyright (C) 2009-2010 Samsung Electronics
Copyright (C) 2009-2010 ProFUSION embedded systems
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef ewk_tiled_matrix_h
#define ewk_tiled_matrix_h
#include "ewk_eapi.h"
#include "ewk_tiled_backing_store.h"
#include <Evas.h>
/* matrix of tiles */
EAPI Ewk_Tile_Matrix *ewk_tile_matrix_new(Ewk_Tile_Unused_Cache *tuc, unsigned long cols, unsigned long rows, Evas_Colorspace cspace, void (*render_cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *update), const void *data);
EAPI void ewk_tile_matrix_free(Ewk_Tile_Matrix *tm);
EAPI void ewk_tile_matrix_resize(Ewk_Tile_Matrix *tm, unsigned long cols, unsigned long rows);
EAPI Ewk_Tile_Unused_Cache *ewk_tile_matrix_unused_cache_get(const Ewk_Tile_Matrix *tm);
EAPI Ewk_Tile *ewk_tile_matrix_tile_exact_get(Ewk_Tile_Matrix *tm, unsigned long col, unsigned int row, float zoom);
EAPI Eina_Bool ewk_tile_matrix_tile_exact_exists(Ewk_Tile_Matrix *tm, unsigned long col, unsigned int row, float zoom);
EAPI Ewk_Tile *ewk_tile_matrix_tile_nearest_get(Ewk_Tile_Matrix *tm, unsigned long col, unsigned int row, float zoom);
EAPI Ewk_Tile *ewk_tile_matrix_tile_new(Ewk_Tile_Matrix *tm, Evas *evas, unsigned long col, unsigned int row, float zoom);
EAPI Eina_Bool ewk_tile_matrix_tile_put(Ewk_Tile_Matrix *tm, Ewk_Tile *t, double last_used);
EAPI Eina_Bool ewk_tile_matrix_tile_update(Ewk_Tile_Matrix *tm, unsigned long col, unsigned int row, const Eina_Rectangle *update);
EAPI Eina_Bool ewk_tile_matrix_tile_update_full(Ewk_Tile_Matrix *tm, unsigned long col, unsigned int row);
EAPI void ewk_tile_matrix_tile_updates_clear(Ewk_Tile_Matrix *tm, Ewk_Tile *t);
EAPI Eina_Bool ewk_tile_matrix_update(Ewk_Tile_Matrix *tm, const Eina_Rectangle *update, float zoom);
EAPI void ewk_tile_matrix_updates_process(Ewk_Tile_Matrix *tm);
EAPI void ewk_tile_matrix_updates_clear(Ewk_Tile_Matrix *tm);
EAPI void ewk_tile_matrix_freeze(Ewk_Tile_Matrix *tm);
EAPI 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_accounting_dbg(void);
#endif // ewk_tiled_matrix_h
This diff is collapsed.
/*
Copyright (C) 2009-2010 Samsung Electronics
Copyright (C) 2009-2010 ProFUSION embedded systems
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef ewk_tiled_model_h
#define ewk_tiled_model_h
#include "ewk_eapi.h"
#include "ewk_tiled_backing_store.h"
#include <Evas.h>
/* model */
EAPI Ewk_Tile *ewk_tile_new(Evas *evas, Evas_Coord w, Evas_Coord h, float zoom, Evas_Colorspace cspace);
EAPI void ewk_tile_free(Ewk_Tile *t);
EAPI void ewk_tile_unused_cache_clear(Ewk_Tile_Unused_Cache *tuc);
EAPI void ewk_tile_show(Ewk_Tile *t);
EAPI void ewk_tile_hide(Ewk_Tile *t);
Eina_Bool ewk_tile_visible_get(Ewk_Tile *t);
EAPI void ewk_tile_update_full(Ewk_Tile *t);
EAPI void ewk_tile_update_area(Ewk_Tile *t, const Eina_Rectangle *r);
EAPI void ewk_tile_updates_process(Ewk_Tile *t, void (*cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *update), const void *data);
EAPI void ewk_tile_updates_clear(Ewk_Tile *t);
/* cache of unused tiles */
EAPI Ewk_Tile_Unused_Cache *ewk_tile_unused_cache_new(size_t max);
EAPI 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);
EAPI void ewk_tile_unused_cache_unlock_area(Ewk_Tile_Unused_Cache *tuc);
EAPI void ewk_tile_unused_cache_free(Ewk_Tile_Unused_Cache *tuc);
EAPI Ewk_Tile_Unused_Cache *ewk_tile_unused_cache_ref(Ewk_Tile_Unused_Cache *tuc);
EAPI void ewk_tile_unused_cache_unref(Ewk_Tile_Unused_Cache *tuc);
EAPI void ewk_tile_unused_cache_dirty(Ewk_Tile_Unused_Cache *tuc);
EAPI void ewk_tile_unused_cache_freeze(Ewk_Tile_Unused_Cache *tuc);
EAPI void ewk_tile_unused_cache_thaw(Ewk_Tile_Unused_Cache *tuc);
EAPI Eina_Bool ewk_tile_unused_cache_tile_get(Ewk_Tile_Unused_Cache *tuc, Ewk_Tile *t);
EAPI 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
/*
Copyright (C) 2009-2010 Samsung Electronics
Copyright (C) 2009-2010 ProFUSION embedded systems
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef ewk_tiled_private_h
#define ewk_tiled_private_h
/* logging */
extern int _ewk_tiled_log_dom;
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_ewk_tiled_log_dom, __VA_ARGS__)
#define ERR(...) EINA_LOG_DOM_ERR(_ewk_tiled_log_dom, __VA_ARGS__)
#define WRN(...) EINA_LOG_DOM_WARN(_ewk_tiled_log_dom, __VA_ARGS__)
#define INF(...) EINA_LOG_DOM_INFO(_ewk_tiled_log_dom, __VA_ARGS__)
#define DBG(...) EINA_LOG_DOM_DBG(_ewk_tiled_log_dom, __VA_ARGS__)
#define OOM(op, size) CRITICAL("could not %s %zd bytes: %s", op, size, strerror(errno))
#define MALLOC_OR_OOM_RET(ptr, size, ...) \
do { \
ptr = malloc(size); \
if (!ptr && (size) > 0) { \
OOM("malloc", (size)); \
return __VA_ARGS__; \
} \
} while (0)
#define CALLOC_OR_OOM_RET(ptr, size, ...) \
do { \
ptr = calloc(1, size); \
if (!ptr && (size) > 0) { \
OOM("calloc", (size)); \
return __VA_ARGS__; \
} \
} while (0)
#define REALLOC_OR_OOM_RET(ptr, size, ...) \
do { \
void *__tmp_ptr; \
__tmp_ptr = realloc(ptr, size); \
if (!__tmp_ptr && (size) > 0) { \
OOM("realloc", (size)); \
return __VA_ARGS__; \
} \
ptr = __tmp_ptr; \
} while (0)
#endif // ewk_tiled_private_h
......@@ -93,6 +93,9 @@ struct _Ewk_View_Private_Data {
size_t allocated;
} scrolls;
unsigned int imh; /**< input method hints */
struct {
Eina_Bool view_cleared:1;
} flags;
struct {
const char* user_agent;
const char* user_stylesheet;
......@@ -725,6 +728,12 @@ static void _ewk_view_smart_add(Evas_Object* o)
evas_object_smart_member_add(sd->backing_store, o);
evas_object_show(sd->backing_store);
evas_object_pass_events_set(sd->backing_store, EINA_TRUE);
sd->events_rect = evas_object_rectangle_add(sd->base.evas);
evas_object_color_set(sd->events_rect, 0, 0, 0, 0);
evas_object_smart_member_add(sd->events_rect, o);
evas_object_show(sd->events_rect);
sd->main_frame = ewk_frame_add(sd->base.evas);
if (!sd->main_frame) {
......@@ -815,6 +824,7 @@ static void _ewk_view_smart_calculate(Evas_Object* o)
view->adjustViewSize();
}
evas_object_resize(sd->main_frame, w, h);
evas_object_resize(sd->events_rect, w, h);
sd->changed.frame_rect = EINA_TRUE;
sd->view.w = w;
sd->view.h = h;
......@@ -827,6 +837,7 @@ static void _ewk_view_smart_calculate(Evas_Object* o)
if (sd->changed.position && ((x != sd->view.x) || (y != sd->view.y))) {
evas_object_move(sd->main_frame, x, y);
evas_object_move(sd->backing_store, x, y);
evas_object_move(sd->events_rect, x, y);
sd->changed.frame_rect = EINA_TRUE;
sd->view.x = x;
sd->view.y = y;
......@@ -850,6 +861,25 @@ static void _ewk_view_smart_calculate(Evas_Object* o)
}
}
static void _ewk_view_smart_show(Evas_Object *o)
{
EWK_VIEW_SD_GET(o, sd);
EWK_VIEW_PRIV_GET(sd, priv);
if (evas_object_clipees_get(sd->base.clipper))
evas_object_show(sd->base.clipper);
evas_object_show(sd->backing_store);
}
static void _ewk_view_smart_hide(Evas_Object *o)
{
EWK_VIEW_SD_GET(o, sd);
EWK_VIEW_PRIV_GET(sd, priv);
evas_object_hide(sd->base.clipper);
evas_object_hide(sd->backing_store);
}
static Eina_Bool _ewk_view_smart_contents_resize(Ewk_View_Smart_Data* sd, int w, int h)
{
return EINA_TRUE;
......@@ -897,6 +927,13 @@ static Eina_Bool _ewk_view_smart_pre_render_region(Ewk_View_Smart_Data* sd, Evas
return EINA_FALSE;
}
static Eina_Bool _ewk_view_smart_pre_render_relative_radius(Ewk_View_Smart_Data* sd, unsigned int n, float zoom)
{
WRN("not supported by engine. sd=%p, n=%u zoom=%f",
sd, n, zoom);
return EINA_FALSE;
}
static void _ewk_view_smart_pre_render_cancel(Ewk_View_Smart_Data* sd)
{
WRN("not supported by engine. sd=%p", sd);
......@@ -954,6 +991,7 @@ static Eina_Bool _ewk_view_zoom_animator_cb(void* data)
|| (now < priv->animated_zoom.time.start)) {
_ewk_view_zoom_animated_finish(sd);
ewk_view_zoom_set(sd->self, priv->animated_zoom.zoom.end, cx, cy);
sd->api->sc.calculate(sd->self);
return EINA_FALSE;
}
......@@ -991,6 +1029,18 @@ static WebCore::ViewportAttributes _ewk_view_viewport_attributes_compute(Evas_Ob
return attributes;
}