Commit 9dddfa57 authored by Alex Thayer's avatar Alex Thayer
Browse files

Bug 1538540 - Respect texture_cache rebuild reqs even if doc has no pixels r=kvark

If a document has an empty rect for whatever reason (in the case observed, this was
due to running a full screen video in the content document, which occludes the
chrome document), then we still want to ensure that we build a frame if the
texture cache has performed a clear, as otherwise we may try to access stale
items from the texture resolver in render_impl.

Differential Revision: https://phabricator.services.mozilla.com/D29848

--HG--
extra : moz-landing-system : lando
parent 951897b0
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1415,9 +1415,12 @@ impl RenderBackend {
        }

        // Avoid re-building the frame if the current built frame is still valid.
        let build_frame = (render_frame && !doc.frame_is_valid) ||
            self.resource_cache.requires_frame_build() &&
            doc.frame_builder.is_some();
        // However, if the resource_cache requires a frame build, _always_ do that, unless
        // doc.can_render() is false, as in that case a frame build can't happen anyway.
        // We want to ensure we do this because even if the doc doesn't have pixels it
        // can still try to access stale texture cache items.
        let build_frame = (render_frame && !doc.frame_is_valid && doc.has_pixels()) ||
            (self.resource_cache.requires_frame_build() && doc.can_render());

        // Request composite is true when we want to composite frame even when
        // there is no frame update. This happens when video frame is updated under
@@ -1427,7 +1430,7 @@ impl RenderBackend {
        }

        let mut frame_build_time = None;
        if build_frame && doc.has_pixels() {
        if build_frame {
            profile_scope!("generate frame");

            *frame_counter += 1;