Bug 73015 - [EFL] Add alpha channel API to single and tiled backing store.
Summary: [EFL] Add alpha channel API to single and tiled backing store.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-23 03:56 PST by JungJik Lee
Modified: 2011-11-30 18:40 PST (History)
5 users (show)

See Also:


Attachments
proposal_patch (8.06 KB, patch)
2011-11-23 03:56 PST, JungJik Lee
no flags Details | Formatted Diff | Diff
minor_edit.patch (8.06 KB, patch)
2011-11-23 04:02 PST, JungJik Lee
no flags Details | Formatted Diff | Diff
rebased patch (8.06 KB, patch)
2011-11-23 06:03 PST, JungJik Lee
no flags Details | Formatted Diff | Diff
restore the API name (5.84 KB, patch)
2011-11-28 08:47 PST, JungJik Lee
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description JungJik Lee 2011-11-23 03:56:56 PST
Created attachment 116340 [details]
proposal_patch

Rename bg_color_set API to alpha_set because it only uses alpha channel in parameters
And new alpha_set API is added into tiled backing store.
Alpha_set API is for turning the alpha channel on/off on the tiled or single backing store objects.
Comment 1 WebKit Review Bot 2011-11-23 04:00:06 PST
Attachment 116340 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/efl/ChangeLog', u'Source/Web..." exit_code: 1

Source/WebKit/efl/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 2 JungJik Lee 2011-11-23 04:02:10 PST
Created attachment 116341 [details]
minor_edit.patch
Comment 3 JungJik Lee 2011-11-23 06:03:50 PST
Created attachment 116347 [details]
rebased patch

attach new rebased patch.
Comment 4 Gyuyoung Kim 2011-11-23 16:48:47 PST
Comment on attachment 116347 [details]
rebased patch

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

> Source/WebKit/efl/ewk/ewk_tiled_backing_store.h:103
> +void ewk_tiled_backing_store_alpha_set(Evas_Object* o, Eina_Bool has_alpha);

In EFL style, it looks they don't use prefix for Eina_Bool type as below,

ewk_view_setting_auto_load_images_set(Evas_Object *o, Eina_Bool automatic);
ewk_view_zoom_weak_smooth_scale_set(Evas_Object *o, Eina_Bool smooth_scale);
ewk_view_text_matches_highlight_set(Evas_Object *o, Eina_Bool highlight);

So, it seems it is better to use "Eina_Bool alpha" instead of "Eina_Bool has_alpha"
Comment 5 KwangHyuk 2011-11-23 17:36:36 PST
(In reply to comment #4)
> (From update of attachment 116347 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=116347&action=review
> 
> > Source/WebKit/efl/ewk/ewk_tiled_backing_store.h:103
> > +void ewk_tiled_backing_store_alpha_set(Evas_Object* o, Eina_Bool has_alpha);
> 
> In EFL style, it looks they don't use prefix for Eina_Bool type as below,
> 
> ewk_view_setting_auto_load_images_set(Evas_Object *o, Eina_Bool automatic);
> ewk_view_zoom_weak_smooth_scale_set(Evas_Object *o, Eina_Bool smooth_scale);
> ewk_view_text_matches_highlight_set(Evas_Object *o, Eina_Bool highlight);
> 
> So, it seems it is better to use "Eina_Bool alpha" instead of "Eina_Bool has_alpha"

IMO, Jungjik might refer the evas_object api.
evas_object_image_alpha_set (Evas_Object *obj, Eina_Bool has_alpha);

As a result, I agree with api name Jungjik proposed. :)
Comment 6 KwangHyuk 2011-11-23 17:46:56 PST
LGTM because it will works.

But, may be next time, I suggest you to consider the ewk_tiled_backing_store_alpha_set API's current implementation.
I can't make sure whether current implementation is good enough for the case when this API is called because it just set the flag and no instant action for the tiles inside of viewport area.
Comment 7 Gyuyoung Kim 2011-11-24 23:58:53 PST
Comment on attachment 116347 [details]
rebased patch

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

>>> Source/WebKit/efl/ewk/ewk_tiled_backing_store.h:103
>>> +void ewk_tiled_backing_store_alpha_set(Evas_Object* o, Eina_Bool has_alpha);
>> 
>> In EFL style, it looks they don't use prefix for Eina_Bool type as below,
>> 
>> ewk_view_setting_auto_load_images_set(Evas_Object *o, Eina_Bool automatic);
>> ewk_view_zoom_weak_smooth_scale_set(Evas_Object *o, Eina_Bool smooth_scale);
>> ewk_view_text_matches_highlight_set(Evas_Object *o, Eina_Bool highlight);
>> 
>> So, it seems it is better to use "Eina_Bool alpha" instead of "Eina_Bool has_alpha"
> 
> IMO, Jungjik might refer the evas_object api.
> evas_object_image_alpha_set (Evas_Object *obj, Eina_Bool has_alpha);
> 
> As a result, I agree with api name Jungjik proposed. :)

Ok, Looks good.
Comment 8 Raphael Kubo da Costa (:rakuco) 2011-11-25 05:00:36 PST
Comment on attachment 116347 [details]
rebased patch

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

At first glance, this looks like a change for change's sake. I agree that currently the other parameters of bg_color_set are not being used, however we don't know what child implementations might want to do, so I think it is better to err on the safe side and provide more parameters, not less, here. If you provide a function to set alpha, it doesn't really hurt to pass r, g and b with it.

> Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp:211
> +    evas_object_image_alpha_set(item->tile->image, priv->view.tile.hasAlpha);

Was there any problem you noticed with this not being set before?
Comment 9 JungJik Lee 2011-11-27 20:58:53 PST
Widget does not have exact rectangle shape, some of them has round shape. so it needs alpha set API not to show background image.
If you do not want to rename the API, I will change them. However IMO, I like to have the exact working code and naming. when it need to be changed, it would be better to change them at that moment and refactor more frequently if it is possible.
Comment 10 Raphael Kubo da Costa (:rakuco) 2011-11-28 05:11:41 PST
Please use some context in your replies so it's easier to see what part of previous comments you're referring to.

(In reply to comment #9)
> Widget does not have exact rectangle shape, some of them has round shape. so it needs alpha set API not to show background image.

OK.

> If you do not want to rename the API, I will change them. However IMO, I like to have the exact working code and naming. when it need to be changed, it would be better to change them at that moment and refactor more frequently if it is possible.

That makes sense if we consider our own needs, I'm trying to think from a third party developer's perspective, who may need to subclass one of the backing store smart objects and will then be unable to reimplement some part of the API in case he needs to.
Comment 11 JungJik Lee 2011-11-28 07:56:05 PST
(In reply to comment #10)
> Please use some context in your replies so it's easier to see what part of previous comments you're referring to.
Next time I will reply the answer more carefully.
> 
> (In reply to comment #9)
> > Widget does not have exact rectangle shape, some of them has round shape. so it needs alpha set API not to show background image.
> 
> OK.
> 
> > If you do not want to rename the API, I will change them. However IMO, I like to have the exact working code and naming. when it need to be changed, it would be better to change them at that moment and refactor more frequently if it is possible.
> 
> That makes sense if we consider our own needs, I'm trying to think from a third party developer's perspective, who may need to subclass one of the backing store smart objects and will then be unable to reimplement some part of the API in case he needs to.
I understand your thought and if you think the API is subclassing API, I think the function prototype should be preserved. I misunderstood it. I will recover the API name.
Comment 12 JungJik Lee 2011-11-28 08:47:23 PST
Created attachment 116765 [details]
restore the API name

Add bg_color_set API into tiled backing store and restore the API name from the previous patch.
Comment 13 Raphael Kubo da Costa (:rakuco) 2011-11-28 19:09:56 PST
LGTM.
Comment 14 Chang Shu 2011-11-30 08:55:22 PST
Comment on attachment 116765 [details]
restore the API name

LGTM
Comment 15 WebKit Review Bot 2011-11-30 18:40:42 PST
Comment on attachment 116765 [details]
restore the API name

Clearing flags on attachment: 116765

Committed r101585: <http://trac.webkit.org/changeset/101585>
Comment 16 WebKit Review Bot 2011-11-30 18:40:47 PST
All reviewed patches have been landed.  Closing bug.