Commit c36e993d authored by sotaro's avatar sotaro
Browse files

Bug 1541145 - Use (1.0, 1.0, 1.0, 1.0) as clear clolor on android r=kats

wr_window_new() uses (0.0, 0.0, 0.0, 1.0) and (0.0, 0.0, 0.0, 0.0) as clear color. Then it makes rendering black until a content of webrender comes. By changing clear color to (1.0, 1.0, 1.0, 1.0), we could suppress black flashing.

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

--HG--
extra : moz-landing-system : lando
parent ac79afd5
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1145,7 +1145,6 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
    } else {
        gl = unsafe { gl::GlFns::load_with(|symbol| get_proc_address(gl_context, symbol)) };
    }
    gl.clear_color(0.0, 0.0, 0.0, 1.0);

    let version = gl.get_string(gl::VERSION);

@@ -1172,6 +1171,13 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
        None => None,
    };

    let color = if cfg!(target_os = "android") {
        // The color is for avoiding black flash before receiving display list.
        ColorF::new(1.0, 1.0, 1.0, 1.0)
    } else {
        ColorF::new(0.0, 0.0, 0.0, 0.0)
    };

    let opts = RendererOptions {
        enable_aa: true,
        enable_subpixel_aa: cfg!(not(target_os = "android")),
@@ -1199,7 +1205,7 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
        scene_builder_hooks: Some(Box::new(APZCallbacks::new(window_id))),
        sampler: Some(Box::new(SamplerCallback::new(window_id))),
        max_texture_size: Some(8192), // Moz2D doesn't like textures bigger than this
        clear_color: Some(ColorF::new(0.0, 0.0, 0.0, 0.0)),
        clear_color: Some(color),
        precache_flags,
        namespace_alloc_by_client: true,
        enable_picture_caching,