This is reland of 0b60471ac0.
I thought this didn't take any effect, but I confirmed this
actually fixed (part of) the blinking-line problem on Xperia XZ.
This fixes the upper side thin line. I'm not sure this fixes the
lower side thin line, which is reported but I couldn't reproduce.
I expect this and e829e650f2 will
fix the reported problem, and I am going to confirm this.
Fixes#792
Clearing the screen is so special on some environments (like macOS
Metal) that other operations on other images can be invalidated.
This fixes the issue by resolving the pixels of the offscreen that
is used as a render source for the screen before the screen is
cleared. We are not sure this is a correct way, but this actually
fixes the problem on macOS.
There are glitches on some mobile devices like Xperia. As the
screen framebuffer size might not fit with the actual GL surface
size, we guessed that is the cause of the glitches.
By using math.Ceil, the screen framebuffer will be a little bigger
and can cover the GL surface.
Before introducing Fill, filling an image with a solid color was
implemented by ReplacePixels. When an offscreen image is used, the
offscreen image is not fully cleared or filled with a color and
out of (0,0)-(width,height) region. This causes a glitch thin line
on mobile platforms.
This change adds (*shareable.Image).Fill to fill the whole
framebuffer region of the image.
After fad65f2f5d, the viewport size
is always same as the framebuffer size. The 'screen' image size
was the actual rendering region size, and padding was not
considered in the size. The padding is added on the fullscreen
mode.
This fix adds the extra padding values to the 'screen' image size
so that the 'screen' framebuffer will be same size as the monitor
size.
Fixes#693