mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 15:26:07 +00:00

The RenderBackend can be sent an `invalidate_rendered_frame` flag to indicate that the current rendered frame is invalid. This is useful when the platform requires a render, eg when starting or resuming the app on Android. Upon receiving this flag, the render backend will set a variable `doc.rendered_frame_is_valid = false`. Later on it will decide to skip rendering only if this variable is true, so by setting the invalidate flag we should be able to ensure the next render will occur. However, the RenderBackend also tries to skip renders which it determines are not required. Currently it does this by setting `doc.rendered_frame_is_valid = true` if it decides the frame is a no-op. This overwrites the previous value set by the `invalidate_rendered_frame` flag, meaning webrender skips renderering even though the platform has requested it. This was resulting in the GVE app showing a black screen on startup, and Fenix temporarily showing a black screen whilst opening a new tab, because despite WebRenderBridgeParent requesting an invalidation immediately on startup, webrender ignored that request until it decided it actually had content to paint. To fix this, the logic should be flipped. The value of `doc.rendered_frame_is_valid` must be remembered across document updates rather than defaulting to false. And instead of setting it true if webrender thinks the frame is a no-op, we must set it false if webrender thinks the frame is *not* a no-op. Differential Revision: https://phabricator.services.mozilla.com/D72600