Determine if OffscreenCanvas is paintable in different rendering contexts

This CL adds isPaintable() to OffscreenCanvas which mimics HTMLCanvasElement::
isPaintable() with some adjustments. Certain common constants and utility
functions shared by OffscreenCanvas and HTMLCanvasElement have been moved to
platform/graphics/. This CL is to facilitate toBlob implementation.

BUG=563830
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/2255683005
Cr-Commit-Position: refs/heads/master@{#413450}
12 files changed