Bug 96610

Summary: [EFL][WK2] Regression (r128163)
Product: WebKit Reporter: Regina Chung <heejin.r.chung>
Component: WebKit EFLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, gyuyoung.kim, lucas.de.marchi, rakuco, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Linux   
Attachments:
Description Flags
Patch
none
Patch none

Description Regina Chung 2012-09-13 00:06:14 PDT
While removing compile warnings r128163 changed the logic of code for entering accelerated compositing mode, resulting in never being able to enter it.
Comment 1 Regina Chung 2012-09-13 00:27:37 PDT
Created attachment 163800 [details]
Patch
Comment 2 Regina Chung 2012-09-13 00:54:34 PDT
Comment on attachment 163800 [details]
Patch

Fixes regression introduced by r128163 while removing compile warnings as intended in r128163.
Comment 3 Gyuyoung Kim 2012-09-17 02:17:55 PDT
Comment on attachment 163800 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=163800&action=review

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:501
> +    EINA_SAFETY_ON_FALSE_RETURN_VAL(!priv->evasGl, false);

Is below code is more readable instead of above one?

EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false);
Comment 4 Regina Chung 2012-09-17 03:31:07 PDT
(In reply to comment #3)
> (From update of attachment 163800 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=163800&action=review
> > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:501
> > +    EINA_SAFETY_ON_FALSE_RETURN_VAL(!priv->evasGl, false);
> Is below code is more readable instead of above one?
> EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false);

Using EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false); doesn't compile.
If we want to use EINA_SAFETY_ON_TRUE_RETURN_VAL(), we have to put !! in front of priv->evasGl.
Which one should I use?
EINA_SAFETY_ON_FALSE_RETURN_VAL(!priv->evasGl, false); or
EINA_SAFETY_ON_TRUE_RETURN_VAL(!!priv->evasGl, false);
Comment 5 Gyuyoung Kim 2012-09-17 04:26:45 PDT
(In reply to comment #4)

> Using EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false); doesn't compile.
> If we want to use EINA_SAFETY_ON_TRUE_RETURN_VAL(), we have to put !! in front of priv->evasGl.
> Which one should I use?
> EINA_SAFETY_ON_FALSE_RETURN_VAL(!priv->evasGl, false); or
> EINA_SAFETY_ON_TRUE_RETURN_VAL(!!priv->evasGl, false);

Something is strange. I succeed to compile with below code in my linux box.

EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false);

Could you check this again ?
Comment 6 Regina Chung 2012-09-17 18:49:01 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > Using EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false); doesn't compile.
> > If we want to use EINA_SAFETY_ON_TRUE_RETURN_VAL(), we have to put !! in front of priv->evasGl.
> > Which one should I use?
> > EINA_SAFETY_ON_FALSE_RETURN_VAL(!priv->evasGl, false); or
> > EINA_SAFETY_ON_TRUE_RETURN_VAL(!!priv->evasGl, false);
> Something is strange. I succeed to compile with below code in my linux box.
> EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false);
> Could you check this again ?

You have to build with --tiled-backing-store option to include that code :)
Comment 7 Gyuyoung Kim 2012-09-17 19:20:05 PDT
Comment on attachment 163800 [details]
Patch

Frankly, EINA_SAFETY_ON_NULL_RETURN_VAL is correct I think. But, it was changed due to compilation warning. So, if you need to check if priv->evasGl is null, why don't you use *if* condition explicitly ?

if (priv->evasGl) {
    EINA_LOG_DOM_WARN(_ewk_log_dom, "bla bla");
    return false;
}
Comment 8 Regina Chung 2012-09-17 19:36:54 PDT
Created attachment 164479 [details]
Patch
Comment 9 Regina Chung 2012-09-17 19:37:17 PDT
(In reply to comment #7)
> (From update of attachment 163800 [details])
> Frankly, EINA_SAFETY_ON_NULL_RETURN_VAL is correct I think. But, it was changed due to compilation warning. So, if you need to check if priv->evasGl is null, why don't you use *if* condition explicitly ?
> if (priv->evasGl) {
>     EINA_LOG_DOM_WARN(_ewk_log_dom, "bla bla");
>     return false;
> }

I agree that EINA_SAFETY_ON_NULL_RETURN_VAL is correct. Changed the code as you suggested.
Comment 10 WebKit Review Bot 2012-09-17 20:03:49 PDT
Comment on attachment 164479 [details]
Patch

Clearing flags on attachment: 164479

Committed r128844: <http://trac.webkit.org/changeset/128844>
Comment 11 WebKit Review Bot 2012-09-17 20:03:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Chris Dumez 2012-09-17 21:48:26 PDT
Comment on attachment 164479 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=164479&action=review

> Source/WebKit2/ChangeLog:3
> +        [EFL][WK2] Regression (r128163)

Please add a title after Regression (r128163):

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:-501
> -    EINA_SAFETY_ON_NULL_RETURN_VAL(priv->evasGl, false);

EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false); ?
Comment 13 Gyuyoung Kim 2012-09-17 21:57:49 PDT
(In reply to comment #12)
> (From update of attachment 164479 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=164479&action=review
> 
> > Source/WebKit2/ChangeLog:3
> > +        [EFL][WK2] Regression (r128163)
> 
> Please add a title after Regression (r128163):
> 
> > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:-501
> > -    EINA_SAFETY_ON_NULL_RETURN_VAL(priv->evasGl, false);
> 
> EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false); ?

As previous comments mentioned, EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false) makes a below build break with --tiled-backing-store option.

/home/gyuyoung/webkit/WebKit/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:501:5: error: invalid conversion from ‘Evas_GL* {aka _Evas_GL*}’ to ‘long int’ [-fpermissive]
Comment 14 Chris Dumez 2012-09-17 22:11:18 PDT
(In reply to comment #13)
> (In reply to comment #12)
> > (From update of attachment 164479 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=164479&action=review
> > 
> > > Source/WebKit2/ChangeLog:3
> > > +        [EFL][WK2] Regression (r128163)
> > 
> > Please add a title after Regression (r128163):
> > 
> > > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:-501
> > > -    EINA_SAFETY_ON_NULL_RETURN_VAL(priv->evasGl, false);
> > 
> > EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false); ?
> 
> As previous comments mentioned, EINA_SAFETY_ON_TRUE_RETURN_VAL(priv->evasGl, false) makes a below build break with --tiled-backing-store option.
> 
> /home/gyuyoung/webkit/WebKit/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:501:5: error: invalid conversion from ‘Evas_GL* {aka _Evas_GL*}’ to ‘long int’ [-fpermissive]

Maybe EINA_SAFETY_ON_TRUE_RETURN_VAL(!!priv->evasGl, false); would have worked then?
Comment 15 Gyuyoung Kim 2012-09-17 22:17:49 PDT
(In reply to comment #14)
 /home/gyuyoung/webkit/WebKit/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:501:5: error: invalid conversion from ‘Evas_GL* {aka _Evas_GL*}’ to ‘long int’ [-fpermissive]
> 
> Maybe EINA_SAFETY_ON_TRUE_RETURN_VAL(!!priv->evasGl, false); would have worked then?

As I said comment #7, I think EINA_SAFETY_ON_NULL_RETURN_VAL is more proper because this is for checking if priv->evasGL is not null. Generally, it looks EINA_SAFETY_ON_TRUE | FALSE_RETURN_VAL() are used for checking specific condition rather than checking if null. So, I thought that explicit *if* condition is better than EINA_SAFETY_ON_TRUE | FALSE_RETURN_VAL for null checking.