Changeset 162581 in webkit


Ignore:
Timestamp:
Jan 22, 2014 6:24:10 PM (10 years ago)
Author:
ryuan.choi@samsung.com
Message:

[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.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/efl/ChangeLog

    r162303 r162581  
     12014-01-22  Ryuan Choi  <ryuan.choi@samsung.com>
     2
     3        [EFL] Remove unnecessary smart method since ewk_view_tiled removed
     4        https://bugs.webkit.org/show_bug.cgi?id=127417
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        pre_render related codes is only for ewk_view_tiled.
     9        In addition, we don't have any requirement to override repaints_process
     10        and scroll_process now.
     11
     12        * ewk/ewk_view.cpp:
     13        (_ewk_view_smart_repaints_process):
     14        (_ewk_view_smart_calculate):
     15        (ewk_view_smart_set):
     16        (ewk_view_scrolls_process):
     17        * ewk/ewk_view.h:
     18
    1192014-01-19  Ryuan Choi  <ryuan.choi@samsung.com>
    220
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r162303 r162581  
    11481148}
    11491149
    1150 static Eina_Bool _ewk_view_smart_repaints_process(Ewk_View_Smart_Data* smartData)
     1150static bool _ewk_view_smart_repaints_process(Ewk_View_Smart_Data* smartData)
    11511151{
    11521152    EWK_VIEW_PRIV_GET(smartData, priv);
     
    12331233    EWK_VIEW_SD_GET(ewkView, smartData);
    12341234    EWK_VIEW_PRIV_GET(smartData, priv);
    1235     EINA_SAFETY_ON_NULL_RETURN(smartData->api->contents_resize);
    1236     EINA_SAFETY_ON_NULL_RETURN(smartData->api->repaints_process);
    12371235    Evas_Coord x, y, width, height;
    12381236
     
    12771275    smartData->changed.position = false;
    12781276
    1279     smartData->api->scrolls_process(smartData);
     1277    _ewk_view_smart_scrolls_process(smartData);
    12801278    _ewk_view_scrolls_flush(priv);
    12811279
    1282     if (!smartData->api->repaints_process(smartData))
     1280    if (!_ewk_view_smart_repaints_process(smartData))
    12831281        ERR("failed to process repaints.");
    12841282
     
    13441342    _ewk_view_repaints_flush(priv);
    13451343    _ewk_view_scrolls_flush(priv);
    1346 }
    1347 
    1348 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)
    1349 {
    1350     WARN("not supported by engine. smartData=%p area=%d,%d+%dx%d, zoom=%f",
    1351         smartData, x, y, width, height, zoom);
    1352     return false;
    1353 }
    1354 
    1355 static Eina_Bool _ewk_view_smart_pre_render_relative_radius(Ewk_View_Smart_Data* smartData, unsigned int number, float zoom)
    1356 {
    1357     WARN("not supported by engine. smartData=%p, n=%u zoom=%f",
    1358         smartData, number, zoom);
    1359     return false;
    1360 }
    1361 
    1362 static Eina_Bool _ewk_view_smart_pre_render_start(Ewk_View_Smart_Data* smartData)
    1363 {
    1364     WARN("not supported by engine. smartData=%p", smartData);
    1365     return false;
    1366 }
    1367 
    1368 static void _ewk_view_smart_pre_render_cancel(Ewk_View_Smart_Data* smartData)
    1369 {
    1370     WARN("not supported by engine. smartData=%p", smartData);
    13711344}
    13721345
     
    15461519
    15471520    api->contents_resize = _ewk_view_smart_contents_resize;
    1548     api->scrolls_process = _ewk_view_smart_scrolls_process;
    1549     api->repaints_process = _ewk_view_smart_repaints_process;
    15501521    api->zoom_set = _ewk_view_smart_zoom_set;
    15511522    api->zoom_weak_set = _ewk_view_smart_zoom_weak_set;
    15521523    api->zoom_weak_smooth_scale_set = _ewk_view_smart_zoom_weak_smooth_scale_set;
    15531524    api->flush = _ewk_view_smart_flush;
    1554     api->pre_render_region = _ewk_view_smart_pre_render_region;
    1555     api->pre_render_relative_radius = _ewk_view_smart_pre_render_relative_radius;
    1556     api->pre_render_start = _ewk_view_smart_pre_render_start;
    1557     api->pre_render_cancel = _ewk_view_smart_pre_render_cancel;
    15581525    api->disable_render = _ewk_view_smart_disable_render;
    15591526    api->enable_render = _ewk_view_smart_enable_render;
     
    22002167}
    22012168
    2202 Eina_Bool ewk_view_pre_render_region(Evas_Object* ewkView, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom)
    2203 {
    2204     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
    2205     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
    2206     EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api->pre_render_region, false);
    2207     Evas_Coord contentsWidth, contentsHeight;
    2208 
    2209     /* When doing animated zoom it's not possible to call pre-render since it
    2210      * would screw up parameters that animation is currently using
    2211      */
    2212     if (priv->animatedZoom.animator)
    2213         return false;
    2214 
    2215     float currentZoom = ewk_frame_page_zoom_get(smartData->main_frame);
    2216     if (currentZoom < std::numeric_limits<float>::epsilon())
    2217         return false;
    2218 
    2219     if (!ewk_frame_contents_size_get(smartData->main_frame, &contentsWidth, &contentsHeight))
    2220         return false;
    2221 
    2222     contentsWidth *= zoom / currentZoom;
    2223     contentsHeight *= zoom / currentZoom;
    2224     DBG("region %d,%d+%dx%d @ %f contents=%dx%d", x, y, width, height, zoom, contentsWidth, contentsHeight);
    2225 
    2226     if (x + width > contentsWidth)
    2227         width = contentsWidth - x;
    2228 
    2229     if (y + height > contentsHeight)
    2230         height = contentsHeight - y;
    2231 
    2232     if (x < 0) {
    2233         width += x;
    2234         x = 0;
    2235     }
    2236     if (y < 0) {
    2237         height += y;
    2238         y = 0;
    2239     }
    2240 
    2241     return smartData->api->pre_render_region(smartData, x, y, width, height, zoom);
    2242 }
    2243 
    2244 Eina_Bool ewk_view_pre_render_relative_radius(Evas_Object* ewkView, unsigned int number)
    2245 {
    2246     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
    2247     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
    2248     EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api->pre_render_relative_radius, false);
    2249     float currentZoom;
    2250 
    2251     if (priv->animatedZoom.animator)
    2252         return false;
    2253 
    2254     currentZoom = ewk_frame_page_zoom_get(smartData->main_frame);
    2255     return smartData->api->pre_render_relative_radius(smartData, number, currentZoom);
    2256 }
    2257 
    2258 Eina_Bool ewk_view_pre_render_start(Evas_Object* ewkView)
    2259 {
    2260     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
    2261     EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api->pre_render_start, false);
    2262 
    2263     return smartData->api->pre_render_start(smartData);
    2264 }
    2265 
    22662169unsigned int ewk_view_imh_get(const Evas_Object* ewkView)
    22672170{
     
    22692172    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
    22702173    return priv->imh;
    2271 }
    2272 
    2273 void ewk_view_pre_render_cancel(Evas_Object* ewkView)
    2274 {
    2275     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
    2276     EINA_SAFETY_ON_NULL_RETURN(smartData->api->pre_render_cancel);
    2277     smartData->api->pre_render_cancel(smartData);
    22782174}
    22792175
     
    30492945    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
    30502946
    3051     smartData->api->scrolls_process(smartData);
     2947    _ewk_view_smart_scrolls_process(smartData);
    30522948    _ewk_view_scrolls_flush(priv);
    30532949}
  • trunk/Source/WebKit/efl/ewk/ewk_view.h

    r162303 r162581  
    154154    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 */
    155155    void (*window_close)(Ewk_View_Smart_Data *sd); /**< closes a window */
    156     void (*scrolls_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
    157     Eina_Bool (*repaints_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
    158156    Eina_Bool (*contents_resize)(Ewk_View_Smart_Data *sd, int w, int h);
    159157    Eina_Bool (*zoom_set)(Ewk_View_Smart_Data *sd, float zoom, Evas_Coord cx, Evas_Coord cy);
     
    161159    void (*zoom_weak_smooth_scale_set)(Ewk_View_Smart_Data *sd, Eina_Bool smooth_scale);
    162160    void (*flush)(Ewk_View_Smart_Data *sd);
    163     Eina_Bool (*pre_render_region)(Ewk_View_Smart_Data *sd, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom);
    164     Eina_Bool (*pre_render_relative_radius)(Ewk_View_Smart_Data *sd, unsigned int n, float zoom);
    165     Eina_Bool (*pre_render_start)(Ewk_View_Smart_Data *sd);
    166     void (*pre_render_cancel)(Ewk_View_Smart_Data *sd);
    167161    Eina_Bool (*disable_render)(Ewk_View_Smart_Data *sd);
    168162    Eina_Bool (*enable_render)(Ewk_View_Smart_Data *sd);
     
    201195 * in the @a Ewk_View_Smart_Class structure.
    202196 */
    203 #define EWK_VIEW_SMART_CLASS_VERSION 8UL
     197#define EWK_VIEW_SMART_CLASS_VERSION 9UL
    204198
    205199/**
     
    213207 * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
    214208 */
    215 #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}
     209#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}
    216210
    217211/**
     
    12221216
    12231217/**
    1224  * Asks engine to pre-render region.
    1225  *
    1226  * Engines and backing store might be able to pre-render regions in
    1227  * order to speed up zooming or scrolling to that region. Not all
    1228  * engines might implement that and they will return @c EINA_FALSE
    1229  * in that case.
    1230  *
    1231  * The given region is a hint. Engines might do bigger or smaller area
    1232  * that covers that region. Pre-render might not be immediate, it may
    1233  * be postponed to a thread, operated cooperatively in the main loop
    1234  * and may be even ignored or cancelled afterwards.
    1235  *
    1236  * Multiple requests might be queued by engines. One can clear/forget
    1237  * about them with ewk_view_pre_render_cancel().
    1238  *
    1239  * @param o view to ask pre-render of given region
    1240  * @param x absolute coordinate (0=left) to pre-render at zoom
    1241  * @param y absolute coordinate (0=top) to pre-render at zoom
    1242  * @param w width to pre-render starting from @a x at zoom
    1243  * @param h height to pre-render starting from @a y at zoom
    1244  * @param zoom desired zoom
    1245  *
    1246  * @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
    1247  *         otherwise (errors, pre-render feature not supported, etc)
    1248  *
    1249  * @see ewk_view_pre_render_cancel()
    1250  */
    1251 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);
    1252 
    1253 /**
    1254  * Asks engine to pre-render region, given @a n extra cols/rows.
    1255  *
    1256  * This is an alternative method to ewk_view_pre_render_region(). It does not
    1257  * make sense in all engines and therefore it might not be implemented at all.
    1258  *
    1259  * It's only useful if engine divide the area being rendered in smaller tiles,
    1260  * forming a grid. Then, browser could call this function to pre-render @a n
    1261  * rows/cols involving the current viewport.
    1262  *
    1263  * @param o view to ask pre-render
    1264  * @param n number of cols/rows that must be part of the region pre-rendered
    1265  *
    1266  * @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
    1267  *         otherwise (errors, pre-render feature not supported, etc)
    1268  *
    1269  * @see ewk_view_pre_render_region()
    1270  */
    1271 EAPI Eina_Bool    ewk_view_pre_render_relative_radius(Evas_Object *o, unsigned int n);
    1272 
    1273 /**
    1274  * Asks engine to start pre-rendering.
    1275  *
    1276  * This is an alternative method to pre-render around the view area.
    1277  * The first step is to find the center view area where to start pre-rendering.
    1278  * And then from the center of the view area the backing store append the render request
    1279  * outward in spiral order. So that the tiles which are close to view area are displayed
    1280  * sooner than outside.
    1281  *
    1282  * @param o view to ask pre-render
    1283  *
    1284  * @return @c EINA_TRUE if request was accepted, @c EINA_FALSE
    1285  *         otherwise (errors, pre-render feature not supported, etc)
    1286  *
    1287  */
    1288 EAPI Eina_Bool    ewk_view_pre_render_start(Evas_Object *o);
    1289 
    1290 /**
    1291  * Cancels and clears previous the pre-render requests.
    1292  *
    1293  * @param o view to clear pre-render requests
    1294  */
    1295 EAPI void         ewk_view_pre_render_cancel(Evas_Object *o);
    1296 
    1297 /**
    12981218 * Enables (resumes) rendering.
    12991219 *
  • trunk/Tools/ChangeLog

    r162579 r162581  
     12014-01-22  Ryuan Choi  <ryuan.choi@samsung.com>
     2
     3        [EFL] Remove unnecessary smart method since ewk_view_tiled removed
     4        https://bugs.webkit.org/show_bug.cgi?id=127417
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        * EWebLauncher/main.c:
     9        (on_key_down): Removed shortcut to test pre render.
     10
    1112014-01-22  Myles C. Maxfield  <mmaxfield@apple.com>
    212
  • trunk/Tools/EWebLauncher/main.c

    r162303 r162581  
    591591        info("Create new window (Ctrl+n) was pressed.");
    592592        browserCreate("http://www.google.com", app->userArgs);
    593     } else if (!strcmp(ev->key, "g") && ctrlPressed ) {
    594         Evas_Coord x, y, w, h;
    595         Evas_Object *frame = ewk_view_frame_main_get(obj);
    596         float zoom = zoomLevels[currentZoomLevel] / 100.0;
    597 
    598         ewk_frame_visible_content_geometry_get(frame, EINA_FALSE, &x, &y, &w, &h);
    599         x -= w;
    600         y -= h;
    601         w *= 4;
    602         h *= 4;
    603         info("Pre-render %d,%d + %dx%d", x, y, w, h);
    604         ewk_view_pre_render_region(obj, x, y, w, h, zoom);
    605     } else if (!strcmp(ev->key, "r") && ctrlPressed) {
    606         info("Pre-render 1 extra column/row with current zoom");
    607         ewk_view_pre_render_relative_radius(obj, 1);
    608     } else if (!strcmp(ev->key, "p") && ctrlPressed) {
    609         info("Pre-rendering start");
    610         ewk_view_pre_render_start(obj);
    611593    } else if (!strcmp(ev->key, "d") && ctrlPressed) {
    612594        info("Render suspended");
Note: See TracChangeset for help on using the changeset viewer.