Source/WebKit/efl/ewk/ewk_view.cpp
Eina_Bool ewk_view_pre_render_region(Evas_Object* o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom)
{
    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api->pre_render_region, EINA_FALSE);
    float cur_zoom;
    Evas_Coord cw, ch;

    /* 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->animated_zoom.animator)
        return EINA_FALSE;

    cur_zoom = ewk_frame_zoom_get(sd->main_frame);

    if (cur_zoom < 0.00001)
        return EINA_FALSE;
    if (!ewk_frame_contents_size_get(sd->main_frame, &cw, &ch))
        return EINA_FALSE;

    cw *= zoom / cur_zoom;
    ch *= zoom / cur_zoom;
    DBG("region %d,%d+%dx%d @ %f contents=%dx%d", x, y, w, h, zoom, cw, ch);

    if (x + w > cw)
        w = cw - x;

    if (y + h > ch)
        h = ch - y;

    if (x < 0) {
        w += x;
        x = 0;
    }
    if (y < 0) {
        h += y;
        y = 0;
    }

    return sd->api->pre_render_region(sd, x, y, w, h, zoom);
}
/**
 * Hint 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 not supported, etc).
 *
 * @see ewk_view_pre_render_cancel()
 */
Hint 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 not supported, etc).


Hint 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 not supported etc ) .
Eina_Bool ewk_view_pre_render_region(Evas_Object* o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom)
{
    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
    EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api->pre_render_region, EINA_FALSE);
    float cur_zoom;
    Evas_Coord cw, ch;
    if (priv->animated_zoom.animator)
        return EINA_FALSE;
    cur_zoom = ewk_frame_zoom_get(sd->main_frame);
    if (cur_zoom < 0.00001)
        return EINA_FALSE;
    if (!ewk_frame_contents_size_get(sd->main_frame, &cw, &ch))
        return EINA_FALSE;
    cw *= zoom / cur_zoom;
    ch *= zoom / cur_zoom;
    DBG("region %d,%d+%dx%d @ %f contents=%dx%d", x, y, w, h, zoom, cw, ch);
    if (x + w > cw)
        w = cw - x;
    if (y + h > ch)
        h = ch - y;
    if (x < 0) {
        w += x;
        x = 0;
    }
    if (y < 0) {
        h += y;
        y = 0;
    }
    return sd->api->pre_render_region(sd, x, y, w, h, zoom);
}
Eina_Bool ewk_view_pre_render_region ( Evas_Object * o , Evas_Coord x , Evas_Coord y , Evas_Coord w , Evas_Coord h , float zoom ) { EWK_VIEW_SD_GET_OR_RETURN ( o , sd , EINA_FALSE ) ; EWK_VIEW_PRIV_GET_OR_RETURN ( sd , priv , EINA_FALSE ) ; EINA_SAFETY_ON_NULL_RETURN_VAL ( sd -> api -> pre_render_region , EINA_FALSE ) ; float cur_zoom ; Evas_Coord cw , ch ; if ( priv -> animated_zoom . animator ) return EINA_FALSE ; cur_zoom = ewk_frame_zoom_get ( sd -> main_frame ) ; if ( cur_zoom < 0.00001 ) return EINA_FALSE ; if ( ! ewk_frame_contents_size_get ( sd -> main_frame , & cw , & ch ) ) return EINA_FALSE ; cw *= zoom / cur_zoom ; ch *= zoom / cur_zoom ; DBG ( " " , x , y , w , h , zoom , cw , ch ) ; if ( x + w > cw ) w = cw - x ; if ( y + h > ch ) h = ch - y ; if ( x < 0 ) { w += x ; x = 0 ; } if ( y < 0 ) { h += y ; y = 0 ; } return sd -> api -> pre_render_region ( sd , x , y , w , h , zoom ) ; }
Hint engine to pre-render region.
Hint engine to pre - render region .
/* When doing animated zoom it's not possible to call pre-render since it
     * would screw up parameters that animation is currently using
     */