flypig.co.uk

List items

Items from the current list are shown below.

Gecko

1 Mar 2024 : Day 172 #
Having failed to fix the offscreen (WebView) rendering pipeline using a scalpel, over the last few days I've resorted to using a sledgehammer. What I'm now doing is essentially reverting the changes made upstream that stripped out all of the GLScreenBuffer goodness that the Sailfish WebView relied on. Unfortunately the changes aren't included in a single neat commit, so I'm having to do this by hand, copying and pasting over the changes from ESR 78 back into ESR 91.

Ever present and willing, git is happy to give me a summary of how many changes I've made so far:
$ git diff --shortstat
 11 files changed, 1012 insertions(+), 22 deletions(-)
So that's over a thousand new lines added to ESR 91. Let's break that down further to find out what's been changed:
$ git diff --numstat
38      4       gfx/gl/GLContext.cpp
59      7       gfx/gl/GLContext.h
11      0       gfx/gl/GLContextTypes.h
592     0       gfx/gl/GLScreenBuffer.cpp
171     1       gfx/gl/GLScreenBuffer.h
26      0       gfx/gl/SharedSurface.cpp
14      0       gfx/gl/SharedSurface.h
15      9       gfx/gl/SharedSurfaceEGL.cpp
4       1       gfx/gl/SharedSurfaceEGL.h
60      0       gfx/gl/SurfaceTypes.h
22      0       gfx/layers/client/TextureClientSharedSurface.h
As we can see, all of the changes are to the rendering code. That's encouraging. And the majority, as expected, are re-introducing code to the GLScreenBuffer class. In fact, not just adding code into the class, but reintroducing the class in its entirety. It's this GLScreenBuffer class that was completely removed and replaced with a class called SwapChain in the upstream transition from ESR 78 to ESR 91.

The changes to the other files are all intended to accommodate the reintroduction of GLScreenBuffer.

I could live with some big changes being made to a single file, but having to make a large number of changes to many files is really not ideal for the project. It'll contribute to the burden of maintenance and future upgrades. But my suspicion is that not all of the code in GLScreenBuffer is actually used. Rather than try to trim out the fat as I go along, my plan is to introduce everything and get the renderer to a state where it's working, then work on trimming out the unnecessary code afterwards.

Once that's done, I'll then move on to re-architecting the code to try to minimise the changes to the Gecko library itself. It may be that we can move some of the changes into the EmbedLite code, say, in a similar way to what we did with the printing changes. If that can be done, it'll make future maintenance that much easier.

That's the summary of where things are at. Now I'm heading back into the code to perform my bug fix cycle:
  1. Build code.
  2. Examine compile-time errors.
  3. Fix the first one or two erros shown.
  4. Go to step 1.
There's not much to say about all this: I fix, I compile, I examine, I fix, I compile, I examine... Describing each of the steps in any detail here would slow things down too much whilst also being even more dull than usual. So I'm going to just dive in and then summarise at the end.

[...]

After several hours of going around the bug fix cycle I've finally reached the point where the partial build completes without any compiler errors. I've added in a lot of code, not always fully understanding the purpose, but nevertheless with the intention of matching the structure and purpose of the GLScreenBuffer code from ESR 78.

Here are the final stats — for comparison — after these changes.
$ git diff --numstat
38      4       gfx/gl/GLContext.cpp
59      7       gfx/gl/GLContext.h
11      0       gfx/gl/GLContextTypes.h
590     0       gfx/gl/GLScreenBuffer.cpp
171     1       gfx/gl/GLScreenBuffer.h
301     5       gfx/gl/SharedSurface.cpp
126     3       gfx/gl/SharedSurface.h
16      10      gfx/gl/SharedSurfaceEGL.cpp
9       3       gfx/gl/SharedSurfaceEGL.h
6       4       gfx/gl/SharedSurfaceGL.cpp
3       1       gfx/gl/SharedSurfaceGL.h
60      0       gfx/gl/SurfaceTypes.h
12      0       gfx/layers/client/TextureClientSharedSurface.cpp
22      0       gfx/layers/client/TextureClientSharedSurface.h
$ git diff --shortstat
 14 files changed, 1424 insertions(+), 38 deletions(-)
Most of the changes I've made this evening seem to have been to SharedSurface.cpp. That makes sense as it seems there were many GL/EGL related calls that had been removed.

So far I've only been running quick partial builds. To find out if things are really working correctly I'll have to do a full rebuild, which will need to run overnight. So this seems like a good time to stop for the day, ready to start again in the morning.

If you'd like to read any of my other gecko diary entries, they're all available on my Gecko-dev Diary page.

Comments

Uncover Disqus comments