On 01/22/2015 11:59 PM, Tapani Pälli wrote: > Implementation for nacl is somewhat different as for other platforms, > platform needs to ensure that the previous swap has finished before > issuing another one. This is done by introducing a worker thread that > does buffer swaps from a work queue. > > Signed-off-by: Tapani Pälli <[email protected]>
> +// Thread takes care that we do not issue another buffer
> +// swap before previous swap has completed.
> +class NaclSwapThread : public pp::SimpleThread
> +
> + void swap_buffers(int32_t result)
> + {
> + ctx.SwapBuffers(pp::BlockUntilComplete());
> + }
I think I discovered why you were seeing rendering artifacts despite using
BlockUntilComplete
as the callback. Quoting the NaCl API reference:
int32_t(* PPB_Graphics3D::SwapBuffers)(PP_Resource context, struct
PP_CompletionCallback callback)
[...]
SwapBuffers runs in asynchronous mode. Specify a callback function and the
argument for that
callback function. The callback function will be executed on the calling
thread ***after*** the color
buffer has been composited with rest of the html page.
The keyword is "after". If I understand this correctly, ctx.SwapBuffers()
returned immediately.
Later, after webpage composition completed, the NaCl runtime called the
BlockUntilComplete
callback, which is a no-op at that time. This is all new to me, though, so
maybe I'm completely
wrong.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ waffle mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/waffle

