flypig.co.uk

List items

Items from the current list are shown below.

Blog

1 Jun 2024 : Day 250 #
The build completed overnight and since then I've also cleaned up and rebuilt all of the other components as well: qtmozembed, embedlite-components, sailfish-browser and sailfish-components-webview.

After installing them all on my development phone both the browser and the WebView are now working correctly and the additional debug prints I added for testing are no longer showing in the console output. So things are looking in decent shape. I'm now ready for this edit-rebuild-test cycle that I've been going on about for the last few days.

To prove the point (to myself, as much as to anyone else) that this can be a tight cycle, I'm going to start off small. The changes to mCaps look like they may not be necessary, so let's see what happens if I remove them. To do this I've made the following changes to the code.
 git diff
diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp
index 03ee715a8f35..9e07257837f8 100644
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -288,8 +288,6 @@ GLContext::GLContext(const GLContextDesc& desc, GLContext* 
    sharedContext,
       mSharedContext(sharedContext),
       mWorkAroundDriverBugs(
           StaticPrefs::gfx_work_around_driver_bugs_AtStartup()) {
-  mCaps.any = true;
-  mCaps.color = true;
   mOwningThreadId = PlatformThread::CurrentId();
   MOZ_ALWAYS_TRUE(sCurrentContext.init());
   sCurrentContext.set(0);
@@ -952,13 +950,6 @@ bool GLContext::InitImpl() {
   // We're ready for final setup.
   fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
 
-  // TODO: Remove SurfaceCaps::any.
-  if (mCaps.any) {
-    mCaps.any = false;
-    mCaps.color = true;
-    mCaps.alpha = false;
-  }
-
   MOZ_GL_ASSERT(this, IsCurrent());
 
   if (ShouldSpew() && IsExtensionSupported(KHR_debug)) {
Having made these changes I can now perform a quick partial build directly from inside the build target using the following commands:
$ make -j1 -C obj-build-mer-qt-xr/gfx/gl/
$ make -j16 -C `pwd`/obj-build-mer-qt-xr/toolkit
$ strip obj-build-mer-qt-xr/toolkit/library/build/libxul.so
This gives us a new libxul.so file from which I've stripped the debug output in order to keep the filesize down. I've transferred this new library over to my phone and am now checking both the browser and the WebView to see whether I can spot any regressions following the changes:
sailfish-browser
harbour-webview
After running both of these and checking that the rendering is working correctly, I don't see any problems. Both are working nicely. So these changes look good and I can add them to the commit. Adding these changes to the commit will actually be reversing some changes that are in the commit already, so this will make the final patch simpler.

Next up, GLContext::GuaranteeResolve() looks unused, so I've removed it. I also notice that CreateScreenBufferImpl() only ever gets called by CreateScreenBuffer() so the two may as well be combined into a single method.

Finally there are some changes to GLContext::fCopyTexImage2D() which may or may not be important. I'm going to revert them to see whether that breaks anything.

Having made these changes it's now time to move to step two of the edit-rebuild-test cycle.
$ make -j1 -C obj-build-mer-qt-xr/gfx/gl/
$ make -j16 -C `pwd`/obj-build-mer-qt-xr/toolkit
$ strip obj-build-mer-qt-xr/toolkit/library/build/libxul.so
This is the same as before, which is why this is a cycle. With the freshly built library installed on my phone, time to check both the browser and the WebView once again for any potential regressions:
sailfish-browser
harbour-webview
All working! Great! Next, I notice that sSafeModeInitialized is set to true in gfxPlatform.cpp. I suspect this was a change I made back when I was basically trying everything and anything I could to get the code to work. But the upstream code has it set to false and the eventual patch will be simpler if I can leave it in this original state of being set to false. So I've made the following change to reflect this:
 git diff
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index 9c217dfc81e9..79e261e54f83 100644
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2045,7 +2045,7 @@ BackendType gfxPlatform::GetBackendPref(const char* 
    aBackendPrefName,
 }
 
 bool gfxPlatform::InSafeMode() {
-  static bool sSafeModeInitialized = true;
+  static bool sSafeModeInitialized = false;
   static bool sInSafeMode = false;
 
   if (!sSafeModeInitialized) {
Time now for step two of the edit-rebuild-test cycle again.

All working!

All of these changes have now been tested and committed, I need to continue working with these small changes and tests tomorrow and until the commit that fixes the offscreen rendering pipeline is looking more manageable in terms of size. Unfortunately as we've discussed before, the partial builds I've been doing mess up the debugging symbols and in fact I've been stripping the debug symbols from the library so as to allow it to be copied to my phone over the network more rapidly. So I'm going to run another full build overnight to get the debug symbols back.
$ sfdk build -d --with git_workaround
So with that running overnight, that's it for today. Tomorrow I'll be back to simplifying the code.

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