[EFL] Remove unnecessary smart method since ewk_view_tiled removed

https://bugs.webkit.org/show_bug.cgi?id=127417

Reviewed by Gyuyoung Kim.

Source/WebKit/efl:

pre_render related codes is only for ewk_view_tiled.
In addition, we don't have any requirement to override repaints_process
and scroll_process now.

* ewk/ewk_view.cpp:
(_ewk_view_smart_repaints_process):
(_ewk_view_smart_calculate):
(ewk_view_smart_set):
(ewk_view_scrolls_process):
* ewk/ewk_view.h:

Tools:

* EWebLauncher/main.c:
(on_key_down): Removed shortcut to test pre render.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4787b0a9
2014-01-22 Ryuan Choi <ryuan.choi@samsung.com>
[EFL] Remove unnecessary smart method since ewk_view_tiled removed
https://bugs.webkit.org/show_bug.cgi?id=127417
Reviewed by Gyuyoung Kim.
pre_render related codes is only for ewk_view_tiled.
In addition, we don't have any requirement to override repaints_process
and scroll_process now.
* ewk/ewk_view.cpp:
(_ewk_view_smart_repaints_process):
(_ewk_view_smart_calculate):
(ewk_view_smart_set):
(ewk_view_scrolls_process):
* ewk/ewk_view.h:
2014-01-19 Ryuan Choi <ryuan.choi@samsung.com>
[EFL][WK1] Remove and refactor the APIs which use single and base keyword
......
......@@ -1147,7 +1147,7 @@ static void _ewk_view_smart_scrolls_process(Ewk_View_Smart_Data* smartData)
return;
}
static Eina_Bool _ewk_view_smart_repaints_process(Ewk_View_Smart_Data* smartData)
static bool _ewk_view_smart_repaints_process(Ewk_View_Smart_Data* smartData)
{
EWK_VIEW_PRIV_GET(smartData, priv);
......@@ -1232,8 +1232,6 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView)
{
EWK_VIEW_SD_GET(ewkView, smartData);
EWK_VIEW_PRIV_GET(smartData, priv);
EINA_SAFETY_ON_NULL_RETURN(smartData->api->contents_resize);
EINA_SAFETY_ON_NULL_RETURN(smartData->api->repaints_process);
Evas_Coord x, y, width, height;
smartData->changed.any = false;
......@@ -1276,10 +1274,10 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView)
}
smartData->changed.position = false;
smartData->api->scrolls_process(smartData);
_ewk_view_smart_scrolls_process(smartData);
_ewk_view_scrolls_flush(priv);
if (!smartData->api->repaints_process(smartData))
if (!_ewk_view_smart_repaints_process(smartData))
ERR("failed to process repaints.");
if (smartData->changed.frame_rect) {
......@@ -1345,31 +1343,6 @@ static void _ewk_view_smart_flush(Ewk_View_Smart_Data* smartData)
_ewk_view_scrolls_flush(priv);
}
static Eina_Bool _ewk_view_smart_pre_render_region(Ewk_View_Smart_Data* smartData, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom)
{
WARN("not supported by engine. smartData=%p area=%d,%d+%dx%d, zoom=%f",
smartData, x, y, width, height, zoom);
return false;
}
static Eina_Bool _ewk_view_smart_pre_render_relative_radius(Ewk_View_Smart_Data* smartData, unsigned int number, float zoom)
{
WARN("not supported by engine. smartData=%p, n=%u zoom=%f",
smartData, number, zoom);
return false;
}
static Eina_Bool _ewk_view_smart_pre_render_start(Ewk_View_Smart_Data* smartData)
{
WARN("not supported by engine. smartData=%p", smartData);
return false;
}
static void _ewk_view_smart_pre_render_cancel(Ewk_View_Smart_Data* smartData)
{
WARN("not supported by engine. smartData=%p", smartData);
}
static void _ewk_view_zoom_animated_mark_stop(Ewk_View_Smart_Data* smartData)
{
smartData->animated_zoom.zoom.start = 0.0;
......@@ -1545,16 +1518,10 @@ Eina_Bool ewk_view_smart_set(Ewk_View_Smart_Class* api)
api->sc.callbacks = _ewk_view_callback_names;
api->contents_resize = _ewk_view_smart_contents_resize;
api->scrolls_process = _ewk_view_smart_scrolls_process;
api->repaints_process = _ewk_view_smart_repaints_process;
api->zoom_set = _ewk_view_smart_zoom_set;
api->zoom_weak_set = _ewk_view_smart_zoom_weak_set;
api->zoom_weak_smooth_scale_set = _ewk_view_smart_zoom_weak_smooth_scale_set;
api->flush = _ewk_view_smart_flush;
api->pre_render_region = _ewk_view_smart_pre_render_region;
api->pre_render_relative_radius = _ewk_view_smart_pre_render_relative_radius;
api->pre_render_start = _ewk_view_smart_pre_render_start;
api->pre_render_cancel = _ewk_view_smart_pre_render_cancel;
api->disable_render = _ewk_view_smart_disable_render;
api->enable_render = _ewk_view_smart_enable_render;
......@@ -2199,70 +2166,6 @@ Eina_Bool ewk_view_zoom_animated_set(Evas_Object* ewkView, float zoom, float dur
return true;
}
Eina_Bool ewk_view_pre_render_region(Evas_Object* ewkView, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api->pre_render_region, false);
Evas_Coord contentsWidth, contentsHeight;
/* When doing animated zoom it's not possible to call pre-render since it
* would screw up parameters that animation is currently using
*/
if (priv->animatedZoom.animator)
return false;
float currentZoom = ewk_frame_page_zoom_get(smartData->main_frame);
if (currentZoom < std::numeric_limits<float>::epsilon())
return false;
if (!ewk_frame_contents_size_get(smartData->main_frame, &contentsWidth, &contentsHeight))
return false;
contentsWidth *= zoom / currentZoom;
contentsHeight *= zoom / currentZoom;
DBG("region %d,%d+%dx%d @ %f contents=%dx%d", x, y, width, height, zoom, contentsWidth, contentsHeight);
if (x + width > contentsWidth)
width = contentsWidth - x;
if (y + height > contentsHeight)
height = contentsHeight - y;
if (x < 0) {
width += x;
x = 0;
}
if (y < 0) {
height += y;
y = 0;
}
return smartData->api->pre_render_region(smartData, x, y, width, height, zoom);
}
Eina_Bool ewk_view_pre_render_relative_radius(Evas_Object* ewkView, unsigned int number)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api->pre_render_relative_radius, false);
float currentZoom;
if (priv->animatedZoom.animator)
return false;
currentZoom = ewk_frame_page_zoom_get(smartData->main_frame);
return smartData->api->pre_render_relative_radius(smartData, number, currentZoom);
}
Eina_Bool ewk_view_pre_render_start(Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api->pre_render_start, false);
return smartData->api->pre_render_start(smartData);
}
unsigned int ewk_view_imh_get(const Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
......@@ -2270,13 +2173,6 @@ unsigned int ewk_view_imh_get(const Evas_Object* ewkView)
return priv->imh;
}
void ewk_view_pre_render_cancel(Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
EINA_SAFETY_ON_NULL_RETURN(smartData->api->pre_render_cancel);
smartData->api->pre_render_cancel(smartData);
}
Eina_Bool ewk_view_enable_render(const Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
......@@ -3048,7 +2944,7 @@ void ewk_view_scrolls_process(Ewk_View_Smart_Data* smartData)
EINA_SAFETY_ON_NULL_RETURN(smartData);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
smartData->api->scrolls_process(smartData);
_ewk_view_smart_scrolls_process(smartData);
_ewk_view_scrolls_flush(priv);
}
......
......@@ -153,17 +153,11 @@ struct _Ewk_View_Smart_Class {
Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd, Eina_Bool javascript, const Ewk_Window_Features *window_features); /**< creates a new window, requested by webkit */
void (*window_close)(Ewk_View_Smart_Data *sd); /**< closes a window */
void (*scrolls_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
Eina_Bool (*repaints_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
Eina_Bool (*contents_resize)(Ewk_View_Smart_Data *sd, int w, int h);
Eina_Bool (*zoom_set)(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy);
Eina_Bool (*zoom_weak_set)(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy);
void (*zoom_weak_smooth_scale_set)(Ewk_View_Smart_Data *sd, Eina_Bool smooth_scale);
void (*flush)(Ewk_View_Smart_Data *sd);
Eina_Bool (*pre_render_region)(Ewk_View_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom);
Eina_Bool (*pre_render_relative_radius)(Ewk_View_Smart_Data *sd, unsigned int n, float zoom);
Eina_Bool (*pre_render_start)(Ewk_View_Smart_Data *sd);
void (*pre_render_cancel)(Ewk_View_Smart_Data *sd);
Eina_Bool (*disable_render)(Ewk_View_Smart_Data *sd);
Eina_Bool (*enable_render)(Ewk_View_Smart_Data *sd);
......@@ -200,7 +194,7 @@ struct _Ewk_View_Smart_Class {
* The version you have to put into the version field
* in the @a Ewk_View_Smart_Class structure.
*/
#define EWK_VIEW_SMART_CLASS_VERSION 8UL
#define EWK_VIEW_SMART_CLASS_VERSION 9UL
/**
* Initializes a whole @a Ewk_View_Smart_Class structure.
......@@ -212,7 +206,7 @@ struct _Ewk_View_Smart_Class {
* @see EWK_VIEW_SMART_CLASS_INIT_VERSION
* @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
*/
#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
/**
* Initializes to zero a whole @a Ewk_View_Smart_Class structure.
......@@ -1220,80 +1214,6 @@ EAPI Eina_Bool ewk_view_zoom_animated_mark_stop(Evas_Object *o);
*/
EAPI Eina_Bool ewk_view_zoom_animated_set(Evas_Object *o, float zoom, float duration, Evas_Coord cx, Evas_Coord cy);
/**
* Asks engine to pre-render region.
*
* Engines and backing store might be able to pre-render regions in
* order to speed up zooming or scrolling to that region. Not all
* engines might implement that and they will return @c EINA_FALSE
* in that case.
*
* The given region is a hint. Engines might do bigger or smaller area
* that covers that region. Pre-render might not be immediate, it may
* be postponed to a thread, operated cooperatively in the main loop
* and may be even ignored or cancelled afterwards.
*
* Multiple requests might be queued by engines. One can clear/forget
* about them with ewk_view_pre_render_cancel().
*
* @param o view to ask pre-render of given region
* @param x absolute coordinate (0=left) to pre-render at zoom
* @param y absolute coordinate (0=top) to pre-render at zoom
* @param w width to pre-render starting from @a x at zoom
* @param h height to pre-render starting from @a y at zoom
* @param zoom desired zoom
*
* @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
* otherwise (errors, pre-render feature not supported, etc)
*
* @see ewk_view_pre_render_cancel()
*/
EAPI Eina_Bool ewk_view_pre_render_region(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom);
/**
* Asks engine to pre-render region, given @a n extra cols/rows.
*
* This is an alternative method to ewk_view_pre_render_region(). It does not
* make sense in all engines and therefore it might not be implemented at all.
*
* It's only useful if engine divide the area being rendered in smaller tiles,
* forming a grid. Then, browser could call this function to pre-render @a n
* rows/cols involving the current viewport.
*
* @param o view to ask pre-render
* @param n number of cols/rows that must be part of the region pre-rendered
*
* @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
* otherwise (errors, pre-render feature not supported, etc)
*
* @see ewk_view_pre_render_region()
*/
EAPI Eina_Bool ewk_view_pre_render_relative_radius(Evas_Object *o, unsigned int n);
/**
* Asks engine to start pre-rendering.
*
* This is an alternative method to pre-render around the view area.
* The first step is to find the center view area where to start pre-rendering.
* And then from the center of the view area the backing store append the render request
* outward in spiral order. So that the tiles which are close to view area are displayed
* sooner than outside.
*
* @param o view to ask pre-render
*
* @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
* otherwise (errors, pre-render feature not supported, etc)
*
*/
EAPI Eina_Bool ewk_view_pre_render_start(Evas_Object *o);
/**
* Cancels and clears previous the pre-render requests.
*
* @param o view to clear pre-render requests
*/
EAPI void ewk_view_pre_render_cancel(Evas_Object *o);
/**
* Enables (resumes) rendering.
*
......
2014-01-22 Ryuan Choi <ryuan.choi@samsung.com>
[EFL] Remove unnecessary smart method since ewk_view_tiled removed
https://bugs.webkit.org/show_bug.cgi?id=127417
Reviewed by Gyuyoung Kim.
* EWebLauncher/main.c:
(on_key_down): Removed shortcut to test pre render.
2014-01-22 Myles C. Maxfield <mmaxfield@apple.com>
Remove CSS3_TEXT_DECORATION define
......
......@@ -590,24 +590,6 @@ on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
} else if (!strcmp(ev->key, "n") && ctrlPressed) {
info("Create new window (Ctrl+n) was pressed.");
browserCreate("http://www.google.com", app->userArgs);
} else if (!strcmp(ev->key, "g") && ctrlPressed ) {
Evas_Coord x, y, w, h;
Evas_Object *frame = ewk_view_frame_main_get(obj);
float zoom = zoomLevels[currentZoomLevel] / 100.0;
ewk_frame_visible_content_geometry_get(frame, EINA_FALSE, &x, &y, &w, &h);
x -= w;
y -= h;
w *= 4;
h *= 4;
info("Pre-render %d,%d + %dx%d", x, y, w, h);
ewk_view_pre_render_region(obj, x, y, w, h, zoom);
} else if (!strcmp(ev->key, "r") && ctrlPressed) {
info("Pre-render 1 extra column/row with current zoom");
ewk_view_pre_render_relative_radius(obj, 1);
} else if (!strcmp(ev->key, "p") && ctrlPressed) {
info("Pre-rendering start");
ewk_view_pre_render_start(obj);
} else if (!strcmp(ev->key, "d") && ctrlPressed) {
info("Render suspended");
ewk_view_disable_render(obj);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment