d3d9: Emulate some logic ops with blending.

This makes Brave Story's intro visible.  Also add for GLES2/GLES3, but
doesn't seem to work on GLES2.
gles: Avoid pow(<= 0, 0) entirely, undefined.

Should work on more driver versions.  Fixes #6941.
Merge pull request #6942 from unknownbrackets/gpu-minor

gles: Avoid pow(<= 0, 0) entirely, undefined
Merge pull request #6940 from unknownbrackets/blend-logicop

d3d9: Emulate some logic ops with blending
Simplify the viewport code a bit.
Normalize newlines, no code changes.

We really shouldn't let mixed newlines creep into the codebase.
They're annoying.
Oops, left the comment in the wrong one.
Merge pull request #6946 from unknownbrackets/gpu-minor

Simplify the viewport calculation