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
+ This library is free software; you can redistribute item and/or
+ modify item under the terms of the GNU Library General Public
+ License as published baseY 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,
+ This library is distributed in the hope that item 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.
#include "config.h"
#include "ewk_tiled_backing_store.h"
+#include "ewk_private.h"
#include "ewk_tiled_matrix.h"
#include "ewk_tiled_private.h"
#include <Ecore.h>
#include <stdlib.h>
#include <string.h>
-#if ENABLE(TIZEN_REPAINT_IDLER)
-#define THRESHOLD_ANIM_TIME 0.1 // Time after which we reenable the repaint_on_idler feature.
-#endif
-#if ENABLE(TIZEN_PRE_RENDERING_ADVANCE)
-#define HEAVY_TILE_TIME_LIMIT 5000 // heavy tile time limit (5ms)
-#endif
-
-#define IDX(col, row, rowspan) (col + (row * rowspan))
+#define IDX(column, row, rowspan) (column + (row * rowspan))
#if !defined(MIN)
# define MIN(a, b) ((a < b) ? a : b)
typedef struct _Ewk_Tiled_Backing_Store_Data Ewk_Tiled_Backing_Store_Data;
typedef struct _Ewk_Tiled_Backing_Store_Item Ewk_Tiled_Backing_Store_Item;
typedef struct _Ewk_Tiled_Backing_Store_Pre_Render_Request Ewk_Tiled_Backing_Store_Pre_Render_Request;
-#if ENABLE(TIZEN_REPAINT_IDLER)
-typedef struct _Ewk_Tiled_Backing_Store_Update_Add_Item Ewk_Tiled_Backing_Store_Update_Add_Item;
-typedef struct _Ewk_Tiled_Backing_Store_Process_Request Ewk_Tiled_Backing_Store_Process_Request;
-
-struct _Ewk_Tiled_Backing_Store_Update_Add_Item {
- Eina_Rectangle area;
- Ewk_Tile *t;
-};
-#endif
struct _Ewk_Tiled_Backing_Store_Item {
EINA_INLIST;
struct {
Evas_Coord x, y, width, height;
} geometry;
- Eina_Bool smooth_scale;
+ bool smoothScale;
};
struct _Ewk_Tiled_Backing_Store_Pre_Render_Request {
EINA_INLIST;
- unsigned long col, row;
+ unsigned long column, row;
float zoom;
};
struct _Ewk_Tiled_Backing_Store_Data {
Evas_Object_Smart_Clipped_Data base;
Evas_Object* self;
- Evas_Object* contents_clipper;
+ Evas_Object* contentsClipper;
struct {
Eina_Inlist** items;
Evas_Coord x, y, width, height;
- long cols, rows;
+ long columns, rows;
struct {
Evas_Coord width, height;
float zoom;
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
Eina_Bool enable_scale:1;
#endif
- Eina_Bool zoom_weak_smooth_scale : 1;
+ bool zoomWeakSmoothScale : 1;
#if ENABLE(TIZEN_TILED_VIEW_BG_COLOR_SET)
- Eina_Bool has_alpha:1;
+ Eina_Bool hasAlpha:1;
#endif
} tile;
struct {
struct {
Evas_Coord x, y;
- } cur, old, base, zoom_center;
+ } current, old, base, zoomCenter;
} offset;
#if ENABLE(TIZEN_VIEW_ACTIVE_SET)
Eina_Bool active:1;
#endif
#if ENABLE(TIZEN_FIX_RSS_IMAGE_DISPLAY)
- Eina_Bool changed_zoom:1; // Set if zoom level is same as previous zoom level when zoom set
+ Eina_Bool changedZoom:1; // Set if zoom level is same as previous zoom level when zoom set
#endif
} view;
- Evas_Colorspace cspace;
+ Evas_Colorspace colorSpace;
struct {
Ewk_Tile_Matrix* matrix;
struct {
- unsigned long col, row;
+ unsigned long column, row;
} base;
struct {
- unsigned long cols, rows;
- } cur, old;
+ unsigned long columns, rows;
+ } current, old;
Evas_Coord width, height;
} model;
struct {
- Eina_Bool (*cb)(void* data, Ewk_Tile* tile, const Eina_Rectangle* area);
+ Eina_Bool (*callback)(void* data, Ewk_Tile* tile, const Eina_Rectangle* area);
void* data;
- Eina_Inlist* pre_render_requests;
+ Eina_Inlist* preRenderRequests;
Ecore_Idler *idler;
-#if ENABLE(TIZEN_REPAINT_IDLER)
- Eina_List *process_requests;
- Eina_List *tiles_pending_update_add;
- Ecore_Timer *restore_idler_timer; // Timer to restore the on_idler repaints.
- Eina_Bool on_idler; // Set if render should occur on an idler.
- Eina_Bool on_idler_disabled; // Set if render on idler is temporarily disabled.
- Eina_Bool next_no_idler; // Set if next updates_process shouldn't occur on an idler
-#endif
Eina_Bool disabled;
Eina_Bool suspend : 1;
#if ENABLE(TIZEN_SELECTIVE_RENDERING)
struct {
Eina_Bool enabled; // Set if selective tile rendering should be used. This setting allows to create a new tiles when are needed.
- Eina_Bool render_on_next; // Set if selective tile rendering should be used during next call of _ewk_tiled2_backing_store_updates_process function.
- Ecore_Idle_Enterer *idler_enterer;
- } selective_render;
-#endif
-#if ENABLE(TIZEN_PRE_RENDERING_ADVANCE)
- Eina_Inlist *heavy_tile_list;
+ Eina_Bool renderOnNext; // Set if selective tile rendering should be used during next call of _ewk_tiled2_backing_store_updates_process function.
+ Ecore_Idle_Enterer *idlerEnterer;
+ } selectiveRender;
#endif
} render;
struct {
- void* (*pre_cb)(void* data, Evas_Object* ewkTile);
- void* pre_data;
- void* (*post_cb)(void* data, void* pre_data, Evas_Object* ewkTile);
- void* post_data;
+ void* (*preCallback)(void* data, Evas_Object* ewkBackingStore);
+ void* preData;
+ void* (*postCallback)(void* data, void* preData, Evas_Object* ewkBackingStore);
+ void* postData;
} process;
struct {
- Eina_Bool any : 1;
- Eina_Bool pos : 1;
- Eina_Bool size : 1;
- Eina_Bool model : 1;
- Eina_Bool offset : 1;
+ bool any : 1;
+ bool position : 1;
+ bool size : 1;
+ bool model : 1;
+ bool offset : 1;
#if ENABLE(TIZEN_TILE_MATRIX_LIST)
- Eina_Bool layout:1;
+ bool layout:1;
#endif
#if ENABLE(TIZEN_FIX_EMAIL_ONE_TILE_DISPLAY)
- Eina_Bool need_layout:1;
+ bool needLayout:1;
#endif
} changed;
#ifdef DEBUG_MEM_LEAKS
- Ecore_Event_Handler* sig_usr;
+ Ecore_Event_Handler* sigUsr;
#endif
};
return __VA_ARGS__; \
}
-#if ENABLE(TIZEN_PRE_RENDERING_ADVANCE)
-typedef struct _Ewk_Heavy_Tile Ewk_Heavy_Tile;
-struct _Ewk_Heavy_Tile {
- EINA_INLIST;
- int col;
- int row;
- long drawing_time;
-};
-
-Eina_Bool ewk_tiled_backing_store_drawing_time_request_add(Ewk_Tiled_Backing_Store_Data *priv, unsigned long col, unsigned long row, float zoom, long drawing_time);
-#endif
-
static void _ewk_tiled_backing_store_fill_renderers(Ewk_Tiled_Backing_Store_Data *priv);
static inline void _ewk_tiled_backing_store_view_dbg(const Ewk_Tiled_Backing_Store_Data *priv);
static inline void _ewk_tiled_backing_store_changed(Ewk_Tiled_Backing_Store_Data *priv);
#if ENABLE(TIZEN_SELECTIVE_RENDERING)
static inline void _ewk_tiled_backing_store_item_process_idler_start(Ewk_Tiled_Backing_Store_Data *priv);
#endif
-#if ENABLE(TIZEN_REPAINT_IDLER)
-void _ewk_tiled_backing_store_restore_idler_timer_stop(Ewk_Tiled_Backing_Store_Data *priv);
-void _ewk_tiled_backing_store_restore_idler_timer_reset(Ewk_Tiled_Backing_Store_Data *priv);
-
-static inline void _ewk_tiled_backing_store_process_requests_flush(Ewk_Tiled_Backing_Store_Data *priv)
-{
- Ewk_Tile *t;
- void* item;
-
- EINA_LIST_FREE(priv->render.process_requests, item) {
- t = static_cast<Ewk_Tile*>(item);
- free(t);
- }
-}
-
-static void _ewk_tiled_backing_store_process_cb(void *data, Ewk_Tile *t)
-{
- Ewk_Tiled_Backing_Store_Data *priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(data);
- if (!t->visible)
- return;
-
- priv->render.process_requests = eina_list_append(priv->render.process_requests, t);
-}
-
-static inline void _ewk_tiled_backing_store_process_queue_update(Ewk_Tiled_Backing_Store_Data *priv)
-{
- ewk_tile_matrix_updates_process2(
- priv->model.matrix, _ewk_tiled_backing_store_process_cb, priv);
-}
-#endif
static inline void _ewk_tiled_backing_store_updates_process(Ewk_Tiled_Backing_Store_Data* priv)
{
if (priv->render.suspend || !evas_object_visible_get(priv->self))
#endif
#if ENABLE(TIZEN_SELECTIVE_RENDERING)
- if (!priv->render.selective_render.enabled)
+ if (!priv->render.selectiveRender.enabled)
#endif
return;
- if (priv->process.pre_cb)
- data = priv->process.pre_cb(priv->process.pre_data, priv->self);
+ if (priv->process.preCallback)
+ data = priv->process.preCallback(priv->process.preData, priv->self);
#if ENABLE(TIZEN_SELECTIVE_RENDERING)
- if (priv->render.selective_render.enabled && priv->render.selective_render.render_on_next)
+ if (priv->render.selectiveRender.enabled)
ewk_tile_matrix_selective_rendering_updates_process(priv->model.matrix);
else
#endif
-#if ENABLE(TIZEN_REPAINT_IDLER)
- if (!priv->render.on_idler) {
- ewk_tile_matrix_updates_process(priv->model.matrix);
- } else if (priv->render.on_idler_disabled) {
- if (ewk_tile_matrix_updates_process(priv->model.matrix))
- _ewk_tiled_backing_store_restore_idler_timer_reset(priv);
- } else if (priv->render.next_no_idler) {
-#endif
ewk_tile_matrix_updates_process(priv->model.matrix);
-#if ENABLE(TIZEN_REPAINT_IDLER)
- priv->render.next_no_idler = EINA_FALSE;
- } else if (!priv->render.process_requests) {
- _ewk_tiled_backing_store_process_queue_update(priv);
- _ewk_tiled_backing_store_item_process_idler_start(priv);
- }
-#endif
- if (priv->process.post_cb)
- priv->process.post_cb(priv->process.post_data, data, priv->self);
+ if (priv->process.postCallback)
+ priv->process.postCallback(priv->process.postData, data, priv->self);
}
#if !ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
static int _ewk_tiled_backing_store_flush(void* data)
{
Ewk_Tiled_Backing_Store_Data* priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(data);
- Ewk_Tile_Unused_Cache* tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+ Ewk_Tile_Unused_Cache* tiledUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
- if (tuc) {
+ if (tiledUnusedCache) {
DBG("flush unused tile cache.");
- ewk_tile_unused_cache_auto_flush(tuc);
+ ewk_tile_unused_cache_auto_flush(tiledUnusedCache);
} else
ERR("no cache?!");
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 item 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);
#if ENABLE(TIZEN_TILED_VIEW_BG_COLOR_SET)
- evas_object_image_alpha_set(item->tile->image, priv->view.tile.has_alpha);
+ evas_object_image_alpha_set(item->tile->image, priv->view.tile.hasAlpha);
#endif
if (!ewk_tile_visible_get(tile))
evas_object_smart_member_add(tile->image, priv->self);
static void _ewk_tiled_backing_store_tile_dissociate(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tiled_Backing_Store_Item* item, double lastUsed)
{
#if !ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
- Ewk_Tile_Unused_Cache* tuc;
+ Ewk_Tile_Unused_Cache* tileUnusedCache,;
#endif
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);
#if !ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
- tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
- ewk_tile_unused_cache_auto_flush(tuc);
-
+ tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+ ewk_tile_unused_cache_auto_flush(tileUnusedCache);
#endif
item->tile = 0;
}
static void _ewk_tiled_backing_store_tile_dissociate_all(Ewk_Tiled_Backing_Store_Data* priv)
{
- Eina_Inlist* it;
+ Eina_Inlist* list;
Ewk_Tiled_Backing_Store_Item* item;
int i;
double last_used = ecore_loop_time_get();
for (i = 0; i < priv->view.rows; i++) {
- it = priv->view.items[i];
- EINA_INLIST_FOREACH(it, item)
+ list = priv->view.items[i];
+ EINA_INLIST_FOREACH(list, item)
if (item->tile)
_ewk_tiled_backing_store_tile_dissociate(priv, item, last_used);
}
}
-static inline Eina_Bool _ewk_tiled_backing_store_pre_render_request_add(Ewk_Tiled_Backing_Store_Data *priv, unsigned long col, unsigned long row, float zoom)
+static inline Eina_Bool _ewk_tiled_backing_store_pre_render_request_add(Ewk_Tiled_Backing_Store_Data* priv, unsigned long column, unsigned long row, float zoom)
{
- Ewk_Tiled_Backing_Store_Pre_Render_Request* r;
+ Ewk_Tiled_Backing_Store_Pre_Render_Request* request;
- r = static_cast<Ewk_Tiled_Backing_Store_Pre_Render_Request*>(malloc(sizeof(*r)));
- if (!r)
- return EINA_FALSE;
+ request = static_cast<Ewk_Tiled_Backing_Store_Pre_Render_Request*>(malloc(sizeof(*request)));
+ if (!request)
+ return false;
- priv->render.pre_render_requests = eina_inlist_append
- (priv->render.pre_render_requests, EINA_INLIST_GET(r));
+ priv->render.preRenderRequests = eina_inlist_append
+ (priv->render.preRenderRequests, EINA_INLIST_GET(request));
- r->col = col;
- r->row = row;
- r->zoom = zoom;
+ request->column = column;
+ request->row = row;
+ request->zoom = zoom;
- return EINA_TRUE;
+ return true;
}
static inline void _ewk_tiled_backing_store_pre_render_request_del(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tiled_Backing_Store_Pre_Render_Request* request)
{
- priv->render.pre_render_requests = eina_inlist_remove
- (priv->render.pre_render_requests, EINA_INLIST_GET(request));
+ priv->render.preRenderRequests = eina_inlist_remove
+ (priv->render.preRenderRequests, EINA_INLIST_GET(request));
free(request);
}
static inline Ewk_Tiled_Backing_Store_Pre_Render_Request* _ewk_tiled_backing_store_pre_render_request_first(const Ewk_Tiled_Backing_Store_Data* priv)
{
return EINA_INLIST_CONTAINER_GET(
- priv->render.pre_render_requests,
+ priv->render.preRenderRequests,
Ewk_Tiled_Backing_Store_Pre_Render_Request);
}
static void _ewk_tiled_backing_store_pre_render_request_flush(Ewk_Tiled_Backing_Store_Data* priv)
{
- Eina_Inlist** pl = &priv->render.pre_render_requests;
- while (*pl) {
- Ewk_Tiled_Backing_Store_Pre_Render_Request* r;
- r = _ewk_tiled_backing_store_pre_render_request_first(priv);
- *pl = eina_inlist_remove(*pl, *pl);
- free(r);
+ Eina_Inlist** preRenderList = &priv->render.preRenderRequests;
+ while (*preRenderList) {
+ Ewk_Tiled_Backing_Store_Pre_Render_Request* request;
+ request = _ewk_tiled_backing_store_pre_render_request_first(priv);
+ *preRenderList = eina_inlist_remove(*preRenderList, *preRenderList);
+ free(request);
}
}
static void _ewk_tiled_backing_store_pre_render_request_clear(Ewk_Tiled_Backing_Store_Data* priv)
{
- Eina_Inlist** pl = &priv->render.pre_render_requests;
- Eina_Inlist* iter = *pl, * tmp;
+ Eina_Inlist** preRenderList = &priv->render.preRenderRequests;
+ Eina_Inlist* iter = *preRenderList, *tmp;
while (iter) {
- Ewk_Tiled_Backing_Store_Pre_Render_Request* r =
+ Ewk_Tiled_Backing_Store_Pre_Render_Request* request =
EINA_INLIST_CONTAINER_GET(
iter, Ewk_Tiled_Backing_Store_Pre_Render_Request);
tmp = iter->next;
- *pl = eina_inlist_remove(*pl, iter);
+ *preRenderList = eina_inlist_remove(*preRenderList, iter);
iter = tmp;
- free(r);
+ 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* req;
+ Ewk_Tiled_Backing_Store_Pre_Render_Request* request;
Eina_Rectangle area;
- Ewk_Tile_Matrix* tm = priv->model.matrix;
+ Ewk_Tile_Matrix* tileMatrix = priv->model.matrix;
Ewk_Tile* tile;
#if !ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
- Ewk_Tile_Unused_Cache* tuc;
+ Ewk_Tile_Unused_Cache* tileUnusedCache,;
#endif
- unsigned long col, row;
+ unsigned long column, row;
float zoom;
double last_used = ecore_loop_time_get();
-#if ENABLE(TIZEN_PRE_RENDERING_ADVANCE)
- if (priv->render.suspend)
- return;
-#endif
- req = _ewk_tiled_backing_store_pre_render_request_first(priv);
- if (!req)
+ request = _ewk_tiled_backing_store_pre_render_request_first(priv);
+ if (!request)
return;
- col = req->col;
- row = req->row;
- zoom = req->zoom;
+ column = request->column;
+ row = request->row;
+ zoom = request->zoom;
#if !ENABLE(TIZEN_PRE_RENDER_TILES_CREATED_AFTER_SCROLL)
- if (ewk_tile_matrix_tile_exact_exists(tm, col, row, zoom)) {
- DBG("no pre-render required for tile %lu,%lu @ %f.", col, row, zoom);
+ if (ewk_tile_matrix_tile_exact_exists(tileMatrix, column, row, zoom)) {
+ DBG("no pre-render required for tile %lu,%lu @ %f.", column, row, zoom);
goto end;
}
- tile = _ewk_tiled_backing_store_tile_new(priv, col, row, zoom);
+ tile = _ewk_tiled_backing_store_tile_new(priv, column, row, zoom);
#else
- if (!ewk_tile_matrix_tile_is_pre_renderable(tm, col, row, zoom)) {
- DBG("no pre-render required for tile %lu,%lu @ %f.", col, row, zoom);
+ if (!ewk_tile_matrix_tile_is_pre_renderable(tileMatrix, column, row, zoom)) {
+ DBG("no pre-render required for tile %lu,%lu @ %f.", column, row, zoom);
goto end;
}
- tile = ewk_tile_matrix_tile_exact_get(tm, col, row, zoom);
+ tile = ewk_tile_matrix_tile_exact_get(tileMatrix, column, row, zoom);
if (!tile)
- tile = _ewk_tiled_backing_store_tile_new(priv, col, row, zoom);
+ tile = _ewk_tiled_backing_store_tile_new(priv, column, row, zoom);
#endif
if (!tile) {
#if ENABLE(TIZEN_EWK_ERROR_LOG)
- CRITICAL("Couldn't create tile (%lu, %lu) z:%f", row, col, zoom);
+ CRITICAL("Couldn'tile create tile (%lu, %lu) z:%f", row, column, zoom);
#endif
goto end;
}
area.h = priv->view.tile.height;
#endif
-#if ENABLE(TIZEN_PRE_RENDERING_ADVANCE)
- struct timespec start;
- struct timespec end;
+ priv->render.callback(priv->render.data, tile, &area);
- clock_gettime(CLOCK_REALTIME, &start);
- priv->render.cb(priv->render.data, tile, &area);
- clock_gettime(CLOCK_REALTIME, &end);
-
- int sec = end.tv_sec - start.tv_sec;
- long nano_sec = (long)(end.tv_nsec-start.tv_nsec);
-
- if (nano_sec < 0) {
- nano_sec = nano_sec + 1000000000;
- sec = sec - 1;
- }
-
- t->drawing_time = (sec * 1000000) + (nano_sec / 1000);
- if (t->drawing_time >= HEAVY_TILE_TIME_LIMIT && t->zoom == 1.0)
- ewk_tiled_backing_store_drawing_time_request_add(priv, t->col, t->row, t->zoom, t->drawing_time);
-#else
- priv->render.cb(priv->render.data, tile, &area);
-#endif
#if ENABLE(TIZEN_TILE_ADD_PAINTED_STATE)
if (!ewk_tile_state_painted_get(tile) && tile->visible)
ewk_tile_state_painted_set(tile, EINA_TRUE);
#else
evas_object_image_data_update_add(tile->image, area.x, area.y, area.w, area.h);
#endif
- ewk_tile_matrix_tile_updates_clear(tm, tile);
+ ewk_tile_matrix_tile_updates_clear(tileMatrix, tile);
#if ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
ewk_tile_empty_clear(tile);
#endif
- ewk_tile_matrix_tile_put(tm, tile, last_used);
+ ewk_tile_matrix_tile_put(tileMatrix, tile, last_used);
end:
- _ewk_tiled_backing_store_pre_render_request_del(priv, req);
+ _ewk_tiled_backing_store_pre_render_request_del(priv, request);
#if !ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
- tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
- ewk_tile_unused_cache_auto_flush(tuc);
+ tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+ ewk_tile_unused_cache_auto_flush(tileUnusedCache);
#endif
}
-#if ENABLE(TIZEN_REPAINT_IDLER)
-static inline void _ewk_tiled_backing_store_update_add_flush(Ewk_Tiled_Backing_Store_Data *priv)
-{
- Ewk_Tiled_Backing_Store_Update_Add_Item *up;
- void* item;
-
- EINA_LIST_FREE(priv->render.tiles_pending_update_add, item) {
- up = static_cast<Ewk_Tiled_Backing_Store_Update_Add_Item*>(item);
- free(up);
- }
-}
-
-static inline void _ewk_tiled_backing_store_update_add_process(Ewk_Tiled_Backing_Store_Data *priv)
-{
- Ewk_Tiled_Backing_Store_Update_Add_Item *up;
- void* item;
- EINA_LIST_FREE(priv->render.tiles_pending_update_add, item) {
- up = static_cast<Ewk_Tiled_Backing_Store_Update_Add_Item*>(item);
- float scale = 1.0;
-#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
- if (priv->view.tile.enable_scale)
- scale = up->t->zoom;
-#endif
- evas_object_image_data_update_add(up->t->image,
- up->area.x * scale,
- up->area.y * scale,
- up->area.w * scale,
- up->area.h * scale);
-#if ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
- ewk_tile_empty_clear(up->t);
-#endif
- free(up);
- }
-}
-#endif
-
static Eina_Bool _ewk_tiled_backing_store_item_process_idler_cb(void* data)
{
Ewk_Tiled_Backing_Store_Data* priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(data);
- if (priv->process.pre_cb)
- data = priv->process.pre_cb(priv->process.pre_data, priv->self);
-#if ENABLE(TIZEN_REPAINT_IDLER)
- if (priv->render.process_requests) {
- Ewk_Tile *t;
- t = static_cast<Ewk_Tile*>(eina_list_data_get(priv->render.process_requests));
-#if ENABLE(TIZEN_SVACE_CHECK)
- if (t && t->visible)
-#else
- if (t->visible)
-#endif
- ewk_tile_matrix_tile_updates_process(priv->model.matrix, t);
- priv->render.process_requests = eina_list_remove_list(
- priv->render.process_requests, priv->render.process_requests);
+ if (priv->process.preCallback)
+ data = priv->process.preCallback(priv->process.preData, priv->self);
- // If the queue became empty, try to add more process requests to it.
- if (!priv->render.process_requests) {
- _ewk_tiled_backing_store_update_add_process(priv);
- _ewk_tiled_backing_store_process_queue_update(priv);
- }
- } else // no tile process request, can start processing the pre-render requests
-#endif
- _ewk_tiled_backing_store_pre_render_request_process_single(priv);
+ _ewk_tiled_backing_store_pre_render_request_process_single(priv);
- if (priv->process.post_cb)
- priv->process.post_cb(priv->process.post_data, data, priv->self);
+ if (priv->process.postCallback)
+ priv->process.postCallback(priv->process.postData, data, priv->self);
-#if ENABLE(TIZEN_REPAINT_IDLER)
- if (!priv->render.process_requests && !priv->render.pre_render_requests) {
-#else
- if (!priv->render.pre_render_requests) {
-#endif
+
+ if (!priv->render.preRenderRequests) {
priv->render.idler = 0;
- return EINA_FALSE;
+ return false;
}
- return EINA_TRUE;
+ return true;
}
static inline void _ewk_tiled_backing_store_item_process_idler_stop(Ewk_Tiled_Backing_Store_Data* priv)
static Eina_Bool _ewk_tiled_backing_store_disable_render(Ewk_Tiled_Backing_Store_Data* priv)
{
if (priv->render.suspend)
- return EINA_TRUE;
+ return true;
- priv->render.suspend = EINA_TRUE;
-#if ENABLE(TIZEN_REPAINT_IDLER)
- _ewk_tiled_backing_store_restore_idler_timer_stop(priv);
- _ewk_tiled_backing_store_process_requests_flush(priv);
-#endif
+
+ priv->render.suspend = true;
_ewk_tiled_backing_store_item_process_idler_stop(priv);
-#if ENABLE(TIZEN_REPAINT_IDLER)
- _ewk_tiled_backing_store_update_add_process(priv);
-#endif
- return EINA_TRUE;
+
+ return true;
}
static Eina_Bool _ewk_tiled_backing_store_enable_render(Ewk_Tiled_Backing_Store_Data* priv)
{
if (!priv->render.suspend)
- return EINA_TRUE;
+ return true;
- priv->render.suspend = EINA_FALSE;
+ priv->render.suspend = false;
_ewk_tiled_backing_store_fill_renderers(priv);
_ewk_tiled_backing_store_item_process_idler_start(priv);
- return EINA_TRUE;
+ return true;
}
static inline Eina_Bool _ewk_tiled_backing_store_item_fill(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tiled_Backing_Store_Item* item, unsigned long column, unsigned long row)
{
- unsigned long m_col = priv->model.base.col + column;
- unsigned long m_row = priv->model.base.row + row;
- double last_used = ecore_loop_time_get();
+ unsigned long currentColumn = priv->model.base.column + column;
+ unsigned long currentRow = priv->model.base.row + row;
+ double lastUsed = ecore_loop_time_get();
#if ENABLE(TIZEN_VIEW_ACTIVE_SET)
if (!priv->view.active)
return EINA_TRUE;
#endif
- if (m_col >= priv->model.cur.cols || m_row >= priv->model.cur.rows) {
+ if (currentColumn >= priv->model.current.columns || currentRow >= priv->model.current.rows) {
if (item->tile)
- _ewk_tiled_backing_store_tile_dissociate(priv, item, last_used);
+ _ewk_tiled_backing_store_tile_dissociate(priv, item, lastUsed);
} else {
Ewk_Tile* tile;
const float zoom = priv->view.tile.zoom;
if (item->tile) {
Ewk_Tile* old = item->tile;
- if (old->row != m_row || old->col != m_col || old->zoom != zoom)
- _ewk_tiled_backing_store_tile_dissociate(priv, item, last_used);
- else if (old->row == m_row && old->col == m_col && old->zoom == zoom)
+ if (old->row != currentRow || old->col != currentColumn || old->zoom != zoom)
+ _ewk_tiled_backing_store_tile_dissociate(priv, item, lastUsed);
+ else if (old->row == currentRow && old->col == currentColumn && old->zoom == zoom)
goto end;
}
- tile = ewk_tile_matrix_tile_exact_get(priv->model.matrix, m_col, m_row, zoom);
+ 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: item 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 item should be 0!", item->tile);
_ewk_tiled_backing_store_tile_dissociate(priv, item,
- last_used);
+ lastUsed);
}
/* Do not add new requests to the render queue */
#if ENABLE(TIZEN_SELECTIVE_RENDERING)
- if (!priv->render.suspend || priv->render.selective_render.enabled) {
+ if (!priv->render.suspend || priv->render.selectiveRender.enabled) {
#else
if (!priv->render.suspend) {
#endif
- tile = _ewk_tiled_backing_store_tile_new(priv, m_col, m_row, zoom);
+ tile = _ewk_tiled_backing_store_tile_new(priv, currentColumn, currentRow, zoom);
if (!tile) {
#if ENABLE(TIZEN_EWK_ERROR_LOG)
- CRITICAL("Couldn't create tile (%lu, %lu) z:%f", m_row, m_col, zoom);
+ CRITICAL("Couldn'tile create tile (%lu, %lu) z:%f", currentColumn, currentRow, zoom);
#endif
- return EINA_FALSE;
+ return false;
}
_ewk_tiled_backing_store_tile_associate(priv, tile, item);
}
} else if (tile != item->tile) {
if (item->tile)
_ewk_tiled_backing_store_tile_dissociate(priv,
- item, last_used);
+ item, lastUsed);
_ewk_tiled_backing_store_tile_associate(priv, tile, item);
}
end:
- return EINA_TRUE;
+ return true;
}
- return EINA_TRUE;
+ return true;
}
static Ewk_Tiled_Backing_Store_Item* _ewk_tiled_backing_store_item_add(Ewk_Tiled_Backing_Store_Data* priv, unsigned long column, unsigned long row)
{
- Ewk_Tiled_Backing_Store_Item* it;
- Evas_Coord x, y, tw, th;
+ Ewk_Tiled_Backing_Store_Item* item;
+ Evas_Coord x, y, tileWidth, tileHeight;
- DBG("o=%p", priv->self);
+ DBG("ewkBackingStore%p", priv->self);
- it = static_cast<Ewk_Tiled_Backing_Store_Item*>(malloc(sizeof(*it)));
- if (!it)
+ item = static_cast<Ewk_Tiled_Backing_Store_Item*>(malloc(sizeof(*item)));
+ if (!item)
return 0;
- tw = priv->view.tile.width;
- th = priv->view.tile.height;
- x = priv->view.offset.base.x + priv->view.x + tw *column;
- y = priv->view.offset.base.y + priv->view.y + th *row;
+ 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;
- it->tile = 0;
+ item->tile = 0;
- it->smooth_scale = priv->view.tile.zoom_weak_smooth_scale;
- _ewk_tiled_backing_store_item_move(it, x, y);
- _ewk_tiled_backing_store_item_resize(it, tw, th);
- if (!_ewk_tiled_backing_store_item_fill(priv, it, column, row)) {
- free(it);
+ 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)) {
+ free(item);
return 0;
}
- return it;
+ return item;
}
static void _ewk_tiled_backing_store_item_del(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tiled_Backing_Store_Item* item)
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)
if (priv->changed.any)
return;
evas_object_smart_changed(priv->self);
- priv->changed.any = EINA_TRUE;
+ priv->changed.any = true;
}
-static void _ewk_tiled_backing_store_view_cols_end_del(Ewk_Tiled_Backing_Store_Data* priv, Eina_Inlist** p_row, unsigned int count)
+static void _ewk_tiled_backing_store_view_cols_end_del(Ewk_Tiled_Backing_Store_Data* priv, Eina_Inlist** rowList, unsigned int count)
{
- Eina_Inlist* n;
+ Eina_Inlist* nextItem;
unsigned int i;
if (!count)
return;
- n = (*p_row)->last;
+ nextItem = (*rowList)->last;
for (i = 0; i < count; i++) {
- Ewk_Tiled_Backing_Store_Item* it;
- it = EINA_INLIST_CONTAINER_GET(n, Ewk_Tiled_Backing_Store_Item);
- n = n->prev;
- *p_row = eina_inlist_remove(*p_row, EINA_INLIST_GET(it));
- _ewk_tiled_backing_store_item_del(priv, it);
+ Ewk_Tiled_Backing_Store_Item* item;
+ item = EINA_INLIST_CONTAINER_GET(nextItem, Ewk_Tiled_Backing_Store_Item);
+ nextItem = nextItem->prev;
+ *rowList = eina_inlist_remove(*rowList, EINA_INLIST_GET(item));
+ _ewk_tiled_backing_store_item_del(priv, item);
}
}
-static Eina_Bool _ewk_tiled_backing_store_view_cols_end_add(Ewk_Tiled_Backing_Store_Data* priv, Eina_Inlist** p_row, unsigned int base_column, unsigned int count)
+static Eina_Bool _ewk_tiled_backing_store_view_cols_end_add(Ewk_Tiled_Backing_Store_Data* priv, Eina_Inlist** rowList, unsigned int baseColumn, unsigned int count)
{
- unsigned int i, r = p_row - priv->view.items;
+ unsigned int i, row = rowList - priv->view.items;
- for (i = 0; i < count; i++, base_column++) {
- Ewk_Tiled_Backing_Store_Item* it;
+ for (i = 0; i < count; i++, baseColumn++) {
+ Ewk_Tiled_Backing_Store_Item* item;
- it = _ewk_tiled_backing_store_item_add(priv, base_column, r);
- if (!it) {
- CRITICAL("failed to add column %u of %u in row %u.", i, count, r);
- _ewk_tiled_backing_store_view_cols_end_del(priv, p_row, i);
- return EINA_FALSE;
+ 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;
}
- *p_row = eina_inlist_append(*p_row, EINA_INLIST_GET(it));
+ *rowList = eina_inlist_append(*rowList, EINA_INLIST_GET(item));
}
- return EINA_TRUE;
+ return true;
}
static void _ewk_tiled_backing_store_view_row_del(Ewk_Tiled_Backing_Store_Data* priv, Eina_Inlist* row)
{
while (row) {
- Ewk_Tiled_Backing_Store_Item* it;
- it = EINA_INLIST_CONTAINER_GET(row, Ewk_Tiled_Backing_Store_Item);
+ Ewk_Tiled_Backing_Store_Item* item;
+ item = EINA_INLIST_CONTAINER_GET(row, Ewk_Tiled_Backing_Store_Item);
row = row->next;
- _ewk_tiled_backing_store_item_del(priv, it);
+ _ewk_tiled_backing_store_item_del(priv, item);
}
}
free(priv->view.items);
priv->view.items = 0;
- priv->view.cols = 0;
+ priv->view.columns = 0;
priv->view.rows = 0;
}
#if ENABLE(TIZEN_ZOOM_CHECK_BEFORE_PAINTING)
if (priv->view.tile.zoom != tile->zoom)
- return; // todo: remove me later, don't even flag as dirty!
+ return; // todo: remove me later, don'tile even flag as dirty!
#else
if (priv->view.tile.width != tile->width || priv->view.tile.height != tile->height)
- return; // todo: remove me later, don't even flag as dirty!
+ return; // todo: remove me later, don'tile even flag as dirty!
#endif
- EINA_SAFETY_ON_NULL_RETURN(priv->render.cb);
- if (!priv->render.cb(priv->render.data, tile, area))
+ EINA_SAFETY_ON_NULL_RETURN(priv->render.callback);
+ if (!priv->render.callback(priv->render.data, tile, area))
return;
-#if ENABLE(TIZEN_REPAINT_IDLER)
- if (!priv->render.on_idler || priv->render.next_no_idler || priv->render.on_idler_disabled) {
- float scale = 1.0;
-#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
- if (priv->view.tile.enable_scale)
- scale = t->zoom;
-#endif
- evas_object_image_data_update_add(t->image, area->x * scale, area->y * scale, area->w * scale, area->h * scale);
-#if ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
- ewk_tile_empty_clear(t);
-#endif
- } else {
- Ewk_Tiled_Backing_Store_Update_Add_Item *it;
- MALLOC_OR_OOM_RET(it, sizeof(*it));
- it->t = t;
- it->area.x = area->x;
- it->area.y = area->y;
- it->area.w = area->w;
- it->area.h = area->h;
- priv->render.tiles_pending_update_add = eina_list_append(priv->render.tiles_pending_update_add, it);
- }
-#else
float scale = 1.0;
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
if (priv->view.tile.enable_scale)
#if ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
ewk_tile_empty_clear(tile);
#endif
-#endif
}
#if ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
#if !ENABLE(TIZEN_REUSE_BIGGER_ZOOM_FIRST)
-static unsigned int _tile_distance2(const void *data, Ewk_Tile *t)
+static unsigned int _tile_distance2(const void *data, Ewk_Tile *tile)
{
Evas_Coord vx, vy;
int x, y;
// tiles
float scale = 1.0;
- vx = priv->view.offset.cur.x * -1;
- vy = priv->view.offset.cur.y * -1;
+ vx = priv->view.offset.current.x * -1;
+ vy = priv->view.offset.current.y * -1;
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
if (priv->view.tile.enable_scale)
scale = priv->view.tile.zoom;
#endif
- tx = t->x * scale;
- ty = t->y * scale;
+ tx = tile->x * scale;
+ ty = tile->y * scale;
// Calculating the distance to the viewport
- if (tx + t->w < vx)
- x = vx - (tx + t->w);
+ if (tx + tile->w < vx)
+ x = vx - (tx + tile->w);
else if (tx > vx + priv->view.w)
x = tx - (vx + priv->view.w);
else
x = 0;
- if (ty + t->h < vy)
- y = vy - (ty + t->h);
+ if (ty + tile->h < vy)
+ y = vy - (ty + tile->h);
else if (ty > vy + priv->view.h)
y = ty - (vy + priv->view.h);
else
vd = (x*x + y*y);
// Calculating difference from current zoom level
- zd = multiplier * fabsf(t->zoom - priv->view.tile.zoom);
+ zd = multiplier * fabsf(tile->zoom - priv->view.tile.zoom);
// Calculating distance for non-active views
#if ENABLE(TIZEN_VIEW_ACTIVE_SET)
return vd + zd + ad;
}
#else
-#if ENABLE(TIZEN_PRE_RENDERING_ADVANCE)
-static float _bigger_zoom_first(const void *data, Ewk_Tile *t)
-#else
-static unsigned int _bigger_zoom_first(const void *data, Ewk_Tile *t)
-#endif
+static unsigned int _bigger_zoom_first(const void *data, Ewk_Tile *tile)
{
Evas_Coord vx, vy;
int x, y;
// tiles
float scale = 1.0;
- vx = priv->view.offset.cur.x * -1;
- vy = priv->view.offset.cur.y * -1;
+ vx = priv->view.offset.current.x * -1;
+ vy = priv->view.offset.current.y * -1;
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
if (priv->view.tile.enable_scale)
scale = priv->view.tile.zoom;
#endif
- tx = t->x * scale;
- ty = t->y * scale;
+ tx = tile->x * scale;
+ ty = tile->y * scale;
// Calculating the distance to the viewport
- if (tx + t->width < vx)
- x = vx - (tx + t->width);
+ if (tx + tile->width < vx)
+ x = vx - (tx + tile->width);
else if (tx > vx + priv->view.width)
x = tx - (vx + priv->view.width);
else
x = 0;
- if (ty + t->height < vy)
- y = vy - (ty + t->height);
+ if (ty + tile->height < vy)
+ y = vy - (ty + tile->height);
else if (ty > vy + priv->view.height)
y = ty - (vy + priv->view.height);
else
vd = (x*x + y*y);
// To keep tiles for smallest zoom level as long as possible
- diff_zoom = (t->zoom == priv->view.tile.zoom)?0.0f:t->zoom;
+ diff_zoom = (tile->zoom == priv->view.tile.zoom)?0.0f:tile->zoom;
zd = multiplier * fabsf(diff_zoom);
// Calculating distance for non-active views
#if ENABLE(TIZEN_VIEW_ACTIVE_SET)
ad = multiplier * !priv->view.active;
#endif
-#if ENABLE(TIZEN_PRE_RENDERING_ADVANCE)
- // Adopt drawing time to measure distance among tiles
- unsigned int ret = vd + zd + ad;
- if (t->drawing_time >= HEAVY_TILE_TIME_LIMIT) {
- // if the tile has over HEAVY_TILE_TIME_LIMIT drawing time, it should remain in cache,
- // but what if there is no left tile which has less than HEAVY_TILE_TIME_LIMIT.
- // than in this case pre-render should consider the distance of the tile from viewport.
- int farmost_distance = priv->model.width * priv->model.width + priv->model.height * priv->model.height + 1;
- ret = ret * 100 / farmost_distance; // make the value into a percentage
- }
- return ret;
-#else
// return viewport distance + zoom level distance + view being inactive
return vd + zd + ad;
-#endif
}
#endif
#endif
if (priv->model.matrix) {
_ewk_tiled_backing_store_view_rows_all_del(priv);
- priv->changed.offset = EINA_FALSE;
- priv->changed.size = EINA_TRUE;
+ priv->changed.offset = false;
+ priv->changed.size = true;
ewk_tile_matrix_free(priv->model.matrix);
}
#if ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
#if !ENABLE(TIZEN_REUSE_BIGGER_ZOOM_FIRST)
priv->model.matrix = ewk_tile_matrix_new
- (tileUnusedCache, priv->model.cur.cols, priv->model.cur.rows, priv->view.tile.zoom,
- priv->cspace, priv->view.cols, priv->view.rows,
+ (tileUnusedCache, priv->model.current.columns, priv->model.current.rows, priv->view.tile.zoom,
+ priv->colorSpace, priv->view.columns, priv->view.rows,
_ewk_tiled_backing_store_render, priv, _tile_distance2, priv, evas_object_evas_get(priv->self));
#else
priv->model.matrix = ewk_tile_matrix_new
- (tileUnusedCache, priv->model.cur.cols, priv->model.cur.rows, priv->view.tile.zoom,
- priv->cspace, priv->view.cols, priv->view.rows,
+ (tileUnusedCache, priv->model.current.columns, priv->model.current.rows, priv->view.tile.zoom,
+ priv->colorSpace, priv->view.columns, priv->view.rows,
_ewk_tiled_backing_store_render, priv, _bigger_zoom_first, priv, evas_object_evas_get(priv->self));
#endif
#else
- priv->model.matrix = ewk_tile_matrix_new
- (tileUnusedCache, priv->model.cur.cols, priv->model.cur.rows,
- priv->view.tile.zoom, priv->cspace, _ewk_tiled_backing_store_render,
- priv);
+ priv->model.matrix = ewk_tile_matrix_new(tileUnusedCache, priv->model.current.columns, priv->model.current.rows, priv->view.tile.zoom, priv->colorSpace, _ewk_tiled_backing_store_render, priv);
#endif
}
-static void _ewk_tiled_backing_store_smart_member_del(Evas_Object* ewkTile, Evas_Object* member)
+static void _ewk_tiled_backing_store_smart_member_del(Evas_Object* ewkBackingStore, Evas_Object* member)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
- if (!priv->contents_clipper)
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ if (!priv->contentsClipper)
return;
evas_object_clip_unset(member);
- if (!evas_object_clipees_get(priv->contents_clipper))
- evas_object_hide(priv->contents_clipper);
+ if (!evas_object_clipees_get(priv->contentsClipper))
+ evas_object_hide(priv->contentsClipper);
}
-static void _ewk_tiled_backing_store_smart_member_add(Evas_Object* ewkTile, Evas_Object* member)
+static void _ewk_tiled_backing_store_smart_member_add(Evas_Object* ewkBackingStore, Evas_Object* member)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
- if (!priv->contents_clipper)
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ if (!priv->contentsClipper)
return;
- evas_object_clip_set(member, priv->contents_clipper);
-#if !ENABLE(TIZEN_LOCAL_DIFF)
- if (evas_object_visible_get(ewkTile))
+ evas_object_clip_set(member, priv->contentsClipper);
+#if !ENABLE(TIZEN_TILE_BASECODE)
+ if (evas_object_visible_get(ewkBackingStore))
#endif
- evas_object_show(priv->contents_clipper);
+ evas_object_show(priv->contentsClipper);
}
#ifdef DEBUG_MEM_LEAKS
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);
static Eina_Bool _ewk_tiled_backing_store_sig_usr(void* data, int type, void* event)
{
-#if !ENABLE(TIZEN_LOCAL_DIFF)
+#if !ENABLE(TIZEN_TILE_BASECODE)
Ecore_Event_Signal_User* sig = (Ecore_Event_Signal_User*)event;
#endif
Ewk_Tiled_Backing_Store_Data* priv = (Ewk_Tiled_Backing_Store_Data*)data;
-#if !ENABLE(TIZEN_LOCAL_DIFF)
+#if !ENABLE(TIZEN_TILE_BASECODE)
if (sig->number == 2) {
- Ewk_Tile_Unused_Cache* tuc;
- tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
- ewk_tile_unused_cache_auto_flush(tuc);
+ Ewk_Tile_Unused_Cache* tilieUnusedCache;
+ tilieUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+ ewk_tile_unused_cache_auto_flush(tilieUnusedCache);
}
#endif
_ewk_tiled_backing_store_view_dbg(priv);
_ewk_tiled_backing_store_mem_dbg(priv);
- return EINA_TRUE;
+ return true;
}
#endif
-static void _ewk_tiled_backing_store_smart_add(Evas_Object* ewkTile)
+static void _ewk_tiled_backing_store_smart_add(Evas_Object* ewkBackingStore)
{
Ewk_Tiled_Backing_Store_Data* priv;
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
float scale = 1.0;
#endif
- DBG("o=%p", ewkTile);
+ DBG("ewkBackingStore=%p", ewkBackingStore);
priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(calloc(1, sizeof(*priv)));
if (!priv)
return;
- priv->self = ewkTile;
+ priv->self = ewkBackingStore;
priv->view.tile.zoom = 1.0;
priv->view.tile.width = DEFAULT_TILE_W;
priv->view.tile.height = DEFAULT_TILE_H;
- 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;
#if ENABLE(TIZEN_VIEW_ACTIVE_SET)
priv->view.active = EINA_TRUE;
#endif
- priv->model.base.col = 0;
+ priv->model.base.column = 0;
priv->model.base.row = 0;
- priv->model.cur.cols = 1;
- priv->model.cur.rows = 1;
- priv->model.old.cols = 0;
+ priv->model.current.columns = 1;
+ priv->model.current.rows = 1;
+ priv->model.old.columns = 0;
priv->model.old.rows = 0;
priv->model.width = 0;
priv->model.height = 0;
- priv->render.suspend = EINA_FALSE;
-#if ENABLE(TIZEN_REPAINT_IDLER)
- priv->render.next_no_idler = EINA_FALSE;
- priv->render.on_idler = EINA_FALSE;
- priv->render.on_idler_disabled = EINA_FALSE;
-#endif
+ priv->render.suspend = false;
#if ENABLE(TIZEN_SELECTIVE_RENDERING)
- priv->render.selective_render.render_on_next = EINA_FALSE;
- priv->render.selective_render.enabled = EINA_FALSE;
- priv->render.selective_render.idler_enterer = NULL;
+ priv->render.selectiveRender.renderOnNext = false;
+ priv->render.selectiveRender.enabled = false;
+ priv->render.selectiveRender.idlerEnterer = NULL;
#endif
- priv->cspace = EVAS_COLORSPACE_ARGB8888; // TODO: detect it.
+ priv->colorSpace = EVAS_COLORSPACE_ARGB8888; // TODO: detect it.
#if ENABLE(TIZEN_FIX_EMAIL_ONE_TILE_DISPLAY)
- priv->changed.need_layout = EINA_FALSE;
+ priv->changed.needLayout = false;
#endif
- evas_object_smart_data_set(ewkTile, priv);
- _parent_sc.add(ewkTile);
+ evas_object_smart_data_set(ewkBackingStore, priv);
+ _parent_sc.add(ewkBackingStore);
- priv->contents_clipper = evas_object_rectangle_add(
- evas_object_evas_get(ewkTile));
- evas_object_move(priv->contents_clipper, 0, 0);
+ priv->contentsClipper = evas_object_rectangle_add(
+ evas_object_evas_get(ewkBackingStore));
+ evas_object_move(priv->contentsClipper, 0, 0);
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
if (priv->view.tile.enable_scale)
scale = priv->view.tile.zoom;
#endif
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
- evas_object_resize(priv->contents_clipper,
+ evas_object_resize(priv->contentsClipper,
priv->model.width * scale,
priv->model.height * scale);
#else
- evas_object_resize(priv->contents_clipper,
+ evas_object_resize(priv->contentsClipper,
priv->model.width, priv->model.height);
#endif
- evas_object_color_set(priv->contents_clipper, 255, 255, 255, 255);
- evas_object_show(priv->contents_clipper);
- evas_object_smart_member_add(priv->contents_clipper, ewkTile);
+ evas_object_color_set(priv->contentsClipper, 255, 255, 255, 255);
+ evas_object_show(priv->contentsClipper);
+ evas_object_smart_member_add(priv->contentsClipper, ewkBackingStore);
_ewk_tiled_backing_store_model_matrix_create(priv, 0);
evas_object_move(priv->base.clipper, 0, 0);
evas_object_resize(priv->base.clipper, 0, 0);
- evas_object_clip_set(priv->contents_clipper, priv->base.clipper);
+ evas_object_clip_set(priv->contentsClipper, priv->base.clipper);
#ifdef DEBUG_MEM_LEAKS
- priv->sig_usr = ecore_event_handler_add
+ priv->sigUsr = ecore_event_handler_add
(ECORE_EVENT_SIGNAL_USER, _ewk_tiled_backing_store_sig_usr, priv);
#endif
}
#if ENABLE(TIZEN_SELECTIVE_RENDERING)
-static void _ewk_tiled_backing_store_free_cb(Evas_Object *o)
+static void _ewk_tiled_backing_store_free_cb(Evas_Object *ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(o, priv);
- if (priv->render.selective_render.idler_enterer)
- ecore_idle_enterer_del(priv->render.selective_render.idler_enterer);
- priv->render.selective_render.idler_enterer = NULL;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ if (priv->render.selectiveRender.idlerEnterer)
+ ecore_idle_enterer_del(priv->render.selectiveRender.idlerEnterer);
+ priv->render.selectiveRender.idlerEnterer = NULL;
}
#endif
-static void _ewk_tiled_backing_store_smart_del(Evas_Object* ewkTile)
+static void _ewk_tiled_backing_store_smart_del(Evas_Object* ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
- DBG("o=%p", ewkTile);
- Ewk_Tile_Unused_Cache* tuc;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ DBG("ewkBackingStore%p", ewkBackingStore);
+ Ewk_Tile_Unused_Cache* tileUnusedCache;
- tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
- ewk_tile_unused_cache_unlock_area(tuc);
+ tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+ ewk_tile_unused_cache_unlock_area(tileUnusedCache);
-#if ENABLE(TIZEN_REPAINT_IDLER)
- _ewk_tiled_backing_store_restore_idler_timer_stop(priv);
- _ewk_tiled_backing_store_process_requests_flush(priv);
- _ewk_tiled_backing_store_update_add_flush(priv);
-#elif !ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
+#if !ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
_ewk_tiled_backing_store_flush(priv);
#endif
#ifdef DEBUG_MEM_LEAKS
_ewk_tiled_backing_store_mem_dbg(priv);
if (priv->sig_usr)
- priv->sig_usr = ecore_event_handler_del(priv->sig_usr);
+ ecore_event_handler_del(priv->sig_usr);
#endif
ewk_tile_matrix_free(priv->model.matrix);
- evas_object_smart_member_del(priv->contents_clipper);
- evas_object_del(priv->contents_clipper);
+ evas_object_smart_member_del(priv->contentsClipper);
+ evas_object_del(priv->contentsClipper);
#if ENABLE(TIZEN_SELECTIVE_RENDERING)
- _ewk_tiled_backing_store_free_cb(ewkTile);
+ _ewk_tiled_backing_store_free_cb(ewkBackingStore);
#endif
- _parent_sc.del(ewkTile);
+ _parent_sc.del(ewkBackingStore);
#ifdef DEBUG_MEM_LEAKS
printf("\nIMPORTANT: TILED BACKING STORE DELETED (may be real leaks)\n");
#endif
}
-static void _ewk_tiled_backing_store_smart_move(Evas_Object* ewkTile, Evas_Coord x, Evas_Coord y)
+static void _ewk_tiled_backing_store_smart_move(Evas_Object* ewkBackingStore, Evas_Coord x, Evas_Coord y)
{
- DBG("o=%p, new pos: %dx%d", ewkTile, x, y);
+ DBG("ewkBackingStore%p, new pos: %dx%d", ewkBackingStore, x, y);
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
- if (priv->changed.pos)
+ if (priv->changed.position)
return;
if (priv->view.x == x && priv->view.y == y)
return;
- priv->changed.pos = EINA_TRUE;
+ priv->changed.position = true;
_ewk_tiled_backing_store_changed(priv);
}
-static void _ewk_tiled_backing_store_smart_resize(Evas_Object* ewkTile, Evas_Coord width, Evas_Coord height)
+static void _ewk_tiled_backing_store_smart_resize(Evas_Object* ewkBackingStore, Evas_Coord width, Evas_Coord height)
{
- DBG("o=%p, new size: %dx%d", ewkTile, width, height);
+ DBG("ewkBackingStore%p, new size: %dx%d", ewkBackingStore, width, height);
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
if (priv->changed.size)
return;
if (priv->view.width == width && priv->view.height == height)
return;
- priv->changed.size = EINA_TRUE;
+ priv->changed.size = true;
_ewk_tiled_backing_store_changed(priv);
}
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 cols, rows, old_rows, old_cols;
- INF("o=%p, new size: %dx%d", priv->self, width, height);
+ long columns, rows, oldRows, oldCols;
+ INF("ewkBackingStore%p, new size: %dx%d", priv->self, width, height);
- cols = 1 + (int)ceil((float)width / (float)tileWidth);
- rows = 1 + (int)ceil((float)height / (float)tileHeight);
+ columns = 1 + static_cast<int>(ceil(width / static_cast<float>(tileWidth)));
+ rows = 1 + static_cast<int>(ceil(height / static_cast<float>(tileHeight)));
- INF("o=%p new grid size cols: %ld, rows: %ld, was %ld, %ld",
- priv->self, cols, 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 == cols && priv->view.rows == rows)
+ if (priv->view.columns == columns && priv->view.rows == rows)
return;
- old_cols = priv->view.cols;
- old_rows = priv->view.rows;
+ oldCols = priv->view.columns;
+ oldRows = priv->view.rows;
#if ENABLE(TIZEN_TILED_CACHE_NEWIMP)
- ewk_tile_matrix_view_size_set(priv->model.matrix, cols, rows);
+ ewk_tile_matrix_view_size_set(priv->model.matrix, columns, rows);
#endif
- if (rows < old_rows) {
+ if (rows < oldRows) {
Eina_Inlist** start, **end;
start = priv->view.items + rows;
- end = priv->view.items + old_rows;
+ end = priv->view.items + oldRows;
_ewk_tiled_backing_store_view_rows_range_del(priv, start, end);
}
priv->view.items = static_cast<Eina_Inlist**>(newItems);
priv->view.rows = rows;
- priv->view.cols = cols;
- if (rows > old_rows) {
- Eina_Inlist** start = priv->view.items + old_rows;
+ 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, cols);
- if (!r) {
- CRITICAL("failed to allocate %ld columns", cols);
- _ewk_tiled_backing_store_view_rows_range_del(priv, priv->view.items + old_rows, start);
- priv->view.rows = old_rows;
+ Eina_Bool request = _ewk_tiled_backing_store_view_cols_end_add(priv, start, 0, columns);
+ if (!request) {
+ CRITICAL("failed to allocate %ld column", columns);
+ _ewk_tiled_backing_store_view_rows_range_del(priv, priv->view.items + oldRows, start);
+ priv->view.rows = oldRows;
return;
}
}
}
- if (cols != old_cols) {
- int todo = cols - old_cols;
+ if (columns != oldCols) {
+ int todo = columns - oldCols;
Eina_Inlist** start = priv->view.items;
- Eina_Inlist** end = start + std::min(old_rows, rows);
+ Eina_Inlist** end = start + std::min(oldRows, rows);
if (todo > 0) {
for (; start < end; start++) {
- Eina_Bool r = _ewk_tiled_backing_store_view_cols_end_add(priv, start, old_cols, todo);
- if (!r) {
- CRITICAL("failed to allocate %d columns!", todo);
+ Eina_Bool result = _ewk_tiled_backing_store_view_cols_end_add(priv, start, oldCols, todo);
+ if (!result) {
+ CRITICAL("failed to allocate %d column!", todo);
for (start--; start >= priv->view.items; start--)
_ewk_tiled_backing_store_view_cols_end_del(priv, start, todo);
- if (rows > old_rows) {
- start = priv->view.items + old_rows;
+ if (rows > oldRows) {
+ start = priv->view.items + oldRows;
end = priv->view.items + rows;
for (; start < end; start++)
_ewk_tiled_backing_store_view_cols_end_del(priv, start, todo);
priv->view.width = width;
priv->view.height = height;
-
_ewk_tiled_backing_store_recalc_renderers(
priv, width, height, priv->view.tile.width, priv->view.tile.height);
}
{
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->model.cur.cols, priv->model.cur.rows,
+ priv->view.columns, priv->view.rows,
+ priv->model.current.columns, priv->model.current.rows,
priv->model.width, priv->model.height,
- priv->model.base.col, priv->model.base.row,
- priv->view.offset.cur.x, priv->view.offset.cur.y,
+ priv->model.base.column, priv->model.base.row,
+ 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);
start = priv->view.items;
end = priv->view.items + priv->view.rows;
for (; start < end; start++) {
- const Ewk_Tiled_Backing_Store_Item* it;
+ const Ewk_Tiled_Backing_Store_Item* item;
- EINA_INLIST_FOREACH(*start, it) {
- printf(" %+4d,%+4d ", it->geometry.x, it->geometry.y);
+ EINA_INLIST_FOREACH(*start, item) {
+ printf(" %+4d,%+4d ", item->geometry.x, item->geometry.y);
- if (!it->tile)
+ if (!item->tile)
printf(" ;");
else
- printf("%8p %lu,%lu;", it->tile, it->tile->col, it->tile->row);
+ printf("%8p %lu,%lu;", item->tile, item->tile->col, item->tile->row);
}
printf("\n");
}
* went out of screen is now at bottom and filled with new model items.
*
* This is worth just when @a count is smaller than @c
- * priv->view.rows, after that one is refilling the whole matrix so it
+ * priv->view.rows, after that one is refilling the whole matrix so item
* is better to trigger full refill.
*
* @param count the number of times to repeat the process.
*/
static void _ewk_tiled_backing_store_view_wrap_up(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y, unsigned int count)
{
- unsigned int last_row = priv->view.rows - 1;
- Evas_Coord tw = priv->view.tile.width;
- Evas_Coord th = priv->view.tile.height;
- Evas_Coord off_y = priv->view.offset.base.y + count * th;
- Evas_Coord oy = y + (last_row - count + 1) * th + off_y;
- Eina_Inlist** itr_start, **itr_end;
+ unsigned int lastRow = priv->view.rows - 1;
+ Evas_Coord tileWidth = priv->view.tile.width;
+ Evas_Coord tileHeight = priv->view.tile.height;
+ Evas_Coord offsetY = priv->view.offset.base.y + count * tileHeight;
+ Evas_Coord tilePositionY = y + (lastRow - count + 1) * tileHeight + offsetY;
+ Eina_Inlist** iteratorStart, **iteratorEnd;
+ Evas_Coord originX = x + priv->view.offset.base.x;
- itr_start = priv->view.items;
- itr_end = itr_start + last_row;
+ iteratorStart = priv->view.items;
+ iteratorEnd = iteratorStart + lastRow;
for (; count > 0; count--) {
- Eina_Inlist** itr;
- Eina_Inlist* tmp = *itr_start;
- Ewk_Tiled_Backing_Store_Item* it;
- Evas_Coord ox = x + priv->view.offset.base.x;
- int c = 0;
+ Eina_Inlist** iteratorList;
+ Eina_Inlist* temp = *iteratorStart;
+ Ewk_Tiled_Backing_Store_Item* item;
+ Evas_Coord tilePositionX = originX;
+ int count1 = 0;
- for (itr = itr_start; itr < itr_end; itr++)
- *itr = *(itr + 1);
- *itr = tmp;
+ for (iteratorList = iteratorStart; iteratorList < iteratorEnd; iteratorList++)
+ *iteratorList = *(iteratorList + 1);
+ *iteratorList = temp;
priv->model.base.row++;
- EINA_INLIST_FOREACH(tmp, it) {
- _ewk_tiled_backing_store_item_move(it, ox, oy);
- ox += tw;
- _ewk_tiled_backing_store_item_fill(priv, it, c, last_row);
- c++;
+ 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++;
}
- oy += th;
+ tilePositionY += tileHeight;
}
- priv->view.offset.base.y = off_y;
+ priv->view.offset.base.y = offsetY;
}
/**
* went out of screen is now at top and filled with new model items.
*
* This is worth just when @a count is smaller than @c
- * priv->view.rows, after that one is refilling the whole matrix so it
+ * priv->view.rows, after that one is refilling the whole matrix so item
* is better to trigger full refill.
*
* @param count the number of times to repeat the process.
*/
static void _ewk_tiled_backing_store_view_wrap_down(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y, unsigned int count)
{
- Evas_Coord tw = priv->view.tile.width;
- Evas_Coord th = priv->view.tile.height;
- Evas_Coord off_y = priv->view.offset.base.y - count * th;
- Evas_Coord oy = y + off_y + (count - 1) * th;
- Eina_Inlist** itr_start, **itr_end;
+ Evas_Coord tileWidth = priv->view.tile.width;
+ Evas_Coord tileHeight = priv->view.tile.height;
+ Evas_Coord offsetY = priv->view.offset.base.y - count * tileHeight;
+ Evas_Coord tilePositionY = y + offsetY + (count - 1) * tileHeight;
+ Eina_Inlist** iteratorStart, **iteratorEnd;
+ Evas_Coord originX = x + priv->view.offset.base.x;
- itr_start = priv->view.items + priv->view.rows - 1;
- itr_end = priv->view.items;
+ iteratorStart = priv->view.items + priv->view.rows - 1;
+ iteratorEnd = priv->view.items;
for (; count > 0; count--) {
- Eina_Inlist** itr;
- Eina_Inlist* tmp = *itr_start;
- Ewk_Tiled_Backing_Store_Item* it;
- Evas_Coord ox = x + priv->view.offset.base.x;
- int c = 0;
+ Eina_Inlist** iteratorList;
+ Eina_Inlist* temp = *iteratorStart;
+ Ewk_Tiled_Backing_Store_Item* item;
+ Evas_Coord tilePositionX = originX;
+ int count1 = 0;
- for (itr = itr_start; itr > itr_end; itr--)
- *itr = *(itr - 1);
- *itr = tmp;
+ for (iteratorList = iteratorStart; iteratorList > iteratorEnd; iteratorList--)
+ *iteratorList = *(iteratorList - 1);
+ *iteratorList = temp;
priv->model.base.row--;
- EINA_INLIST_FOREACH(tmp, it) {
- _ewk_tiled_backing_store_item_move(it, ox, oy);
- ox += tw;
- _ewk_tiled_backing_store_item_fill(priv, it, c, 0);
- c++;
+ 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++;
}
- oy -= th;
+ tilePositionY -= tileHeight;
}
- priv->view.offset.base.y = off_y;
+ priv->view.offset.base.y = offsetY;
}
/**
* @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 item
* 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 r, last_col = priv->view.cols - 1;
- Evas_Coord tw = priv->view.tile.width;
- Evas_Coord th = priv->view.tile.height;
- Evas_Coord off_x = priv->view.offset.base.x + count * tw;
+ 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;
- Eina_Inlist** itr;
- Eina_Inlist** itr_end;
+ Eina_Inlist** iterator;
+ Eina_Inlist** iteratorEnd;
+ unsigned int baseColumn = lastColumn - count + 1;
+ Evas_Coord originX = x + baseColumn * tileWidth + offsetX;
- itr = priv->view.items;
- itr_end = itr + priv->view.rows;
- r = 0;
+ iterator = priv->view.items;
+ iteratorEnd = iterator + priv->view.rows;
+ row = 0;
- priv->model.base.col += count;
+ priv->model.base.column += count;
- for (; itr < itr_end; itr++, r++) {
- Evas_Coord ox = x + (last_col - count + 1) * tw + off_x;
- unsigned int i, c = last_col - count + 1;
+ for (; iterator < iteratorEnd; iterator++, row++) {
+ Evas_Coord tilePositionX = originX;
+ unsigned int column = baseColumn;
- for (i = 0; i < count; i++, c++, ox += tw) {
+ for (unsigned int i = 0; i < count; i++, column++, tilePositionX += tileWidth) {
Ewk_Tiled_Backing_Store_Item* it;
- it = EINA_INLIST_CONTAINER_GET(*itr, Ewk_Tiled_Backing_Store_Item);
- *itr = eina_inlist_demote(*itr, *itr);
+ it = EINA_INLIST_CONTAINER_GET(*iterator, Ewk_Tiled_Backing_Store_Item);
+ *iterator = eina_inlist_demote(*iterator, *iterator);
- _ewk_tiled_backing_store_item_move(it, ox, oy);
- _ewk_tiled_backing_store_item_fill(priv, it, c, r);
+ _ewk_tiled_backing_store_item_move(it, tilePositionX, oy);
+ _ewk_tiled_backing_store_item_fill(priv, it, column, row);
}
- oy += th;
+ oy += tileHeight;
}
- priv->view.offset.base.x = off_x;
+ priv->view.offset.base.x = offsetX;
}
/**
* @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 item
* is better to trigger full refill.
*
* @param count the number of times to repeat the process.
*/
static void _ewk_tiled_backing_store_view_wrap_right(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y, unsigned int count)
{
- unsigned int r;
- Evas_Coord tw = priv->view.tile.width;
- Evas_Coord th = priv->view.tile.height;
- Evas_Coord off_x = priv->view.offset.base.x - count * tw;
- Evas_Coord oy = y + priv->view.offset.base.y;
- Eina_Inlist** itr, ** itr_end;
+ unsigned int row;
+ 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 tilePositionY = y + priv->view.offset.base.y;
+ Eina_Inlist** iterator, ** iteratorEnd;
+ unsigned int baseColumn = count - 1;
+ Evas_Coord originX = x + baseColumn * tileWidth + offsetX;
- itr = priv->view.items;
- itr_end = itr + priv->view.rows;
- r = 0;
+ iterator = priv->view.items;
+ iteratorEnd = iterator + priv->view.rows;
+ row = 0;
- priv->model.base.col -= count;
+ priv->model.base.column -= count;
- for (; itr < itr_end; itr++, r++) {
- Evas_Coord ox = x + (count - 1) * tw + off_x;
- unsigned int i, c = count - 1;
+ for (; iterator < iteratorEnd; iterator++, row++) {
+ Evas_Coord tilePositionX = originX;
+ unsigned int column = baseColumn;
- for (i = 0; i < count; i++, c--, ox -= tw) {
- Ewk_Tiled_Backing_Store_Item* it;
- it = EINA_INLIST_CONTAINER_GET((*itr)->last, Ewk_Tiled_Backing_Store_Item);
- *itr = eina_inlist_promote(*itr, (*itr)->last);
+ for (unsigned int i = 0; i < count; i++, column--, tilePositionX -= tileWidth) {
+ Ewk_Tiled_Backing_Store_Item* item;
+ item = EINA_INLIST_CONTAINER_GET((*iterator)->last, Ewk_Tiled_Backing_Store_Item);
+ *iterator = eina_inlist_promote(*iterator, (*iterator)->last);
- _ewk_tiled_backing_store_item_move(it, ox, oy);
- _ewk_tiled_backing_store_item_fill(priv, it, c, r);
+ _ewk_tiled_backing_store_item_move(item, tilePositionX, tilePositionY);
+ _ewk_tiled_backing_store_item_fill(priv, item, column, row);
}
- oy += th;
+ tilePositionY += tileHeight;
}
- priv->view.offset.base.x = off_x;
+ priv->view.offset.base.x = offsetX;
}
static void _ewk_tiled_backing_store_view_refill(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y, int stepX, int stepY)
{
- Eina_Inlist** itr, **itr_end;
- Evas_Coord base_ox, oy, tw, th;
- unsigned int r;
+ Eina_Inlist** iterator, **iteratorEnd;
+ Evas_Coord baseTilePositionX, tilePositionY, tileWidth, tileHeight;
+ unsigned int request;
evas_object_move(priv->base.clipper, x, y);
- tw = priv->view.tile.width;
- th = priv->view.tile.height;
+ tileWidth = priv->view.tile.width;
+ tileHeight = priv->view.tile.height;
- base_ox = x + priv->view.offset.base.x;
- oy = y + priv->view.offset.base.y;
+ baseTilePositionX = x + priv->view.offset.base.x;
+ tilePositionY = y + priv->view.offset.base.y;
- itr = priv->view.items;
- itr_end = itr + priv->view.rows;
- r = 0;
+ iterator = priv->view.items;
+ iteratorEnd = iterator + priv->view.rows;
+ request = 0;
- priv->model.base.col -= stepX;
+ priv->model.base.column -= stepX;
priv->model.base.row -= stepY;
- for (; itr < itr_end; itr++, r++) {
- Ewk_Tiled_Backing_Store_Item* it;
- Evas_Coord ox = base_ox;
- unsigned int c = 0;
- EINA_INLIST_FOREACH(*itr, it) {
- _ewk_tiled_backing_store_item_fill(priv, it, c, r);
- _ewk_tiled_backing_store_item_move(it, ox, oy);
- c++;
- ox += tw;
+ for (; iterator < iteratorEnd; iterator++, request++) {
+ Ewk_Tiled_Backing_Store_Item* item;
+ Evas_Coord newTilePositionX = baseTilePositionX;
+ unsigned int count = 0;
+ EINA_INLIST_FOREACH(*iterator, item) {
+ _ewk_tiled_backing_store_item_fill(priv, item, count, request);
+ _ewk_tiled_backing_store_item_move(item, newTilePositionX, tilePositionY);
+ count++;
+ newTilePositionX += tileWidth;
}
- oy += th;
+ tilePositionY += tileHeight;
}
}
static void _ewk_tiled_backing_store_view_pos_apply(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y)
{
- Eina_Inlist** itr, **itr_end;
- Evas_Coord base_ox, oy, tw, th;
+ Eina_Inlist** iterator, **iteratorEnd;
+ Evas_Coord baseTilePositionX, baseTilePositionY, tileWidth, tileHeight;
#if ENABLE(TIZEN_SKIP_MOVING_WHILE_WEAK_ZOOMING)
int pos_x, pos_y, tile_width, tile_height;
#endif
evas_object_move(priv->base.clipper, x, y);
- tw = priv->view.tile.width;
- th = priv->view.tile.height;
+ tileWidth = priv->view.tile.width;
+ tileHeight = priv->view.tile.height;
- base_ox = x + priv->view.offset.base.x;
- oy = y + priv->view.offset.base.y;
+ baseTilePositionX = x + priv->view.offset.base.x;
+ baseTilePositionY = y + priv->view.offset.base.y;
- itr = priv->view.items;
- itr_end = itr + priv->view.rows;
- for (; itr < itr_end; itr++) {
- Ewk_Tiled_Backing_Store_Item* it;
- Evas_Coord ox = base_ox;
- EINA_INLIST_FOREACH(*itr, it) {
+ iterator = priv->view.items;
+ iteratorEnd = iterator + priv->view.rows;
+ for (; iterator < iteratorEnd; iterator++) {
+ Ewk_Tiled_Backing_Store_Item* item;
+ Evas_Coord ox = baseTilePositionX;
+ EINA_INLIST_FOREACH(*iterator, item) {
#if ENABLE(TIZEN_SKIP_MOVING_WHILE_WEAK_ZOOMING)
- if (it->tile) {
- evas_object_geometry_get(it->tile->image, &pos_x, &pos_y, &tile_width, &tile_height);
+ if (item->tile) {
+ evas_object_geometry_get(item->tile->image, &pos_x, &pos_y, &tile_width, &tile_height);
if (tile_width != priv->view.tile.width || tile_height != priv->view.tile.height) {
- _ewk_tiled_backing_store_item_move(it, it->geometry.x, it->geometry.y);
- _ewk_tiled_backing_store_item_resize(it, it->geometry.width, it->geometry.height);
+ _ewk_tiled_backing_store_item_move(item, item->geometry.x, item->geometry.y);
+ _ewk_tiled_backing_store_item_resize(item, item->geometry.width, item->geometry.height);
continue;
}
}
#endif
- _ewk_tiled_backing_store_item_move(it, ox, oy);
- ox += tw;
+ _ewk_tiled_backing_store_item_move(item, ox, baseTilePositionY);
+ ox += tileWidth;
}
- oy += th;
+ baseTilePositionY += tileHeight;
}
}
static void _ewk_tiled_backing_store_smart_calculate_offset_force(Ewk_Tiled_Backing_Store_Data* priv)
{
- Evas_Coord dx = priv->view.offset.cur.x - priv->view.offset.old.x;
- Evas_Coord dy = priv->view.offset.cur.y - priv->view.offset.old.y;
- Evas_Coord tw, th;
- int step_y, step_x;
+ 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("o=%p, offset: %+4d, %+4d (%+4d, %+4d)",
- priv->self, dx, dy, 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);
- tw = priv->view.tile.width;
- th = priv->view.tile.height;
+ tileWidth = priv->view.tile.width;
+ tileHeight = priv->view.tile.height;
- long new_col = -priv->view.offset.cur.x / tw;
- step_x = priv->model.base.col - new_col;
- long new_row = -priv->view.offset.cur.y / th;
- step_y = priv->model.base.row - new_row;
+ long newColumn = -priv->view.offset.current.x / tileWidth;
+ stepX = priv->model.base.column - newColumn;
+ 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->contents_clipper,
- priv->view.offset.cur.x + priv->view.x,
- priv->view.offset.cur.y + priv->view.y);
+ priv->contentsClipper,
+ priv->view.offset.current.x + priv->view.x,
+ priv->view.offset.current.y + priv->view.y);
- priv->view.offset.base.x += dx - step_x * tw;
- priv->view.offset.base.y += dy - step_y * th;
+ priv->view.offset.base.x += deltaX - stepX * tileWidth;
+ priv->view.offset.base.y += deltaY - stepY * tileHeight;
_ewk_tiled_backing_store_view_refill
- (priv, priv->view.x, priv->view.y, step_x, step_y);
+ (priv, priv->view.x, priv->view.y, stepX, stepY);
}
static void _ewk_tiled_backing_store_smart_calculate_offset(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y)
{
- Evas_Coord dx = priv->view.offset.cur.x - priv->view.offset.old.x;
- Evas_Coord dy = priv->view.offset.cur.y - priv->view.offset.old.y;
- Evas_Coord tw, th;
- int step_y, step_x;
+ 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("o=%p, offset: %+4d, %+4d (%+4d, %+4d)",
- priv->self, dx, dy, 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 (!dx && !dy)
+ if (!deltaX && !deltaY)
return;
- tw = priv->view.tile.width;
- th = priv->view.tile.height;
+ tileWidth = priv->view.tile.width;
+ tileHeight = priv->view.tile.height;
- long new_col = -priv->view.offset.cur.x / tw;
- step_x = priv->model.base.col - new_col;
- long new_row = -priv->view.offset.cur.y / th;
- step_y = priv->model.base.row - new_row;
+ long newCol = -priv->view.offset.current.x / tileWidth;
+ stepX = priv->model.base.column - newCol;
+ 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->contents_clipper,
- priv->view.offset.cur.x + priv->view.x,
- priv->view.offset.cur.y + priv->view.y);
+ priv->contentsClipper,
+ priv->view.offset.current.x + priv->view.x,
+ priv->view.offset.current.y + priv->view.y);
- if ((step_x < 0 && step_x <= -priv->view.cols)
- || (step_x > 0 && step_x >= priv->view.cols)
- || (step_y < 0 && step_y <= -priv->view.rows)
- || (step_y > 0 && step_y >= priv->view.rows)) {
+ 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)) {
- priv->view.offset.base.x += dx - step_x * tw;
- priv->view.offset.base.y += dy - step_y * th;
+ priv->view.offset.base.x += deltaX - stepX * tileWidth;
+ priv->view.offset.base.y += deltaY - stepY * tileHeight;
_ewk_tiled_backing_store_view_refill
- (priv, priv->view.x, priv->view.y, step_x, step_y);
+ (priv, priv->view.x, priv->view.y, stepX, stepY);
return;
}
- priv->view.offset.base.x += dx;
- priv->view.offset.base.y += dy;
+ priv->view.offset.base.x += deltaX;
+ priv->view.offset.base.y += deltaY;
- if (step_y < 0)
- _ewk_tiled_backing_store_view_wrap_up(priv, x, y, -step_y);
- else if (step_y > 0)
- _ewk_tiled_backing_store_view_wrap_down(priv, x, y, step_y);
+ if (stepY < 0)
+ _ewk_tiled_backing_store_view_wrap_up(priv, x, y, -stepY);
+ else if (stepY > 0)
+ _ewk_tiled_backing_store_view_wrap_down(priv, x, y, stepY);
- if (step_x < 0)
- _ewk_tiled_backing_store_view_wrap_left(priv, x, y, -step_x);
- else if (step_x > 0)
- _ewk_tiled_backing_store_view_wrap_right(priv, x, y, step_x);
+ if (stepX < 0)
+ _ewk_tiled_backing_store_view_wrap_left(priv, x, y, -stepX);
+ else if (stepX > 0)
+ _ewk_tiled_backing_store_view_wrap_right(priv, x, y, stepX);
_ewk_tiled_backing_store_view_pos_apply(priv, x, y);
}
priv->view.x = x;
priv->view.y = y;
evas_object_move(
- priv->contents_clipper,
- priv->view.offset.cur.x + priv->view.x,
- priv->view.offset.cur.y + priv->view.y);
+ priv->contentsClipper,
+ 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)
{
- Eina_Inlist* it;
+ Eina_Inlist* list;
Ewk_Tiled_Backing_Store_Item* item;
int i, j;
for (i = 0; i < priv->view.rows; i++) {
- it = priv->view.items[i];
+ list = priv->view.items[i];
j = 0;
- EINA_INLIST_FOREACH(it, item)
+ EINA_INLIST_FOREACH(list, item)
_ewk_tiled_backing_store_item_fill(priv, item, j++, i);
}
}
-static void _ewk_tiled_backing_store_smart_calculate(Evas_Object* ewkTile)
+static void _ewk_tiled_backing_store_smart_calculate(Evas_Object* ewkBackingStore)
{
- Evas_Coord x, y, w, h;
+ Evas_Coord x, y, width, height;
- evas_object_geometry_get(ewkTile, &x, &y, &w, &h);
- DBG("o=%p at %d,%d + %dx%d", ewkTile, x, y, w, h);
+ evas_object_geometry_get(ewkBackingStore, &x, &y, &width, &height);
+ DBG("ewkBackingStore%p at %d,%d + %dx%d", ewkBackingStore, x, y, width, height);
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
#if ENABLE(TIZEN_FIX_EMAIL_ONE_TILE_DISPLAY)
#if ENABLE(TIZEN_TILE_MATRIX_LIST)
- if (priv->changed.need_layout && priv->changed.layout)
- priv->changed.need_layout = EINA_FALSE;
+ if (priv->changed.needLayout && priv->changed.layout)
+ priv->changed.needLayout = EINA_FALSE;
#endif
#endif
- priv->changed.any = EINA_FALSE;
+ priv->changed.any = false;
#if ENABLE(TIZEN_CTBS_ZOOMING_FIX)
Eina_Bool zoom_set = (priv->changed.size && priv->changed.model);
#endif
#if ENABLE(TIZEN_CLEAN_AFTER_RELAYOUT_FIX)
// Do some cleaning
// This fixes issue with old tiles being visible after screen orientation change.
- Ewk_Tile_Unused_Cache *tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
- ewk_tile_unused_cache_unlock_area(tuc);
- ewk_tile_unused_cache_clear(tuc);
-
+ Ewk_Tile_Unused_Cache *tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+ ewk_tile_unused_cache_unlock_area(tileUnusedCache);
+ ewk_tile_unused_cache_clear(tileUnusedCache);
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
_ewk_tiled_backing_store_pre_render_request_flush(priv);
#endif
#else
if (!priv->render.suspend && priv->changed.model) {
#endif
- unsigned long cols, rows;
+ unsigned long columns, rows;
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
float scale = 1.0;
if (priv->view.tile.enable_scale)
scale = priv->view.tile.zoom;
- cols = priv->model.width * scale / priv->view.tile.width + 1;
+ columns = priv->model.width * scale / priv->view.tile.width + 1;
rows = priv->model.height * scale / priv->view.tile.height + 1;
#else
- cols = priv->model.width / priv->view.tile.width + 1;
+ columns = priv->model.width / priv->view.tile.width + 1;
rows = priv->model.height / priv->view.tile.height + 1;
#endif
- priv->model.old.cols = priv->model.cur.cols;
- priv->model.old.rows = priv->model.cur.rows;
- priv->model.cur.cols = cols;
- priv->model.cur.rows = rows;
- if (priv->model.old.cols > cols)
- cols = priv->model.old.cols;
+ priv->model.old.columns = priv->model.current.columns;
+ priv->model.old.rows = priv->model.current.rows;
+ priv->model.current.columns = columns;
+ priv->model.current.rows = rows;
+ if (priv->model.old.columns > columns)
+ columns = priv->model.old.columns;
if (priv->model.old.rows > rows)
rows = priv->model.old.rows;
- ewk_tile_matrix_resize(priv->model.matrix, cols, rows);
+ ewk_tile_matrix_resize(priv->model.matrix, columns, rows);
}
- if (priv->changed.pos && (priv->view.x != x || priv->view.y != y)) {
+ if (priv->changed.position && (priv->view.x != x || priv->view.y != y)) {
_ewk_tiled_backing_store_smart_calculate_pos(priv, x, y);
- priv->changed.pos = EINA_FALSE;
+ priv->changed.position = false;
}
if (priv->changed.offset) {
_ewk_tiled_backing_store_smart_calculate_offset(priv, x, y);
- priv->changed.offset = EINA_FALSE;
+ priv->changed.offset = false;
}
if (priv->changed.size) {
- _ewk_tiled_backing_store_smart_calculate_size(priv, w, h);
- priv->changed.size = EINA_FALSE;
+ _ewk_tiled_backing_store_smart_calculate_size(priv, width, height);
+ priv->changed.size = false;
}
#if ENABLE(TIZEN_TILE_MATRIX_LIST)
rect.h = priv->model.height;
_ewk_tiled_backing_store_fill_renderers(priv);
ewk_tile_matrix_resize(priv->model.matrix,
- priv->model.cur.cols,
- priv->model.cur.rows);
+ priv->model.current.columns,
+ priv->model.current.rows);
priv->changed.model = EINA_FALSE;
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
if (priv->view.tile.enable_scale)
scale = priv->view.tile.zoom;
evas_object_resize(
- priv->contents_clipper,
+ priv->contentsClipper,
priv->model.width * scale,
priv->model.height * scale);
#else
- evas_object_resize(priv->contents_clipper, priv->model.width, priv->model.height);
+ evas_object_resize(priv->contentsClipper, priv->model.width, priv->model.height);
#endif
_ewk_tiled_backing_store_smart_calculate_offset_force(priv);
}
|| 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);
#if ENABLE(TIZEN_CTBS_ZOOMING_FIX)
if (zoom_set)
- evas_object_smart_callback_call(ewkTile, "zoom,set", (void *)&priv->view.tile.zoom);
+ evas_object_smart_callback_call(ewkBackingStore, "zoom,set", (void *)&priv->view.tile.zoom);
#endif
}
static Eina_Bool _ewk_tiled_backing_store_selective_render_pan_cb(void *data)
{
Ewk_Tiled_Backing_Store_Data *priv = (Ewk_Tiled_Backing_Store_Data *)data;
- priv->render.selective_render.render_on_next = EINA_TRUE;
+ priv->render.selectiveRender.renderOnNext = EINA_TRUE;
_ewk_tiled_backing_store_updates_process(priv);
return ECORE_CALLBACK_RENEW;
}
-Eina_Bool ewk_tiled_backing_store_selective_rendering_set(Evas_Object *o, Eina_Bool value)
+Eina_Bool ewk_tiled_backing_store_selective_rendering_set(Evas_Object *ewkBackingStore, Eina_Bool value)
{
- PRIV_DATA_GET_OR_RETURN(o, priv, EINA_FALSE);
- if (priv->render.selective_render.enabled == value)
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, EINA_FALSE);
+ if (priv->render.selectiveRender.enabled == value)
return EINA_FALSE;
- priv->render.selective_render.enabled = value;
- priv->render.selective_render.render_on_next = value;
+ priv->render.selectiveRender.enabled = value;
+ priv->render.selectiveRender.renderOnNext = value;
if (value) {
- if (!priv->render.selective_render.idler_enterer)
- priv->render.selective_render.idler_enterer = ecore_idle_enterer_add(_ewk_tiled_backing_store_selective_render_pan_cb, priv);
+ if (!priv->render.selectiveRender.idlerEnterer)
+ priv->render.selectiveRender.idlerEnterer = ecore_idle_enterer_add(_ewk_tiled_backing_store_selective_render_pan_cb, priv);
} else {
- _ewk_tiled_backing_store_free_cb(o);
+ _ewk_tiled_backing_store_free_cb(ewkBackingStore);
// Fix for the new tab creation bug when user set the both default page setting and fast rendering mode on : MAR-08-2011
// Must make sure whether this can cause additional tile drawing or not
ewk_tile_matrix_updates_process(priv->model.matrix);
return EINA_TRUE;
}
-Eina_Bool ewk_tiled_backing_store_selective_rendering_is_enabled(Evas_Object *o)
+Eina_Bool ewk_tiled_backing_store_selective_rendering_is_enabled(Evas_Object *ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(o, priv, EINA_FALSE);
- return priv->render.selective_render.enabled;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, EINA_FALSE);
+ return priv->render.selectiveRender.enabled;
}
#endif
return evas_object_smart_add(canvas, smart);
}
-void ewk_tiled_backing_store_render_cb_set(Evas_Object* ewkTile, Eina_Bool (*callback)(void* data, Ewk_Tile* tile, const Eina_Rectangle* area), const void* data)
+void ewk_tiled_backing_store_render_cb_set(Evas_Object* ewkBackingStore, Eina_Bool (*callback)(void* data, Ewk_Tile* tile, const Eina_Rectangle* area), const void* data)
{
EINA_SAFETY_ON_NULL_RETURN(callback);
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
- priv->render.cb = callback;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ priv->render.callback = callback;
priv->render.data = (void*)data;
}
-Ewk_Tile_Unused_Cache* ewk_tiled_backing_store_tile_unused_cache_get(const Evas_Object* ewkTile)
+Ewk_Tile_Unused_Cache* ewk_tiled_backing_store_tile_unused_cache_get(const Evas_Object* ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv, 0);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, 0);
return ewk_tile_matrix_unused_cache_get(priv->model.matrix);
}
-void ewk_tiled_backing_store_tile_unused_cache_set(Evas_Object* ewkTile, Ewk_Tile_Unused_Cache* tileUnusedCache)
+void ewk_tiled_backing_store_tile_unused_cache_set(Evas_Object* ewkBackingStore, Ewk_Tile_Unused_Cache* tileUnusedCache)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
if (ewk_tile_matrix_unused_cache_get(priv->model.matrix) == tileUnusedCache)
return;
#if ENABLE(TIZEN_TILED_GLOBAL_CACHE_MANAGEMENT)
if (evas_object_evas_get(priv->self) != ewk_tile_unused_cache_get_evas(tileUnusedCache)) {
- ERR("CTBS: can not set cache (%p) to webview (%p) due to diffrent evas object.", tileUnusedCache, ewkTile);
+ ERR("CTBS: can not set cache (%p) to webview (%p) due to diffrent evas object.", tileUnusedCache, ewkBackingStore);
return;
}
#endif
{
/* TODO: check offset go out of bounds, clamp */
if (priv->render.disabled)
- return EINA_FALSE;
+ 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 = EINA_TRUE;
+ priv->changed.offset = true;
_ewk_tiled_backing_store_changed(priv);
- return EINA_TRUE;
+ return true;
}
-Eina_Bool ewk_tiled_backing_store_scroll_full_offset_set(Evas_Object* ewkTile, Evas_Coord x, Evas_Coord y)
+Eina_Bool ewk_tiled_backing_store_scroll_full_offset_set(Evas_Object* ewkBackingStore, Evas_Coord x, Evas_Coord y)
{
- DBG("o=%p, x=%d, y=%d", ewkTile, x, y);
+ DBG("ewkBackingStore%p, x=%d, y=%d", ewkBackingStore, x, y);
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE);
- if (x == priv->view.offset.cur.x && y == priv->view.offset.cur.y)
- return EINA_TRUE;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false);
+ 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);
}
-Eina_Bool ewk_tiled_backing_store_scroll_full_offset_add(Evas_Object* ewkTile, Evas_Coord dx, Evas_Coord dy)
+Eina_Bool ewk_tiled_backing_store_scroll_full_offset_add(Evas_Object* ewkBackingStore, Evas_Coord deltaX, Evas_Coord deltaY)
{
- DBG("o=%p, dx=%d, dy=%d", ewkTile, dx, dy);
+ DBG("ewkBackingStore%p, deltaX=%d, deltaY=%d", ewkBackingStore, deltaX, deltaY);
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE);
- if (!dx && !dy)
- return EINA_TRUE;
+ 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 + dx, priv->view.offset.cur.y + dy);
+ (priv, priv->view.offset.current.x + deltaX, priv->view.offset.current.y + deltaY);
}
#if ENABLE(TIZEN_TILE_SIZE_SET)
static void _ewk_tiled_backing_store_flush_tiles(Ewk_Tiled_Backing_Store_Data *priv)
{
- Ewk_Tile_Unused_Cache *tuc;
-#if ENABLE(TIZEN_REPAINT_IDLER)
- _ewk_tiled_backing_store_restore_idler_timer_stop(priv);
- _ewk_tiled_backing_store_process_requests_flush(priv);
- _ewk_tiled_backing_store_update_add_flush(priv);
-#endif
+ Ewk_Tile_Unused_Cache *tileUnusedCache;
_ewk_tiled_backing_store_pre_render_request_flush(priv);
_ewk_tiled_backing_store_tile_dissociate_all(priv);
- tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
- ewk_tile_unused_cache_clear(tuc);
+ tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+ ewk_tile_unused_cache_clear(tileUnusedCache);
}
static void _ewk_tiled_backing_store_recalc_and_reposition_renderers(Ewk_Tiled_Backing_Store_Data *priv)
_ewk_tiled_backing_store_recalc_renderers(
priv, w, h, priv->view.tile.width, priv->view.tile.height);
- Evas_Coord base_ox, oy, tw, th;
- unsigned int r;
- Eina_Inlist **itr, **itr_end;
+ Evas_Coord base_ox, oy, tileWidth, tileHeight;
+ unsigned int request;
+ Eina_Inlist **iterator, **iteratorEnd;
- tw = priv->view.tile.width;
- th = priv->view.tile.height;
+ tileWidth = priv->view.tile.width;
+ tileHeight = priv->view.tile.height;
- priv->model.base.row = -priv->view.offset.cur.y / th;
- priv->model.base.col = -priv->view.offset.cur.x / tw;
- priv->view.offset.base.x = priv->view.offset.cur.x % tw;
- priv->view.offset.base.y = priv->view.offset.cur.y % th;
+ priv->model.base.row = -priv->view.offset.current.y / tileHeight;
+ priv->model.base.column = -priv->view.offset.current.x / tileWidth;
+ priv->view.offset.base.x = priv->view.offset.current.x % tileWidth;
+ priv->view.offset.base.y = priv->view.offset.current.y % tileHeight;
base_ox = x + priv->view.offset.base.x;
oy = y + priv->view.offset.base.y;
- itr = priv->view.items;
- itr_end = itr + priv->view.rows;
- r = 0;
+ iterator = priv->view.items;
+ iteratorEnd = iterator + priv->view.rows;
+ request = 0;
- for (; itr < itr_end; itr++, r++) {
- Ewk_Tiled_Backing_Store_Item *it;
+ for (; iterator < iteratorEnd; iterator++, request++) {
+ Ewk_Tiled_Backing_Store_Item *item;
Evas_Coord ox = base_ox;
unsigned int c = 0;
- EINA_INLIST_FOREACH(*itr, it) {
- _ewk_tiled_backing_store_item_fill(priv, it, c, r);
- _ewk_tiled_backing_store_item_move(it, ox, oy);
- _ewk_tiled_backing_store_item_resize(it, tw, th);
+ EINA_INLIST_FOREACH(*iterator, item) {
+ _ewk_tiled_backing_store_item_fill(priv, item, c, request);
+ _ewk_tiled_backing_store_item_move(item, ox, oy);
+ _ewk_tiled_backing_store_item_resize(item, tileWidth, tileHeight);
c++;
- ox += tw;
+ ox += tileWidth;
}
- oy += th;
+ oy += tileHeight;
}
}
#endif
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
float multiplier = 1.0;
#endif
- *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) < ZOOM_STEP_MIN) {
DBG("ignored as zoom difference is < %f: %f",
(double)ZOOM_STEP_MIN, fabsf(priv->view.tile.zoom - *zoom));
#if ENABLE(TIZEN_ZOOM_SET_INTERNAL_FIX)
-/* We don't want to return here as we want to emit 'zoom,set' signal even if there were no zoom changes.
+/* We don'tile want to return here as we want to emit 'zoom,set' signal even if there were no zoom changes.
Behavior similar to tbs1 */
#else
- return EINA_TRUE;
+ return true;
#endif
}
-#if !ENABLE(TIZEN_LOCAL_DIFF)
+#if !ENABLE(TIZEN_TILE_BASECODE)
_ewk_tiled_backing_store_pre_render_request_flush(priv);
#endif
- Evas_Coord tw, th;
+ Evas_Coord tileWidth, tileHeight;
*zoom = ROUNDED_ZOOM(priv->view.tile.width, *zoom);
- tw = priv->view.tile.width;
- th = priv->view.tile.height;
+ tileWidth = priv->view.tile.width;
+ tileHeight = priv->view.tile.height;
float scale = *zoom / priv->view.tile.zoom;
priv->view.tile.zoom = *zoom;
// todo: check currentX [0, w]...
- priv->view.offset.zoom_center.x = currentX;
- priv->view.offset.zoom_center.y = currentY;
+ priv->view.offset.zoomCenter.x = currentX;
+ priv->view.offset.zoomCenter.y = currentY;
#if ENABLE(TIZEN_REMOVE_ONE_REMAIN_TILE)
if (!priv->view.width || !priv->view.height)
priv->view.offset.base.y = 0;
return EINA_TRUE;
}
- Eina_Inlist** itr, **itr_end;
- Ewk_Tiled_Backing_Store_Item* it;
+ Eina_Inlist** iterator, **iteratorEnd;
+ Ewk_Tiled_Backing_Store_Item* item;
- Evas_Coord new_x = currentX + (priv->view.offset.cur.x - currentX) * scale;
- Evas_Coord new_y = 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;
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
- Evas_Coord model_w;
- Evas_Coord model_h;
+ Evas_Coord modelWidth;
+ Evas_Coord modelHeight;
if (priv->view.tile.enable_scale) {
multiplier = priv->view.tile.zoom;
- model_w = priv->model.width * multiplier;
- model_h = priv->model.height * multiplier;
+ modelWidth = priv->model.width * multiplier;
+ modelHeight = priv->model.height * multiplier;
} else {
- model_w = priv->model.width * scale;
- model_h = priv->model.height * scale;
+ modelWidth = priv->model.width * scale;
+ modelHeight = priv->model.height * scale;
}
- evas_object_resize(priv->contents_clipper,
+ evas_object_resize(priv->contentsClipper,
priv->model.width * multiplier,
priv->model.height * multiplier);
#else
- Evas_Coord model_w = priv->model.width * scale;
- Evas_Coord model_h = priv->model.height * scale;
+ Evas_Coord modelWidth = priv->model.width * scale;
+ Evas_Coord modelHeight = priv->model.height * scale;
#endif
- if (model_w < priv->view.width || new_x >= 0)
- new_x = 0;
- else if (-new_x + priv->view.width >= model_w)
- new_x = -model_w + priv->view.width;
+ if (modelWidth < priv->view.width || newX >= 0)
+ newX = 0;
+ else if (-newX + priv->view.width >= modelWidth)
+ newX = -modelWidth + priv->view.width;
- if (model_h < priv->view.height || new_y >= 0)
- new_y = 0;
- else if (-new_y + priv->view.height >= model_h)
- new_y = -model_h + priv->view.height;
+ if (modelHeight < priv->view.height || newY >= 0)
+ newY = 0;
+ else if (-newY + priv->view.height >= modelHeight)
+ newY = -modelHeight + priv->view.height;
- priv->model.base.col = - new_x / tw;
- priv->model.base.row = - new_y / th;
+ priv->model.base.column = - newX / tileWidth;
+ priv->model.base.row = - newY / tileHeight;
- priv->changed.size = EINA_TRUE;
- priv->changed.model = EINA_TRUE;
+ priv->changed.size = true;
+ priv->changed.model = true;
_ewk_tiled_backing_store_changed(priv);
- priv->view.offset.cur.x = new_x;
- priv->view.offset.cur.y = new_y;
- priv->view.offset.base.x = new_x % tw;
- priv->view.offset.base.y = new_y % th;
+ priv->view.offset.current.x = newX;
+ priv->view.offset.current.y = newY;
+ priv->view.offset.base.x = newX % tileWidth;
+ priv->view.offset.base.y = newY % tileHeight;
- 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->contents_clipper,
- new_x + priv->view.x,
- new_y + priv->view.y);
+ priv->contentsClipper,
+ newX + priv->view.x,
+ newY + priv->view.y);
_ewk_tiled_backing_store_fill_renderers(priv);
- Evas_Coord oy = priv->view.offset.base.y + priv->view.y;
- Evas_Coord base_ox = priv->view.x + priv->view.offset.base.x;
+ Evas_Coord tilePositionY = priv->view.offset.base.y + priv->view.y;
+ Evas_Coord baseTilePositionX = priv->view.x + priv->view.offset.base.x;
- itr = priv->view.items;
- itr_end = itr + priv->view.rows;
+ iterator = priv->view.items;
+ iteratorEnd = iterator + priv->view.rows;
- for (; itr < itr_end; itr++) {
- Evas_Coord ox = base_ox;
- Eina_Inlist* lst = *itr;
+ for (; iterator < iteratorEnd; iterator++) {
+ Evas_Coord tilePositionX = baseTilePositionX;
+ Eina_Inlist* lst = *iterator;
- EINA_INLIST_FOREACH(lst, it) {
- _ewk_tiled_backing_store_item_move(it, ox, oy);
- _ewk_tiled_backing_store_item_resize(it, tw, th);
- ox += tw;
+ 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;
}
- oy += th;
+ tilePositionY += tileHeight;
}
-#if ENABLE(TIZEN_REPAINT_IDLER)
- priv->render.next_no_idler = EINA_TRUE;
-#endif
return EINA_TRUE;
}
-#if ENABLE(TIZEN_REPAINT_IDLER)
-Eina_Bool _ewk_tiled_backing_store_restore_idler_cb(void *data)
+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)
{
- Ewk_Tiled_Backing_Store_Data *priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(data);
- priv->render.on_idler_disabled = EINA_FALSE;
- priv->render.restore_idler_timer = NULL;
+ DBG("ewkBackingStore%p, zoom=%f", ewkBackingStore, *zoom);
- return EINA_FALSE;
-}
-
-void _ewk_tiled_backing_store_restore_idler_timer_reset(Ewk_Tiled_Backing_Store_Data *priv)
-{
- if (priv->render.restore_idler_timer)
- ecore_timer_del(priv->render.restore_idler_timer);
-
- priv->render.restore_idler_timer = ecore_timer_add(
- THRESHOLD_ANIM_TIME, _ewk_tiled_backing_store_restore_idler_cb, priv);
-}
-
-void _ewk_tiled_backing_store_restore_idler_timer_stop(Ewk_Tiled_Backing_Store_Data *priv)
-{
- if (!priv->render.restore_idler_timer)
- return;
-
- priv->render.on_idler_disabled = EINA_FALSE;
- ecore_timer_del(priv->render.restore_idler_timer);
- priv->render.restore_idler_timer = NULL;
-}
-#endif
-
-Eina_Bool ewk_tiled_backing_store_zoom_set(Evas_Object* ewkTile, float* zoom, Evas_Coord currentX, Evas_Coord currentY, Evas_Coord* offsetX, Evas_Coord* offsetY)
-{
- DBG("o=%p, zoom=%f", ewkTile, *zoom);
-
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false);
#if ENABLE(TIZEN_NO_TILE_CREATION_OVER_THE_LIMIT)
Eina_Bool ret = EINA_FALSE;
Eina_Bool pre_suspend_value = priv->render.suspend;
#if ENABLE(TIZEN_SELECTIVE_RENDERING)
- Eina_Bool pre_selective_render_value = priv->render.selective_render.enabled;
- priv->render.selective_render.enabled = EINA_FALSE;
+ Eina_Bool pre_selective_render_value = priv->render.selectiveRender.enabled;
+ priv->render.selectiveRender.enabled = EINA_FALSE;
#endif
priv->render.suspend = EINA_TRUE;
priv->render.suspend = pre_suspend_value;
#if ENABLE(TIZEN_SELECTIVE_RENDERING)
- priv->render.selective_render.enabled = pre_selective_render_value;
+ priv->render.selectiveRender.enabled = pre_selective_render_value;
#endif
return ret;
#else
#endif
}
-#if ENABLE(TIZEN_ZOOM_BOUNCE)
+#if ENABLE(TIZEN_BG_RECT_SUPPORT)
static Evas_Coord _ewk_tiled_backing_store_bounce_start_get(Evas_Coord val1, Evas_Coord val2)
{
return val1 < val2 ? val1 : val2;
}
-static void _ewk_tiled_backing_store_bounce_rect(Evas_Object * o, Evas_Object * bg_rect, Evas_Coord content_x, Evas_Coord content_y, Evas_Coord content_w, Evas_Coord content_h)
+static void _ewk_tiled_backing_store_bounce_rect(Evas_Object * ewkBackingStore, Evas_Object * bg_rect, Evas_Coord content_x, Evas_Coord content_y, Evas_Coord content_w, Evas_Coord content_h)
{
Evas_Coord view_x, view_y, view_w, view_h;
- evas_object_geometry_get(o, &view_x, &view_y, &view_w, &view_h);
+ evas_object_geometry_get(ewkBackingStore, &view_x, &view_y, &view_w, &view_h);
float view_w_h_ratio = (float)view_h / (float)view_w;
float content_w_h_ratio = (float)content_h / (float)content_w;
#endif
-void ewk_tiled_backing_store_fix_offsets(Evas_Object* ewkTile, Evas_Coord width, Evas_Coord height)
+void ewk_tiled_backing_store_fix_offsets(Evas_Object* ewkBackingStore, Evas_Coord width, Evas_Coord height)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
- Eina_Inlist** itr, **itr_end;
- Ewk_Tiled_Backing_Store_Item* it;
- Evas_Coord new_x = priv->view.offset.cur.x;
- Evas_Coord new_y = priv->view.offset.cur.y;
- Evas_Coord bx = priv->view.offset.base.x;
- Evas_Coord by = priv->view.offset.base.y;
- Evas_Coord tw = priv->view.tile.width;
- Evas_Coord th = priv->view.tile.height;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ Eina_Inlist** iterator, **iteratorEnd;
+ Ewk_Tiled_Backing_Store_Item* item;
+ 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;
+ Evas_Coord tileHeight = priv->view.tile.height;
- if (-new_x > width) {
- new_x = -width;
- bx = new_x % tw;
- priv->model.base.col = -new_x / tw;
+ if (-newX > width) {
+ newX = -width;
+ baseX = newX % tileWidth;
+ priv->model.base.column = -newX / tileWidth;
}
- if (-new_y > height) {
- new_y = -height;
- by = new_y % th;
- priv->model.base.row = -new_y / th;
+ if (-newY > height) {
+ newY = -height;
+ baseY = newY % tileHeight;
+ priv->model.base.row = -newY / tileHeight;
}
- if (bx >= 0 || bx <= -2 * priv->view.tile.width) {
- bx = new_x % tw;
- priv->model.base.col = -new_x / tw;
+ if (baseX >= 0 || baseX <= -2 * priv->view.tile.width) {
+ baseX = newX % tileWidth;
+ priv->model.base.column = -newX / tileWidth;
}
- if (by >= 0 || by <= -2 * priv->view.tile.height) {
- by = new_y % th;
- priv->model.base.row = -new_y / th;
+ if (baseY >= 0 || baseY <= -2 * priv->view.tile.height) {
+ baseY = newY % tileHeight;
+ priv->model.base.row = -newY / tileHeight;
}
- priv->view.offset.cur.x = new_x;
- priv->view.offset.cur.y = new_y;
- priv->view.offset.old.x = new_x;
- priv->view.offset.old.y = new_y;
- priv->view.offset.base.x = bx;
- priv->view.offset.base.y = by;
- evas_object_move(priv->contents_clipper,
- new_x + priv->view.x,
- new_y + priv->view.y);
+ 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;
+ priv->view.offset.base.y = baseY;
+ evas_object_move(priv->contentsClipper,
+ newX + priv->view.x,
+ newY + priv->view.y);
- Evas_Coord oy = priv->view.offset.base.y + priv->view.y;
- Evas_Coord base_ox = priv->view.x + priv->view.offset.base.x;
+ Evas_Coord tilePositionY = priv->view.offset.base.y + priv->view.y;
+ Evas_Coord baseTilePositionX = priv->view.x + priv->view.offset.base.x;
- itr = priv->view.items;
- itr_end = itr + priv->view.rows;
+ iterator = priv->view.items;
+ iteratorEnd = iterator + priv->view.rows;
- for (; itr < itr_end; itr++) {
- Evas_Coord ox = base_ox;
- Eina_Inlist* lst = *itr;
+ for (; iterator < iteratorEnd; iterator++) {
+ Evas_Coord tilePositionX = baseTilePositionX;
+ Eina_Inlist* lst = *iterator;
- EINA_INLIST_FOREACH(lst, it) {
- _ewk_tiled_backing_store_item_move(it, ox, oy);
- _ewk_tiled_backing_store_item_resize(it, tw, th);
- ox += tw;
+ 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;
}
- oy += th;
+ tilePositionY += tileHeight;
}
}
#if ENABLE(TIZEN_TILED_VIEW_BG_COLOR_SET)
-void ewk_tiled_backing_store_bg_color_set(Evas_Object *o, Eina_Bool has_alpha)
+void ewk_tiled_backing_store_bg_color_set(Evas_Object *ewkBackingStore, Eina_Bool hasAlpha)
{
- PRIV_DATA_GET_OR_RETURN(o, priv);
- priv->view.tile.has_alpha = has_alpha;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ priv->view.tile.hasAlpha = hasAlpha;
}
#endif
-Eina_Bool ewk_tiled_backing_store_update(Evas_Object* ewkTile, const Eina_Rectangle* update)
+Eina_Bool ewk_tiled_backing_store_update(Evas_Object* ewkBackingStore, const Eina_Rectangle* update)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false);
if (priv->render.disabled)
- return EINA_FALSE;
+ return false;
-#if ENABLE(TIZEN_REPAINT_IDLER)
- // If we still have some unprocessed requests, change to immediate mode, since it's probably an animation.
- if (priv->render.process_requests) {
- priv->render.on_idler_disabled = EINA_TRUE;
- _ewk_tiled_backing_store_process_requests_flush(priv);
- _ewk_tiled_backing_store_update_add_process(priv);
- _ewk_tiled_backing_store_restore_idler_timer_reset(priv);
- }
-#endif
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
return ewk_tile_matrix_update(priv->model.matrix, update,
priv->view.tile.zoom,
#endif
}
-void ewk_tiled_backing_store_updates_process_pre_set(Evas_Object* ewkTile, void* (*callback)(void* data, Evas_Object *ewkTile), const void* data)
+void ewk_tiled_backing_store_updates_process_pre_set(Evas_Object* ewkBackingStore, void* (*callback)(void* data, Evas_Object *ewkBackingStore), const void* data)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
- priv->process.pre_cb = callback;
- priv->process.pre_data = (void*)data;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ priv->process.preCallback = callback;
+ priv->process.preData = (void*)data;
}
-void ewk_tiled_backing_store_updates_process_post_set(Evas_Object* ewkTile, void* (*callback)(void* data, void* pre_data, Evas_Object *ewkTile), const void* data)
+void ewk_tiled_backing_store_updates_process_post_set(Evas_Object* ewkBackingStore, void* (*callback)(void* data, void* preData, Evas_Object *ewkBackingStore), const void* data)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
- priv->process.post_cb = callback;
- priv->process.post_data = (void*)data;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ priv->process.postCallback = callback;
+ priv->process.postData = (void*)data;
}
-void ewk_tiled_backing_store_updates_process(Evas_Object* ewkTile)
+void ewk_tiled_backing_store_updates_process(Evas_Object* ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
_ewk_tiled_backing_store_updates_process(priv);
}
-void ewk_tiled_backing_store_updates_clear(Evas_Object* ewkTile)
+void ewk_tiled_backing_store_updates_clear(Evas_Object* ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
ewk_tile_matrix_updates_clear(priv->model.matrix);
}
-void ewk_tiled_backing_store_contents_resize(Evas_Object* ewkTile, Evas_Coord width, Evas_Coord height)
+void ewk_tiled_backing_store_contents_resize(Evas_Object* ewkBackingStore, Evas_Coord width, Evas_Coord height)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
#if ENABLE(TIZEN_FIX_EMAIL_ONE_TILE_DISPLAY)
if (width == priv->model.width && height == priv->model.height) {
- priv->changed.need_layout = EINA_TRUE;
+ priv->changed.needLayout = EINA_TRUE;
return;
}
#else
priv->model.width = width;
priv->model.height = height;
-#if !ENABLE(TIZEN_LOCAL_DIFF)
- priv->changed.model = EINA_TRUE;
+#if !ENABLE(TIZEN_TILE_BASECODE)
+ priv->changed.model = true;
#endif
#if ENABLE(TIZEN_TILE_MATRIX_LIST)
- priv->changed.layout = EINA_TRUE;
+ priv->changed.layout = true;
#endif
DBG("w,h=%d, %d", width, height);
#if ENABLE(TIZEN_CTBS_UPDATE_AFTER_CONTENTS_RESIZE)
// without below code http://limpid.nl/lab/css/fixed/ is not rendered properly
// We call whole backing store update when contents resize
- Eina_Rectangle r = {0, 0, width, height};
- ewk_tiled_backing_store_update(ewkTile, &r);
+ Eina_Rectangle request = {0, 0, width, height};
+ ewk_tiled_backing_store_update(ewkBackingStore, &request);
#endif
_ewk_tiled_backing_store_changed(priv);
}
-void ewk_tiled_backing_store_disabled_update_set(Evas_Object* ewkTile, Eina_Bool value)
+void ewk_tiled_backing_store_disabled_update_set(Evas_Object* ewkBackingStore, Eina_Bool value)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
if (value != priv->render.disabled)
priv->render.disabled = value;
}
#if ENABLE(TIZEN_FIX_RSS_IMAGE_DISPLAY)
-Eina_Bool ewk_tiled_backing_store_disabled_update_get(Evas_Object *o)
+Eina_Bool ewk_tiled_backing_store_disabled_update_get(Evas_Object *ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(o, priv, EINA_FALSE);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, EINA_FALSE);
return priv->render.disabled;
}
#endif
-void ewk_tiled_backing_store_flush(Evas_Object* ewkTile)
+void ewk_tiled_backing_store_flush(Evas_Object* ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
- Ewk_Tile_Unused_Cache* tuc = 0;
+ 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;
priv->view.offset.base.y = 0;
- priv->model.base.col = 0;
+ priv->model.base.column = 0;
priv->model.base.row = 0;
- priv->model.cur.cols = 1;
- priv->model.cur.rows = 1;
- priv->model.old.cols = 0;
+ priv->model.current.columns = 1;
+ priv->model.current.rows = 1;
+ priv->model.old.columns = 0;
priv->model.old.rows = 0;
- priv->changed.size = EINA_TRUE;
+ priv->changed.size = true;
#ifdef DEBUG_MEM_LEAKS
printf("\nFLUSHED BACKING STORE, STATUS BEFORE DELETING TILE MATRIX:\n");
#if ENABLE(TIZEN_FIX_EMAIL_ONE_TILE_DISPLAY)
#if ENABLE(TIZEN_TILE_MATRIX_LIST)
- if (priv->changed.need_layout) {
+ if (priv->changed.needLayout) {
priv->changed.layout = EINA_TRUE;
- priv->changed.need_layout = EINA_FALSE;
+ priv->changed.needLayout = EINA_FALSE;
}
#endif
#endif
-#if ENABLE(TIZEN_REPAINT_IDLER)
- _ewk_tiled_backing_store_restore_idler_timer_stop(priv);
- _ewk_tiled_backing_store_process_requests_flush(priv);
- _ewk_tiled_backing_store_update_add_flush(priv);
-#endif
-
_ewk_tiled_backing_store_pre_render_request_flush(priv);
_ewk_tiled_backing_store_tile_dissociate_all(priv);
- tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
-#if ENABLE(TIZEN_LOCAL_DIFF)
- ewk_tile_unused_cache_ref(tuc);
+ tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+#if ENABLE(TIZEN_TILE_BASECODE)
+ ewk_tile_unused_cache_ref(tileUnusedCache);
ewk_tile_matrix_free(priv->model.matrix);
#else
- ewk_tile_unused_cache_clear(tuc);
+ ewk_tile_unused_cache_clear(tileUnusedCache);
#endif
#if ENABLE(TIZEN_TILE_REUSE_ALREADY_CREATED)
#if !ENABLE(TIZEN_REUSE_BIGGER_ZOOM_FIRST)
priv->model.matrix = ewk_tile_matrix_new
- (tuc, priv->model.cur.cols, priv->model.cur.rows, priv->view.tile.zoom,
- priv->cspace, priv->view.cols, priv->view.rows,
+ (tileUnusedCache, priv->model.current.columns, priv->model.current.rows, priv->view.tile.zoom,
+ priv->colorSpace, priv->view.columns, priv->view.rows,
_ewk_tiled_backing_store_render, priv, _tile_distance2, priv, evas_object_evas_get(priv->self));
#else
priv->model.matrix = ewk_tile_matrix_new
- (tuc, priv->model.cur.cols, priv->model.cur.rows, priv->view.tile.zoom,
- priv->cspace, priv->view.cols, priv->view.rows,
+ (tileUnusedCache, priv->model.current.columns, priv->model.current.rows, priv->view.tile.zoom,
+ priv->colorSpace, priv->view.columns, priv->view.rows,
_ewk_tiled_backing_store_render, priv, _bigger_zoom_first, priv, evas_object_evas_get(priv->self));
#endif
#else
priv->model.matrix = ewk_tile_matrix_new
- (tuc, priv->model.cur.cols, priv->model.cur.rows,
+ (tuc, priv->model.current.cols, priv->model.current.rows,
priv->view.tile.zoom, priv->cspace, _ewk_tiled_backing_store_render,
priv);
#endif
-#if ENABLE(TIZEN_LOCAL_DIFF)
- ewk_tile_unused_cache_unref(tuc);
+#if ENABLE(TIZEN_TILE_BASECODE)
+ ewk_tile_unused_cache_unref(tileUnusedCache);
#endif
#ifdef DEBUG_MEM_LEAKS
printf("\nFLUSHED BACKING STORE, STATUS AFTER RECREATING TILE MATRIX:\n");
#endif
}
-#if ENABLE(TIZEN_PRE_RENDERING_NEWIMP)
-
-Eina_Bool ewk_tiled_backing_store_pre_render_tile_add(Evas_Object *o, int col, int row, float zoom)
+Eina_Bool ewk_tiled_backing_store_pre_render_tile_add(Evas_Object* ewkBackingStore, int column, int row, float zoom)
{
- PRIV_DATA_GET_OR_RETURN(o, priv, EINA_FALSE);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false);
#if !ENABLE(TIZEN_PRE_RENDER_TILES_CREATED_AFTER_SCROLL)
- if (ewk_tile_matrix_tile_exact_exists(priv->model.matrix, col, row, zoom))
- return EINA_FALSE;
+ if (ewk_tile_matrix_tile_exact_exists(priv->model.matrix, column, row, zoom))
+ return false;
#else
- if (!ewk_tile_matrix_tile_is_pre_renderable(priv->model.matrix, col, row, zoom))
- return EINA_FALSE;
+ if (!ewk_tile_matrix_tile_is_pre_renderable(priv->model.matrix, column, row, zoom))
+ return false;
#endif
- if (!_ewk_tiled_backing_store_pre_render_request_add(priv, col, row, zoom))
- return EINA_FALSE;
+ if (!_ewk_tiled_backing_store_pre_render_request_add(priv, column, row, zoom))
+ return false;
- return EINA_TRUE;
+ return true;
}
-Eina_Bool ewk_tiled_backing_store_pre_render_tiles_enqueue(Evas_Object *o, int max_memory, Eina_Rectangle* view_rect, Eina_Rectangle* cache_rect, float zoom, float old_zoom)
+Eina_Bool ewk_tiled_backing_store_pre_render_spiral_queue(Evas_Object* ewkBackingStore, Eina_Rectangle* viewRect, Eina_Rectangle* renderRect, int maxMemory, float zoom)
{
- PRIV_DATA_GET_OR_RETURN(o, priv, EINA_FALSE);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(viewRect, false);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(renderRect, false);
- if ( !view_rect
- || !cache_rect )
- return EINA_FALSE;
-
- const int tile_w = priv->view.tile.width;
- const int tile_h = priv->view.tile.height;
-
- int view_x = view_rect->x;
- int view_y = view_rect->y;
- int view_w = view_rect->w;
- int view_h = view_rect->h;
+ const int tileWidth = priv->view.tile.width;
+ const int tileHeight = priv->view.tile.height;
- int cache_x = cache_rect->x;
- int cache_y = cache_rect->y;
- int cache_w = cache_rect->w;
- int cache_h = cache_rect->h;
+ Eina_Tile_Grid_Slicer viewSlicer;
+ Eina_Tile_Grid_Slicer renderSlicer;
- DBG("view_x %d,y %d,w %d,h %d\r\n", view_x, view_y, view_w, view_h);
- DBG("cache_x %d cache_y %d cach_w %d cache_h %d\r\n", cache_x, cache_y, cache_w, cache_h);
-
- Eina_Tile_Grid_Slicer view_slicer;
- Eina_Tile_Grid_Slicer cur_cache_slicer;
-
- if (!eina_tile_grid_slicer_setup(&view_slicer, view_x, view_y, view_w, view_h, tile_w, tile_h)) {
- ERR("could not setup grid view_slicer for %d,%d+%dx%d tile=%dx%d", view_x, view_y, view_w, view_h, tile_w, tile_h);
- return EINA_FALSE;
+ if (!eina_tile_grid_slicer_setup(&viewSlicer,
+ viewRect->x, viewRect->y, viewRect->w, viewRect->h, tileWidth, tileHeight)) {
+ ERR("could not setup grid viewSlicer for %d,%d+%dx%d tile=%dx%d", viewRect->x, viewRect->y, viewRect->w, viewRect->h, tileWidth, tileHeight);
+ return false;
}
- if (!eina_tile_grid_slicer_setup(&cur_cache_slicer, cache_x, cache_y, cache_w, cache_h, tile_w, tile_h)) {
- ERR("could not setup grid cur_tuc_slicer for %d,%d+%dx%d tile=%dx%d", cache_x, cache_y, cache_w, cache_h, tile_w, tile_h);
- return EINA_FALSE;
+ if (!eina_tile_grid_slicer_setup(&renderSlicer,
+ renderRect->x, renderRect->y, renderRect->w, renderRect->h, tileWidth, tileHeight)) {
+ ERR("could not setup grid RenderSlicer for %d,%d+%dx%d tile=%dx%d", renderRect->y, renderRect->y, renderRect->w, renderRect->h, tileWidth, tileHeight);
+ return false;
}
- // spiral starts from the center of the view area
- int center_col = (int)(( view_slicer.col1 + view_slicer.col2 ) / 2);
- int center_row = (int)(( view_slicer.row1 + view_slicer.row2 ) / 2);
-
- // set limits to loop to max cache and view size
- const int ARGB_BYTES = 4;
- int hand_break = max_memory / ARGB_BYTES / tile_w / tile_h;
- const int max_view_size = MAX(view_slicer.col2 - view_slicer.col1 , view_slicer.row2 - view_slicer.row1);
- const int max_cache_size = MAX(cur_cache_slicer.col2 - cur_cache_slicer.col1 , cur_cache_slicer.row2 - cur_cache_slicer.row1);
- const int max_loop_count = max_view_size + max_cache_size; // check this value later
-
- // LOG info
- DBG("max size : hand break %d\r\n", hand_break);
- DBG("max_cache_size %d\r\n", max_cache_size);
- DBG("max_loop_count %d\r\n", max_loop_count);
- DBG("center col/row(%d/%d)\r\n", center_col, center_row);
- DBG("view col/row(%d/%d)(%d/%d)\r\n", (int)view_slicer.col1, (int)view_slicer.row1, (int)view_slicer.col2, (int)view_slicer.row2);
- DBG("cur col/row(%d/%d)(%d/%d)\r\n", (int)cur_cache_slicer.col1, (int)cur_cache_slicer.row1, (int)cur_cache_slicer.col2, (int)cur_cache_slicer.row2);
+ // set limits of the loop.
+ int memoryLimits = maxMemory / (EWK_ARGB_BYTES_SIZE * tileWidth * tileHeight);
+ const int maxViewSideLength = std::max(viewSlicer.col2 - viewSlicer.col1, viewSlicer.row2 - viewSlicer.row1);
+ const int maxRenderSideLength = std::max(renderSlicer.col2 - renderSlicer.col1, renderSlicer.row2 - renderSlicer.row1);
+ const int maxLoopCount = maxViewSideLength + maxRenderSideLength;
- int step = 1;
- int loop, i;
- const int each_rect_side = 4;
- for (loop = 0; loop < max_loop_count; loop++) {
- for (i = 1; i < step * each_rect_side + 1; i++) {
+ // spire starts from the center of the view area.
+ int centerColumn = (viewSlicer.col1 + viewSlicer.col2) / 2;
+ int centerRow = (viewSlicer.row1 + viewSlicer.row2) / 2;
+ int step = 1;
+ const int squareSide = 4;
+ for (int loop = 0; loop < maxLoopCount; loop++) {
+ for (int i = 1; i < step * squareSide + 1; i++) {
+ if (memoryLimits <= 0)
+ goto memoryLimitsReached;
/*
- this code means the loop runs like spiral ( left->down->right->up )
- when it moves back to original place and then move 1 tile left and upward.
- the loop keeps on doing this until it reaches max memory to draw tiles
- e.g )
+ this code means the loop runs like spiral. (i.g. left->down->right->up)
+ when it moves back to original place and then walk 1 tile left and up.
+ the loop keeps on doing this until it reaches max memory to draw tiles.
+ e.g. )
333333
322223
321123
333333
*/
if (i > 0 && i <= step)
- center_col++; // move left
+ centerColumn++; // move left.
else if (i > step && i <= step * 2)
- center_row++; // move down
+ centerRow++; // move down.
else if (i > step * 2 && i <= step * 3)
- center_col--; // move right
+ centerColumn--; // move right.
else if (i > step * 3 && i <= step * 4)
- center_row--; // move up
+ centerRow--; // move up.
else
- ERR("ERR:over step limit\r\n");
-
- if (hand_break < 0)
- goto end_of_loop;
+ ERR("ERROR : out of bounds\r\n");
- // skip in view port area
- if ((int)view_slicer.col1 < center_col
- && (int)view_slicer.col2 > center_col
- && (int)view_slicer.row1 < center_row
- && (int)view_slicer.row2 > center_row)
+ // skip in view port area.
+ if (static_cast<int>(viewSlicer.col1) < centerColumn
+ && static_cast<int>(viewSlicer.col2) > centerColumn
+ && static_cast<int>(viewSlicer.row1) < centerRow
+ && static_cast<int>(viewSlicer.row2) > centerRow)
continue;
- if ((int)cur_cache_slicer.col1 <= center_col
- && (int)cur_cache_slicer.col2 >= center_col
- && (int)cur_cache_slicer.row1 <= center_row
- && (int)cur_cache_slicer.row2 >= center_row) {
+ if (static_cast<int>(renderSlicer.col1) <= centerColumn
+ && static_cast<int>(renderSlicer.col2) >= centerColumn
+ && static_cast<int>(renderSlicer.row1) <= centerRow
+ && static_cast<int>(renderSlicer.row2) >= centerRow) {
- if (!ewk_tiled_backing_store_pre_render_tile_add( o, center_col, center_row, zoom ))
+ if (!ewk_tiled_backing_store_pre_render_tile_add(ewkBackingStore, centerColumn, centerRow, zoom))
continue;
-
- hand_break--;
+ DBG("R>[%d %d] ", centerColumn, centerRow);
+ memoryLimits--;
}
}
- center_row--;
- center_col--;
- // each side step is increased by ( 2n - 1 )
+ centerRow--;
+ centerColumn--;
step = step + 2;
}
-end_of_loop:
-
-#if ENABLE(TIZEN_PRE_RENDERING_ADVANCE)
- // if zoom has been changed, add heavy tiles to pre-render queue
- if (zoom != old_zoom) {
- Eina_Tile_Grid_Slicer slicer;
- int contents_width = priv->model.width * zoom;
- int contents_height = priv->model.height * zoom;
- if (!eina_tile_grid_slicer_setup(&slicer, 0, 0, contents_width, contents_height, priv->view.tile.w, priv->view.tile.h))
- return EINA_FALSE;
-
- unsigned long max_col = slicer.col2;
- unsigned long max_row = slicer.row2;
-
- Ewk_Heavy_Tile *heavy_tile = NULL;
- EINA_INLIST_FOREACH(priv->render.heavy_tile_list, heavy_tile) {
- int heavy_tile_col = heavy_tile->col;
- int heavy_tile_row = heavy_tile->row;
- if (zoom > 1.0) {
- int zoom_step = (int)zoom;
- int center_row = heavy_tile_row;
- for (center_row = heavy_tile_row - zoom_step; center_row < heavy_tile_row + zoom_step; center_row++) {
- int center_col = heavy_tile_col;
- for (center_col = heavy_tile_col - zoom_step; center_col < heavy_tile_col + zoom_step; center_col++) {
- if (center_col > 0 && center_row > 0 && center_col < max_col && center_row < max_row)
- ewk_tiled_backing_store_pre_render_tile_add(o, center_col, center_row, zoom);
- }
- }
- } else {
- if (center_col > 0 && center_row > 0 && center_col < max_col && center_row < max_row)
- ewk_tiled_backing_store_pre_render_tile_add(o, heavy_tile_col, heavy_tile_row, zoom);
- }
- }
- }
-#endif
+memoryLimitsReached:
_ewk_tiled_backing_store_item_process_idler_start(priv);
- return EINA_TRUE;
+ return true;
}
-#endif
-Eina_Bool ewk_tiled_backing_store_pre_render_region(Evas_Object* ewkTile, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom)
+Eina_Bool ewk_tiled_backing_store_pre_render_region(Evas_Object* ewkBackingStore, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false);
Eina_Tile_Grid_Slicer slicer;
const Eina_Tile_Grid_Info* info;
- Evas_Coord tw, th;
- Ewk_Tile_Unused_Cache* tuc;
-
- tw = priv->view.tile.width;
- th = priv->view.tile.height;
+ Evas_Coord tileWidth, tileHeight;
+ Ewk_Tile_Unused_Cache* tileUnusedCache;
+
+ tileWidth = priv->view.tile.width;
+ tileHeight = priv->view.tile.height;
zoom = ROUNDED_ZOOM(priv->view.tile.width, zoom);
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
if (priv->view.tile.enable_scale) {
- tw /= zoom;
- th /= zoom;
+ tileWidth /= zoom;
+ tileHeight /= zoom;
}
#endif
- if (!eina_tile_grid_slicer_setup(&slicer, x, y, width, height, tw, th)) {
+ if (!eina_tile_grid_slicer_setup(&slicer, x, y, width, height, tileWidth, tileHeight)) {
ERR("could not setup grid slicer for %d,%d+%dx%d tile=%dx%d",
- x, y, width, height, tw, th);
- return EINA_FALSE;
+ x, y, width, height, tileWidth, tileHeight);
+ return false;
}
#if ENABLE(TIZEN_PRE_RENDERING_FIX)
const unsigned long rows = priv->model.height * zoom / priv->view.tile.height + 1;
- const unsigned long cols = priv->model.width * zoom / priv->view.tile.width + 1;
+ const unsigned long columns = priv->model.width * zoom / priv->view.tile.width + 1;
#endif
while (eina_tile_grid_slicer_next(&slicer, &info)) {
const unsigned long c = info->col;
const unsigned long r = info->row;
#if ENABLE(TIZEN_PRE_RENDERING_FIX)
- if (c >= cols || r >= rows)
+ if (c >= columns || r >= rows)
continue;
- // check if a tile already exists on the matrix, if it does, we do not add a new request to create this particular tile
+ // check if a tile already exists on the matrix, if item does, we do not add a new request to create this particular tile
#if !ENABLE(TIZEN_PRE_RENDER_TILES_CREATED_AFTER_SCROLL)
if (ewk_tile_matrix_tile_exact_exists(priv->model.matrix, c, r, zoom))
continue;
if (!ewk_tile_matrix_tile_is_pre_renderable(priv->model.matrix, c, r, zoom))
continue;
#endif
-
#else
- if (c >= priv->model.cur.cols || r >= priv->model.cur.rows)
+ if (c >= priv->model.current.columns || request >= priv->model.current.rows)
continue;
#endif
if (!_ewk_tiled_backing_store_pre_render_request_add(priv, c, r, zoom))
_ewk_tiled_backing_store_item_process_idler_start(priv);
- tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
-#if !ENABLE(TIZEN_LOCAL_DIFF)
- ewk_tile_unused_cache_lock_area(tuc, x, y, width, height, zoom);
+ tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+#if !ENABLE(TIZEN_TILE_BASECODE)
+ ewk_tile_unused_cache_lock_area(tileUnusedCache, x, y, width, height, zoom);
#endif
- return EINA_TRUE;
+ return true;
}
-Eina_Bool ewk_tiled_backing_store_pre_render_relative_radius(Evas_Object* ewkTile, unsigned int n, float zoom)
+Eina_Bool ewk_tiled_backing_store_pre_render_relative_radius(Evas_Object* ewkBackingStore, unsigned int n, float zoom)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE);
- unsigned long start_row, end_row, start_col, end_col, i, j, width, height;
- Ewk_Tile_Unused_Cache* tuc;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false);
+ unsigned long startRow, endRow, startCol, endCol, i, j, width, height;
+ Ewk_Tile_Unused_Cache* tileUnusedCache;
INF("priv->model.base.row =%ld, n=%u priv->view.rows=%lu",
priv->model.base.row, n, priv->view.rows);
- start_row = MAX(0, (long)(priv->model.base.row - n));
- start_col = MAX(0, (long)(priv->model.base.col - n));
- end_row = std::min(priv->model.cur.rows - 1,
+ startRow = (long)priv->model.base.row - n;
+ startCol = (long)priv->model.base.column - n;
+ endRow = std::min(priv->model.current.rows - 1,
priv->model.base.row + priv->view.rows + n - 1);
- end_col = std::min(priv->model.cur.cols - 1,
- priv->model.base.col + priv->view.cols + n - 1);
+ endCol = std::min(priv->model.current.columns - 1,
+ priv->model.base.column + priv->view.columns + n - 1);
- INF("start_row=%lu, end_row=%lu, start_col=%lu, end_col=%lu",
- start_row, end_row, start_col, end_col);
+ INF("startRow=%lu, endRow=%lu, startCol=%lu, endCol=%lu",
+ startRow, endRow, startCol, endCol);
zoom = ROUNDED_ZOOM(priv->view.tile.width, zoom);
- for (i = start_row; i <= end_row; i++)
- for (j = start_col; j <= end_col; j++) {
+ for (i = startRow; i <= endRow; i++)
+ for (j = startCol; j <= endCol; j++) {
#if ENABLE(TIZEN_PRE_RENDER_INDEX_BOUNDARY_CHECK)
- if (i >= priv->model.cur.rows || j >= priv->model.cur.cols)
+ if (i >= priv->model.current.rows || j >= priv->model.current.columns)
continue;
#endif
if (!_ewk_tiled_backing_store_pre_render_request_add(priv, j, i, zoom))
start_processing:
_ewk_tiled_backing_store_item_process_idler_start(priv);
- tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
- height = (end_row - start_row + 1) * TILE_SIZE_AT_ZOOM(priv->view.tile.height, zoom);
- width = (end_col - start_col + 1) * TILE_SIZE_AT_ZOOM(priv->view.tile.width, zoom);
-#if !ENABLE(TIZEN_LOCAL_DIFF)
- ewk_tile_unused_cache_lock_area(tuc,
- start_col * TILE_SIZE_AT_ZOOM(priv->view.tile.width, zoom),
- start_row * TILE_SIZE_AT_ZOOM(priv->view.tile.height, zoom), width, height, zoom);
+ tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+ height = (endRow - startRow + 1) * TILE_SIZE_AT_ZOOM(priv->view.tile.height, zoom);
+ width = (endCol - startCol + 1) * TILE_SIZE_AT_ZOOM(priv->view.tile.width, zoom);
+#if !ENABLE(TIZEN_TILE_BASECODE)
+ ewk_tile_unused_cache_lock_area(tileUnusedCache,
+ startCol * TILE_SIZE_AT_ZOOM(priv->view.tile.width, zoom),
+ startRow * TILE_SIZE_AT_ZOOM(priv->view.tile.height, zoom), width, height, zoom);
#endif
- return EINA_TRUE;
+ return true;
}
-void ewk_tiled_backing_store_pre_render_cancel(Evas_Object* ewkTile)
+void ewk_tiled_backing_store_pre_render_cancel(Evas_Object* ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv);
- Ewk_Tile_Unused_Cache* tuc;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ Ewk_Tile_Unused_Cache* tileUnusedCache;
_ewk_tiled_backing_store_pre_render_request_clear(priv);
- tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
-#if !ENABLE(TIZEN_LOCAL_DIFF)
- ewk_tile_unused_cache_unlock_area(tuc);
+ tileUnusedCache = ewk_tile_matrix_unused_cache_get(priv->model.matrix);
+#if !ENABLE(TIZEN_TILE_BASECODE)
+ ewk_tile_unused_cache_unlock_area(tileUnusedCache);
#endif
}
-Eina_Bool ewk_tiled_backing_store_disable_render(Evas_Object* ewkTile)
+Eina_Bool ewk_tiled_backing_store_disable_render(Evas_Object* ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false);
return _ewk_tiled_backing_store_disable_render(priv);
}
-Eina_Bool ewk_tiled_backing_store_enable_render(Evas_Object* ewkTile)
+Eina_Bool ewk_tiled_backing_store_enable_render(Evas_Object* ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, false);
_ewk_tiled_backing_store_changed(priv);
return _ewk_tiled_backing_store_enable_render(priv);
}
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
-void ewk_tiled_backing_store_enable_scale_set(Evas_Object *o, Eina_Bool value)
+void ewk_tiled_backing_store_enable_scale_set(Evas_Object *ewkBackingStore, Eina_Bool value)
{
- PRIV_DATA_GET_OR_RETURN(o, priv);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
if (priv->view.tile.enable_scale != value)
priv->view.tile.enable_scale = value;
}
#endif
#if ENABLE(TIZEN_TILE_SIZE_SET)
-void ewk_tiled_backing_store_tile_size_get(const Evas_Object *o, Evas_Coord *tw, Evas_Coord *th)
+void ewk_tiled_backing_store_tile_size_get(const Evas_Object *ewkBackingStore, Evas_Coord *tileWidth, Evas_Coord *tileHeight)
{
- PRIV_DATA_GET_OR_RETURN(o, priv);
- if (tw)
- *tw = priv->view.tile.width;
- if (th)
- *th = priv->view.tile.height;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ if (tileWidth)
+ *tileWidth = priv->view.tile.width;
+ if (tileHeight)
+ *tileHeight = priv->view.tile.height;
}
-Eina_Bool ewk_tiled_backing_store_tile_size_set(Evas_Object *o, Evas_Coord tw, Evas_Coord th)
+Eina_Bool ewk_tiled_backing_store_tile_size_set(Evas_Object *ewkBackingStore, Evas_Coord tileWidth, Evas_Coord tileHeight)
{
- PRIV_DATA_GET_OR_RETURN(o, priv, EINA_FALSE);
- if (priv->view.tile.width == tw && priv->view.tile.height == th)
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, EINA_FALSE);
+ if (priv->view.tile.width == tileWidth && priv->view.tile.height == tileHeight)
return EINA_TRUE;
- if (tw <= 0 || th <= 0)
+ if (tileWidth <= 0 || tileHeight <= 0)
return EINA_FALSE;
- tw = tw >> 1;
- tw = tw << 1;
- th = th >> 1;
- th = th << 1;
- priv->view.tile.width = tw;
- priv->view.tile.height = th;
+ tileWidth = tileWidth >> 1;
+ tileWidth = tileWidth << 1;
+ tileHeight = tileHeight >> 1;
+ tileHeight = tileHeight << 1;
+ priv->view.tile.width = tileWidth;
+ priv->view.tile.height = tileHeight;
#if ENABLE(TIZEN_TILE_MATRIX_LIST)
ewk_tile_matrix_invalidate_matrices(priv->model.matrix);
#endif
- ewk_tile_matrix_tile_size_set(priv->model.matrix, tw, th);
+ ewk_tile_matrix_tile_size_set(priv->model.matrix, tileWidth, tileHeight);
_ewk_tiled_backing_store_flush_tiles(priv);
- long cols, rows;
+ long columns, rows;
float scale = 1.0;
#if ENABLE(TIZEN_CAIRO_SCALE_PATCH)
if (priv->view.tile.enable_scale)
scale = priv->view.tile.zoom;
#endif
- cols = priv->model.width * scale / priv->view.tile.width + 1;
+ columns = priv->model.width * scale / priv->view.tile.width + 1;
rows = priv->model.height * scale / priv->view.tile.height + 1;
- priv->model.old.cols = priv->model.cur.cols;
- priv->model.old.rows = priv->model.cur.rows;
- priv->model.cur.cols = cols;
- priv->model.cur.rows = rows;
- ewk_tile_matrix_resize(priv->model.matrix, cols, rows);
+ priv->model.old.columns = priv->model.current.columns;
+ priv->model.old.rows = priv->model.current.rows;
+ priv->model.current.columns = columns;
+ priv->model.current.rows = rows;
+ ewk_tile_matrix_resize(priv->model.matrix, columns, rows);
_ewk_tiled_backing_store_recalc_and_reposition_renderers(priv);
_ewk_tiled_backing_store_updates_process(priv);
}
#endif
-#if ENABLE(TIZEN_REPAINT_IDLER)
-void ewk_tiled_backing_store_repaints_on_idler_set(Evas_Object *o, Eina_Bool value)
-{
- PRIV_DATA_GET_OR_RETURN(o, priv);
- if (priv->render.on_idler != value)
- priv->render.on_idler = value;
-}
-
-Eina_Bool ewk_tiled_backing_store_repaints_on_idler_get(Evas_Object *o)
-{
- PRIV_DATA_GET_OR_RETURN(o, priv, EINA_FALSE);
- return priv->render.on_idler;
-}
-#endif
#if ENABLE(TIZEN_VIEW_ACTIVE_SET)
-Eina_Bool ewk_tiled_backing_store_active_set(Evas_Object *o, Eina_Bool value)
+Eina_Bool ewk_tiled_backing_store_active_set(Evas_Object *ewkBackingStore, Eina_Bool value)
{
- PRIV_DATA_GET_OR_RETURN(o, priv, EINA_FALSE);
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, EINA_FALSE);
if (priv->view.active == value)
return EINA_TRUE;
if (value) {
_ewk_tiled_backing_store_fill_renderers(priv);
_ewk_tiled_backing_store_item_process_idler_start(priv);
-#if ENABLE(TIZEN_REPAINT_IDLER)
- priv->render.next_no_idler = EINA_TRUE;
-#endif
_ewk_tiled_backing_store_changed(priv);
} else {
-#if ENABLE(TIZEN_REPAINT_IDLER)
- _ewk_tiled_backing_store_restore_idler_timer_stop(priv);
- _ewk_tiled_backing_store_process_requests_flush(priv);
- _ewk_tiled_backing_store_update_add_process(priv);
-#endif
_ewk_tiled_backing_store_pre_render_request_flush(priv);
_ewk_tiled_backing_store_tile_dissociate_all(priv);
}
#endif
#if ENABLE(TIZEN_FIX_RSS_IMAGE_DISPLAY)
-void ewk_tiled_backing_store_zoom_changed_set(Evas_Object *o, Eina_Bool value)
+void ewk_tiled_backing_store_zoom_changed_set(Evas_Object *ewkBackingStore, Eina_Bool value)
{
- PRIV_DATA_GET_OR_RETURN(o, priv);
- priv->view.changed_zoom= value;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv);
+ priv->view.changedZoom= value;
}
-Eina_Bool ewk_tiled_backing_store_zoom_changed_get(Evas_Object *o)
+Eina_Bool ewk_tiled_backing_store_zoom_changed_get(Evas_Object *ewkBackingStore)
{
- PRIV_DATA_GET_OR_RETURN(o, priv, EINA_FALSE);
- return priv->view.changed_zoom;
+ PRIV_DATA_GET_OR_RETURN(ewkBackingStore, priv, EINA_FALSE);
+ return priv->view.changedZoom;
}
#endif
-#if ENABLE(TIZEN_PRE_RENDERING_ADVANCE)
-Eina_Bool ewk_tiled_backing_store_drawing_time_request_add(Ewk_Tiled_Backing_Store_Data *priv, unsigned long col, unsigned long row, float zoom, long drawing_time)
-{
- Ewk_Heavy_Tile *r;
-
- MALLOC_OR_OOM_RET(r, sizeof(Ewk_Heavy_Tile), EINA_FALSE);
-
- priv->render.heavy_tile_list = eina_inlist_append
- (priv->render.heavy_tile_list, EINA_INLIST_GET(r));
-
- r->col = col;
- r->row = row;
- r->drawing_time = drawing_time;
- return EINA_TRUE;
-}
-Eina_Bool ewk_tiled_backing_store_drawing_time_request_flush(Evas_Object *o)
-{
- PRIV_DATA_GET_OR_RETURN(o, priv, EINA_FALSE);
-
- Eina_Inlist **pl = &priv->render.heavy_tile_list;
- while (*pl) {
- Ewk_Heavy_Tile *r;
- r = EINA_INLIST_CONTAINER_GET(priv->render.heavy_tile_list, Ewk_Heavy_Tile);
- *pl = eina_inlist_remove(*pl, *pl);
- free(r);
- }
- return EINA_TRUE;
-}
-#endif