Improve CopyTex{Sub}Image2D format validation.

1) Unify the validation code into a helper function.
2) In ES3, for sized formats, the read_format and internal_format's color bits
   have to match exactly.

BUG=429053
TEST=gpu_unittests,webgl{2}_conformance
R=piman@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel;tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2029803002
Cr-Commit-Position: refs/heads/master@{#397913}
4 files changed