RFR: 8090547: Allow for transparent backgrounds in WebView [v4]

Jose Pereda jpereda at openjdk.java.net
Fri Aug 27 15:48:28 UTC 2021


On Fri, 27 Aug 2021 13:06:18 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> Yes, that makes total sense. 
>> 
>> In fact, there was also the need to add a new [method](https://github.com/openjdk/jfx/pull/563/files#diff-b80bc720bf639cde38c5197a7619561221abcd34fb9ff7a933f4b932a1f36735R2579) in `WebPage` to read back the color from the int value, so I was thinking that it would be better to add a new method to `WebPage` like:
>> 
>> 
>> public void setBackgroundColor(Color backgroundColor) {
>>      int int32Color = WebPage.getBackgroundInt32Color(backgroundColor);
>>      setBackgroundColor(int32Color);
>> }
>> 
>> private static int getBackgroundInt32Color(Color color) {
>> // implementation similar to Color::hashCode
>> }
>> 
>> and from webView we could simply do:
>> 
>> page.setBackgroundColor(color);
>> 
>> 
>> Thoughts?
>
> Yes, this seems a good solution.

I've pushed it. 

Now we have these three public methods:


public void setBackgroundColor(long frameID, int backgroundColor);
public void setBackgroundColor(int backgroundColor);
public void setBackgroundColor(Color backgroundColor);


but we only call the last one from WebView to call the second one from WebPage. I don't see any call done to the first one.

-------------

PR: https://git.openjdk.java.net/jfx/pull/563


More information about the openjfx-dev mailing list