Skip to content

Viz Implementation for OSR #2575

Closed
Closed

Description

@magreenblatt

Original report by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).


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.

[1] https://chromium.googlesource.com/chromium/src/+/master/services/viz/
[2] https://crrev.com/c/1374207

Activity

  1. magreenblatt commented on Jan 29, 2019

    @magreenblatt
    CollaboratorAuthor

    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.

  2. magreenblatt commented on Jan 29, 2019

    @magreenblatt
    CollaboratorAuthor

    Original changes by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).


    • edited description
  3. magreenblatt commented on Feb 13, 2019

    @magreenblatt
    CollaboratorAuthor

    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

  4. magreenblatt commented on Feb 15, 2019

    @magreenblatt
    CollaboratorAuthor

    @xforce_dev Thanks for the update. I'll try to give feedback next week.

  5. magreenblatt commented on Feb 22, 2019

    @magreenblatt
    CollaboratorAuthor

    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.

  6. magreenblatt commented on Feb 22, 2019

    @magreenblatt
    CollaboratorAuthor

    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.

  7. magreenblatt commented on Feb 23, 2019

    @magreenblatt
    CollaboratorAuthor

    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?

  8. magreenblatt commented on Mar 7, 2019

    @magreenblatt
    CollaboratorAuthor

    From kylechar@ on the Chromium/viz team:

    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.

  9. magreenblatt commented on Mar 7, 2019

    @magreenblatt
    CollaboratorAuthor

    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.

  10. magreenblatt commented on Mar 7, 2019

    @magreenblatt
    CollaboratorAuthor

    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)

  11. magreenblatt commented on Mar 7, 2019

    @magreenblatt
    CollaboratorAuthor

    @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.

  12. magreenblatt commented on Mar 27, 2019

    @magreenblatt
    CollaboratorAuthor

    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.

  13. magreenblatt commented on Jul 2, 2019

    @magreenblatt
    CollaboratorAuthor

    Issue #2682 was marked as a duplicate of this issue.

  14. magreenblatt commented on Jul 16, 2019

    @magreenblatt
    CollaboratorAuthor

    Issue #2722 was marked as a duplicate of this issue.

  15. magreenblatt commented on Jul 16, 2019

    @magreenblatt
    CollaboratorAuthor

    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)>>

  16. 31 remaining items

  17. magreenblatt commented on Jun 16, 2020

    @magreenblatt
    CollaboratorAuthor

    Original comment by Jon S (Bitbucket: sirbrialliance, GitHub: sirbrialliance).


    Issue #2960 was marked as a duplicate of this issue.

  18. magreenblatt commented on Nov 21, 2020

    @magreenblatt
    CollaboratorAuthor

    Original comment by Felix Faust (Bitbucket: Felix Faust).


    any news on this?

  19. magreenblatt commented on Dec 1, 2020

    @magreenblatt
    CollaboratorAuthor

    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 ?

  20. added
    osr
    on Mar 12, 2023
  21. magreenblatt commented on Apr 23, 2024

    @magreenblatt
    CollaboratorAuthor
  22. reitowo commented on Apr 24, 2024

    @reitowo
    Contributor

    Thanks! Marshall, could you backport the commit to M124 branch when possible? It was confirmed to work on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Frameworkosrtask

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions