flypig.co.uk

List items

Items from the current list are shown below.

Gecko

5 Sep 2023 : Day 20 #
This morning I woke up to a bunch more errors. Some are because of mistakes I made in my code changes yesterday; others are new errors but caused by the same underlying reason.
186:17.08 In file included from ${PROJECT}/obj-build-mer-qt-xr/dist/include/mozilla/Span.h:37,
[...]
186:17.08                  from ${PROJECT}/gecko-dev/gfx/layers/Layers.h:16,
186:17.08                  from ${PROJECT}/gecko-dev/mobile/sailfishos/embedthread/
                                EmbedLiteCompositorBridgeParent.h:9,
186:17.08                  from ${PROJECT}/gecko-dev/mobile/sailfishos/
                                embedthread/EmbedLiteCompositorBridgeParent.cpp:8:
186:17.08 ${PROJECT}/obj-build-mer-qt-xr/dist/include/mozilla/UniquePtr.h:274:14:
          note: candidate: ‘mozilla::UniquePtr& mozilla::UniquePtr::
          operator=(std::nullptr_t) [with T = mozilla::gl::SwapChain;
          D = mozilla::DefaultDelete]’
186:17.08    UniquePtr& operator=(decltype(nullptr)) {
186:17.08               ^~~~~~~~
186:17.08 ${PROJECT}/obj-build-mer-qt-xr/dist/include/mozilla/UniquePtr.h:274:14:
          note:   no known conversion for argument 1 from ‘std::remove_reference
          ::type’ {aka ‘mozilla::gl::SwapChain*’} to
          ‘std::nullptr_t’
186:17.08 ${PROJECT}/gecko-dev/mobile/sailfishos/embedthread/
          EmbedLiteCompositorBridgeParent.cpp:139:5: error: ‘mSwapChain’ was not
          declared in this scope
186:17.08      mSwapChain.mFactory = std::move(factory);
186:17.08      ^~~~~~~~~~
186:17.08 ${PROJECT}/gecko-dev/mobile/sailfishos/embedthread/
          EmbedLiteCompositorBridgeParent.cpp:139:5: note: suggested alternative:
          ‘swapChain’
186:17.08      mSwapChain.mFactory = std::move(factory);
186:17.08      ^~~~~~~~~~
186:17.08      swapChain
186:17.08 ${PROJECT}/gecko-dev/mobile/sailfishos/embedthread/
          EmbedLiteCompositorBridgeParent.cpp: In member function ‘virtual void 
          mozilla::embedlite::EmbedLiteCompositorBridgeParent::CompositeToDefaultTarget(
          mozilla::layers::PCompositorBridgeParent::VsyncId)’:
186:17.09 ${PROJECT}/gecko-dev/mobile/sailfishos/embedthread/
          EmbedLiteCompositorBridgeParent.cpp:158:18: error: ‘class
          mozilla::gl::GLContext’ has no member named ‘OffscreenSize’;
          did you mean ‘IsOffscreen’?
186:17.09      if (context->OffscreenSize() != mEGLSurfaceSize && !context->ResizeOffscreen(mEGLSurfaceSize)) {
186:17.09                   ^~~~~~~~~~~~~
186:17.09                   IsOffscreen
186:17.09 ${PROJECT}/gecko-dev/mobile/sailfishos/embedthread/
          EmbedLiteCompositorBridgeParent.cpp:158:66: error: ‘class
          mozilla::gl::GLContext’ has no member named ‘ResizeOffscreen’;
          did you mean ‘IsOffscreen’?
186:17.09      if (context->OffscreenSize() != mEGLSurfaceSize && !context->ResizeOffscreen(mEGLSurfaceSize)) {
186:17.09                                                                   ^~~~~~~~~~~~~~~
186:17.09                                                                   IsOffscreen
[...]
Looking at this, I've decided to change my approach. I was hoping to make minimal changes to the new SwapChain class, but if I keep all the changes on the EmbedLite side I'll end up with duplicated code as well as code that really should belong inside SwapChain. So with the benefit of hindsight I'm now going to go in and make some changes that are more intrusive to the gecko code as well.

Practically speaking this will ultimately mean more code in a patch (messy) rather than in the EmbedLite code (clean). But between yesterday and today I spent so much effort jumping through hoops trying to get access to the parameters I need, that the balance of benefit from not changing the gecko code has tipped the other way.

I've also concluded that I can't just use the SwapChain::Acquire() method in place of GLScreenBuffer::PublishFrame(). In retrospect this is really obvious. But it means that I'll have to replicate the missing functionality to go alongside SwapChain::Acquire() to complete the publish step.

Making these changes has been a brain-strain for a number of reasons. Primarily because I don't know what I'm doing, but also because I'm doing this "blind". I can't test execution of the code, the best I can hope to test at this stage is that it compiles. And even the compile step takes too long for me to cycle at any speed.

After making all these changes I've now got to the stage where it's plausible it might compile. But that's all I can do for today, I'll have to wait until tomorrow to find out whether it does or not.

For all the other posts, check out my full Gecko Dev Diary.

Comments

Uncover Disqus comments