Fix immutable tex srgb emulation issue of generateMipmap

During the emulation of srgb for generateMipmap, we tried to generate all
levels of the original texture. But if the texture is immutable texture,
we can't generate mipmaps exceed the original range.
Also, when the width and height are not equal, they should be at least one
during the emulation.

BUG=712096
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2841503002
Cr-Commit-Position: refs/heads/master@{#468238}
2 files changed