CEF 2840: OnPaint call with previous width and height on Mac

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF 2840: OnPaint call with previous width and height on Mac

Postby aasmagarg » Sat Nov 19, 2016 2:50 am

Hi,

I have integrated CEF 2840 with my application. I am running into one issue on MacOS. On changing the size of browser view in OSR mode, I am calling WasResized on BrowserHost which calls GetViewSize(). Then I am expecting OnPaint call with the size I am setting in GetViewSize(). Instead, I am getting the previous width and height.

I understand that OnPaint comes asynchronously and that's why I am getting call for the previous size. But why I am not getting OnPaint call for the recent size as well ?

Thanks & Regards,
Aasma Garg
aasmagarg
Techie
 
Posts: 22
Joined: Sun Mar 20, 2016 11:42 pm

Re: CEF 2840: OnPaint call with previous width and height on

Postby magreenblatt » Sat Nov 19, 2016 11:43 am

Does the problem reproduce in cefclient when running with '--off-screen-rendering-enabled'?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF 2840: OnPaint call with previous width and height on

Postby aasmagarg » Sun Nov 20, 2016 11:23 pm

No, the problem is not reproducible with the cefclient app in OSR mode.
aasmagarg
Techie
 
Posts: 22
Joined: Sun Mar 20, 2016 11:42 pm

Re: CEF 2840: OnPaint call with previous width and height on

Postby magreenblatt » Sun Nov 20, 2016 11:34 pm

Since it works in cefclient it's likely an issue with your implementation. You should take a close look at how your implementation differs from cefclient's.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF 2840: OnPaint call with previous width and height on

Postby aasmagarg » Wed Nov 30, 2016 3:31 am

magreenblatt wrote:Does the problem reproduce in cefclient when running with '--off-screen-rendering-enabled'?

Issue is reproducible in CefClient Application with CEF version 2840. I guess I have checked in some other Cef version. Apologies for that.

And after Debugging I found the cause.
In the commit shown here https://bitbucket.org/chromiumembedded/cef/diff/libcef/browser/osr/render_widget_host_view_osr.cc?diff2=a60bb077a398&at=2924
OnSwapCompositorFrame function has been modified which uses browserCompositor on Mac platform which calls BrowserCompositorMac::SwapCompositorFrame defined in browser_compositor_view_mac.mm. This function is resetting the root_layer bounds to the previous width and height (Corresponding commit in chromium : https://chromium.googlesource.com/experimental/chromium/src/+/9e8481c2e211439771d0634043d2addf9fe7b4ec%5E%21/#F1 ) Prior to this, this was not getting set. It was just calling

Code: Select all
delegated_frame_host_->SwapDelegatedFrame(output_surface_id,
                                            std::move(frame));

After this when we get a call on WasResized function, it says width has not changed on comparing with the old_params and it does not send ViewMsg_Resize. Attaching snapshot for the issue:
CefClient_OSR.png
CefClient_OSR.png (91.69 KiB) Viewed 9313 times


Regards,
Aasma Garg
aasmagarg
Techie
 
Posts: 22
Joined: Sun Mar 20, 2016 11:42 pm

Re: CEF 2840: OnPaint call with previous width and height on

Postby magreenblatt » Wed Nov 30, 2016 12:48 pm

Please add a bug. Include your reproduction steps, a description of the problem and a link to this forum post.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF 2840: OnPaint call with previous width and height on

Postby aasmagarg » Wed Nov 30, 2016 11:59 pm

aasmagarg
Techie
 
Posts: 22
Joined: Sun Mar 20, 2016 11:42 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 47 guests