Prevent context flashing on window resize

Change-Id: I422da46293e283c0b57d062cca225fc891c379da