With B2G/SkiaGL, saw Red ball flicker in mozillaball app
Based on bug 843599, it still had flicker by adding fence/waitsync implementation.
Mozillaball app used arc/fill to draw the red ball, as shown below.
// Draws a circle of radius 20 at the coordinates 100,100 on the canvas
And this problem could be solved by calling DrawTargetSkia::Flush() at the end of draw cmds.
Checking the timing of Flush() calls.
Created attachment 746787 [details] [diff] [review]
It seems there are 2 problems:
1. SkCanvas do not flushed correctly
2. Rendered data not read out correctly
Apply this workaround patch then the ball runs without problem.
I am curious why the gfxSurface contain part render result now. That maybe the key for various similar problem.
For this case, you can call mGLContext->PublishFrame before RequestFrame rather than mark out code to fix it, too.
Created attachment 747330 [details] [diff] [review]
workaround patch v2
Better fix to the bug.
As SkiaGL may queue the draw call until flush, we must flush it before trying to access buffer data.
Created attachment 748897 [details] [diff] [review]
SkiaGL default to store draw operations in a queue until flush.
Flush the queue right before present the frame.
Comment on attachment 748897 [details] [diff] [review]
Review of attachment 748897 [details] [diff] [review]:
You probably don't need to check explicitly against nullptr, but this looks good.
Created attachment 749018 [details] [diff] [review]
Commitable version, carry r+.