Actually, it is (or was) possible to capture Skia picture (.skp) files with Chrome Tracing <https://www.chromium.org/developers/how-tos/trace-event-profiling-tool/saving-skp-s-from-chromium/>. While this is not a programmatic method (and it's been many years since I tried it), it may give you some idea of how to implement it.
Stephen On Tue, Apr 2, 2024 at 3:09 PM Vladimir Levin <vmp...@chromium.org> wrote: > Hey Steven, > > I don't think there is any way you would be able to get the Skia commands > without modifying the code. Traces don't typically contain the necessary > draw commands. There are a few places you can get those commands, mostly in > the cc directory, or thereabouts. > > I recommend watching Life of a Pixel > <https://www.youtube.com/watch?v=K2QHdgAKP-s> which goes into how the > rendering works, and also at which point the DisplayItems become Skia > commands. I'd start looking at around paint op buffer serialization > <https://source.chromium.org/chromium/chromium/src/+/main:cc/paint/paint_op_buffer_serializer.h> > which > serializes commands to a buffer (for out of process rasterization), but in > theory can be changed to send commands to a different location. You'll run > into problems with things like images (and fonts?) which are not serialized > into a buffer but transferred via other means, so you'd have to write some > code specific to those. As a disclaimer, there may be better places to > intercept these commands as well, like at main -> compositor commit time, > but there's less of this machinery already set up there so more would have > to be written. > > Hope this helps, > Vlad > > On Mon, Apr 1, 2024 at 10:32 AM Steven Whelan <stevenwhela...@gmail.com> > wrote: > >> Hi >> we are working on Remote Browser Isolation. I want to capture SKIA >> commands from the remote Chromium Browser and replay it on the client >> browser. >> I have gone through the Rendering Pipeline of Chromium as per this >> answer on stack overflow- >> >> https://stackoverflow.com/questions/60293524/how-to-intercept-skia-draw-commands-from-chromium-browser >> >> But I am still not sure where to do the changes in Chromium open source >> code >> >> Can someone please suggest? >> >> Also, is modifying Chromium source code the only way to capture the >> commands in the right way? >> Can these not be extracted from trace.json ? >> >> Thanks >> >> -- >> You received this message because you are subscribed to the Google Groups >> "blink-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to blink-dev+unsubscr...@chromium.org. >> To view this discussion on the web visit >> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/89338a39-65f3-4997-b6d5-e44a57aef2een%40chromium.org >> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/89338a39-65f3-4997-b6d5-e44a57aef2een%40chromium.org?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "blink-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to blink-dev+unsubscr...@chromium.org. > To view this discussion on the web visit > https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADsXd2Pj37djq5u_EzFF3inOaTAooRFFV8Hg0M8YK1AX0kvR-Q%40mail.gmail.com > <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADsXd2Pj37djq5u_EzFF3inOaTAooRFFV8Hg0M8YK1AX0kvR-Q%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscr...@chromium.org. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADNavw7kM1GxDPzShFVVibmaC17GFGeH7hvm0OrpKVSa7y7v0Q%40mail.gmail.com.