Implement WebGL's commit on the main thread.

This CL implements WebGL's commit() API. It uses the frame work established
for the OffscreenCanvasRenderingContext2D. The basic procedure is to
get a AcceleratedStaticBitmapImage from WebGL's drawingBuffer. The
StaticBitmapImage contains a SkImage that is gpu texture backed, a gpu
mailbox, and a gpu token. We then prepare a CompositorFrame from the
gpu mailbox and the gpu token. It currently works on the main thread
only, making it work on worker thread will come in another CL.

A gpu pixel test is added to make sure that the commit actually commits
to the original HTMLCanvasElement. A layout test is added to ensure
that when an OffscreenCanvas is not constructed from transferControlToOffscreen,
then InvalidStateError must be thrown.

BUG=563852, 619136
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2328463004
Cr-Commit-Position: refs/heads/master@{#419771}
28 files changed