Match html canvas which is transferred to OffscreenCanvas to CSS style

This CL aims to make html canvas to match to CSS style restriction regardless
whether it is transferred to OffscreenCanvas or not.

In a usual compositor commit, when a css style is imposed on the html canvas
to change its width and height, its layer will reset a different bounds.
However, in the case when html canvas has transferred control to offscreen,
it is using a SurfaceLayer, which directly use surface_size_ without
incorporating layer bounds to append SurfaceDrawQuad. This CL changes
SurfaceLayerImpl to take into account the special case when layer bounds is
different from surface_size by doing a transformation on the
Quad, especially when the aspect ratio is different.

The CL respects existing non-canvas cases on high-dpi devices and settings
when enable-use-zoom-for-dsf is on or off.

Also, it is also possible that the compositor commit due to style change
happens before the Surface Layer for html canvas is created. To prevent
flakiness, we force a compositor commit at the time when Surface Layer is
created and registered to GraphicsLayers.

TBR=khushalsagar@chromium.org, twellington@chromium.org, pfeldman@chromium.org
BUG=655335, 652931
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2495373003
Cr-Commit-Position: refs/heads/master@{#438986}
21 files changed