You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chromium is currently replacing much of the old compositor code with a new system called Viz [1].
Right now we can still use the old path, but I expect them to remove that in a not too distant future (already disabled by default on desktop platforms [2]).
So we need a 'new' OSR implementation that is based on Viz.
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).
So a quick update on this, I have to say this turns out to be for me a lot more complicated than I initially expected.
It could be just I am just missing something but oh well.
The best explaination of the changes involved was this document [1] when using Viz Compositor, CompositorFrames are now longer sent from the render to the browser, but instead sent directly to the GPU process and then compositing happens directly onto the accelerated widget inside the render process.
This basically just completely prevents the current OSR approach, where we intercept the SubmitCompositorFrame calls. What I then tried was to add a new mojo IPC call that sents compositor frame metadata (also changed to get damage rect information) on every SubmitCompositorFrame call in the renderer, but right now I am facing issues of very high latency of frames being copied from the GPU to the browser process (talking sometimes multiple seconds here), I have yet to identify what is really going on there, but oh well.
This then kind of made me realize (or let's just say I am pretty sure) that we can't really do the current approach to shared texture support, but I will think about it, as all the output device stuff including the viz::Display no longer lives in the browser process but rather the render process.
If anyone has some input on this it would be greatly appreciated, but I will continue my endeavors regardless.
My current approach can be seen here [2]
I'm not sure what the best solution is here, especially with regards to shared textures. I've asked @wesselsga (the shared textures author) for feedback as well.
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).
@magreenblatt thanks, I might just a bit in over my head with this here, but it's a great learning opportunity, digging through a lot of the chromium code and changes that are involved here.
I was however thinking about this a bit more and I think I have an idea on how to make it work, at least roughly, which I will try hopefully sometime this week.
Just want to finally finish my tests for the media access PR first (hopefully some time tonight), then I can devote more time for this.
At the end this is not immediately required, but I would personally prefer to have the Viz based version sooner rather than later, considering that the default for all desktop chrome platforms is now to use Viz.
If you want to do something similar to [having a custom SoftwareOutputDevice that owns an SkBitmap] then look at SoftwareOutputDeviceWinProxy and LayeredWindowUpdaterImpl. SoftwareOutputDeviceWinProxy draws into shared memory and then sends an IPC back to the browser process. LayeredWindowUpdaterImpl in the browser copies from shared memory to the HWND. We would definitely accept patches to make SoftwareOutputDeviceWinProxy and LayeredWindowUpdaterImpl more general base classes with windows specific implementation built on top. That way embedders could just extend the base class.
FrameSinkVideoCapturer is also potentially an option when using hardware accelerated compositing. It does readback from GL and transports the pixels to the browser process. DevTools uses it to capture tab contents in a similar way.
Also, it's worth noting that Ozone does not support software compositing but instead has the GPU process rendering directly to the target surface. That's similar to the shared surface use case in CEF.
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).
Thanks, that is actually quite helpful, I came across those before, but didn't quite understand how they specifically relate to some things, I am currently working on the Chromium 74 branch update, but will continue work on this again very soon (If all goes well sometime this weekend actually)
@xforce_dev Thanks! I think it would be nice to trial the SoftwareOutputDeviceWinProxy and LayeredWindowUpdaterImpl generalization approach in CEF, and then submit those changes back to Chromium if it works out.
Original comment by Qiang Li (Bitbucket: Qiang Li).
Now I am using the latest version 86.0.241(Cefsharp.Wpf), facing the same problem, expected this version can resolve but i am wrong.
And I am search a lot of same issue but the result was end up with nothing conclusive.
Finally I step by step debuged and found that when closing the window which browser is in, sometime the page stacked( process is killed), so I thinked if window's close method caused the irregular killing? And I override the closing method as follows:
First, My page's image is below:
1: Window1View -> Window1Model -> browserModel
2: Window2View -> Window2Model -> browserModel
the browserModel is moving from one to another bettwen window1 and 2
Use this way I haven't see the above process killed problem (cef's log was no error even if page stacked)
private void Window1_OnClosing(object sender, CancelEventArgs e)
{
// when click close button not to close, just hide the window1, and browserModel is reused in window2
if (sender.As<Window1View>().Visibility == Visibility.Visible)
{
sender.As<Window1View>().Visibility = Visibility.Hidden;
e.Cancel = true;
Window2Model.browserModel = Window1Model.browserModel;
Window2View.Show();
}
}
But I don't know if it is the right way to resolve the problem, anyone can give same advice ?
Activity
magreenblatt commentedon Jan 29, 2019
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).
Was sick last week, but I started working on this and hope to have an initial PR ready at the end of this week or next week.
magreenblatt commentedon Jan 29, 2019
Original changes by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).
magreenblatt commentedon Feb 13, 2019
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).
So a quick update on this, I have to say this turns out to be for me a lot more complicated than I initially expected.
It could be just I am just missing something but oh well.
The best explaination of the changes involved was this document [1] when using Viz Compositor, CompositorFrames are now longer sent from the render to the browser, but instead sent directly to the GPU process and then compositing happens directly onto the accelerated widget inside the render process.
This basically just completely prevents the current OSR approach, where we intercept the SubmitCompositorFrame calls. What I then tried was to add a new mojo IPC call that sents compositor frame metadata (also changed to get damage rect information) on every SubmitCompositorFrame call in the renderer, but right now I am facing issues of very high latency of frames being copied from the GPU to the browser process (talking sometimes multiple seconds here), I have yet to identify what is really going on there, but oh well.
This then kind of made me realize (or let's just say I am pretty sure) that we can't really do the current approach to shared texture support, but I will think about it, as all the output device stuff including the viz::Display no longer lives in the browser process but rather the render process.
If anyone has some input on this it would be greatly appreciated, but I will continue my endeavors regardless.
My current approach can be seen here [2]
[1] https://docs.google.com/document/d/1tFdX9StXn9do31hddfLuZd0KJ_dBFgtYmxgvGKxd0rY/edit
[2] https://bitbucket.org/xforce_dev/cef/commits/1e4bda98e58ca83c12176be33b8ee1a98d54fce9
magreenblatt commentedon Feb 15, 2019
@xforce_dev Thanks for the update. I'll try to give feedback next week.
magreenblatt commentedon Feb 22, 2019
I'm not sure what the best solution is here, especially with regards to shared textures. I've asked @wesselsga (the shared textures author) for feedback as well.
magreenblatt commentedon Feb 22, 2019
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).
@magreenblatt thanks, I might just a bit in over my head with this here, but it's a great learning opportunity, digging through a lot of the chromium code and changes that are involved here.
I was however thinking about this a bit more and I think I have an idea on how to make it work, at least roughly, which I will try hopefully sometime this week.
Just want to finally finish my tests for the media access PR first (hopefully some time tonight), then I can devote more time for this.
At the end this is not immediately required, but I would personally prefer to have the Viz based version sooner rather than later, considering that the default for all desktop chrome platforms is now to use Viz.
magreenblatt commentedon Feb 23, 2019
Original comment by Jakub Głuszkiewicz (Bitbucket: Jakub, GitHub: Jakub).
Guys do u think that software rendering path in osr and shared textures path will become obsolete soon in future versions?
magreenblatt commentedon Mar 7, 2019
From kylechar@ on the Chromium/viz team:
magreenblatt commentedon Mar 7, 2019
Also, it's worth noting that Ozone does not support software compositing but instead has the GPU process rendering directly to the target surface. That's similar to the shared surface use case in CEF.
magreenblatt commentedon Mar 7, 2019
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).
Thanks, that is actually quite helpful, I came across those before, but didn't quite understand how they specifically relate to some things, I am currently working on the Chromium 74 branch update, but will continue work on this again very soon (If all goes well sometime this weekend actually)
magreenblatt commentedon Mar 7, 2019
@xforce_dev Thanks! I think it would be nice to trial the SoftwareOutputDeviceWinProxy and LayeredWindowUpdaterImpl generalization approach in CEF, and then submit those changes back to Chromium if it works out.
magreenblatt commentedon Mar 27, 2019
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).
PR: https://bitbucket.org/chromiumembedded/cef/pull-requests/226
Although that is still WIP and just the finished stuff I had locally everything seems to be working fine,
except for shared texture, which I removed temporarily until my local new implementation is ready.
magreenblatt commentedon Jul 2, 2019
Issue #2682 was marked as a duplicate of this issue.
magreenblatt commentedon Jul 16, 2019
Issue #2722 was marked as a duplicate of this issue.
magreenblatt commentedon Jul 16, 2019
Update to Chromium version 76.0.3809.0 (#665002)
OSR tests will be fixed by a follow-up merge of Viz support (see issue #2575).
→ <<cset cc0db5f166b6 (bb)>>
31 remaining items
magreenblatt commentedon Jun 16, 2020
Original comment by Jon S (Bitbucket: sirbrialliance, GitHub: sirbrialliance).
Issue #2960 was marked as a duplicate of this issue.
magreenblatt commentedon Nov 21, 2020
Original comment by Felix Faust (Bitbucket: Felix Faust).
any news on this?
magreenblatt commentedon Dec 1, 2020
Original comment by Qiang Li (Bitbucket: Qiang Li).
Now I am using the latest version 86.0.241(Cefsharp.Wpf), facing the same problem, expected this version can resolve but i am wrong.
And I am search a lot of same issue but the result was end up with nothing conclusive.
Finally I step by step debuged and found that when closing the window which browser is in, sometime the page stacked( process is killed), so I thinked if window's close method caused the irregular killing? And I override the closing method as follows:
First, My page's image is below:
1: Window1View -> Window1Model -> browserModel
2: Window2View -> Window2Model -> browserModel
the browserModel is moving from one to another bettwen window1 and 2
Use this way I haven't see the above process killed problem (cef's log was no error even if page stacked)
But I don't know if it is the right way to resolve the problem, anyone can give same advice ?
Update to Chromium version 76.0.3809.0 (#665002)
Add initial Viz implementation for OSR (see issue chromiumembedded#2575…
Remove unused GetCompositor method and fix macOS compile error (see i…
Remove unused GetCompositor method and fix macOS compile error (see i…
magreenblatt commentedon Apr 23, 2024
Related PR for OnAcceleratedPaint support: https://bitbucket.org/chromiumembedded/cef/pull-requests/734
reitowo commentedon Apr 24, 2024
Thanks! Marshall, could you backport the commit to M124 branch when possible? It was confirmed to work on that.
cefclient: osr: Fix compile errors with binary distribution (see #2575)
osr: Implement shared texture support (fixes #1006, fixes #2575)
win: osr: Fix GPU mutex logic (see #2575)
win: osr: Fix GPU mutex logic (see #2575)