UNPACK_FLIP_Y is broken for MSE-backed videos
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Oct 2017 19:42:16 +0000 (19:42 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Oct 2017 19:42:16 +0000 (19:42 +0000)
commitde42fb47320a26a3716fa953fbddce76cc366047
tree86640180758f20a977ca34017f60d721bc82e954
parent3d4c4d33cd3ac955b3a477491103559da563164c
UNPACK_FLIP_Y is broken for MSE-backed videos
https://bugs.webkit.org/show_bug.cgi?id=178774

Reviewed by Dean Jackson.

Source/WebCore:

The global GLSL variable gl_Position can apparently only be set once, and any modifications
made after that initial set are ignored. So rather than implement flipping by changing
gl_Position.y, flip the texture coordinates instead.

Drive-by fix: some of the constants used in VideoTextureCopierCV are not defined on older
macOS versions, so make them optional.

Tests: fast/canvas/webgl/texImage2D-mse-flipY-false.html
       fast/canvas/webgl/texImage2D-mse-flipY-true.html

* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::transferFunctionFromString):
(WebCore::VideoTextureCopierCV::initializeUVContextObjects):
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:

LayoutTests:

* fast/canvas/webgl/resources/orientation-flipped-fragmented.mp4: Added.
* fast/canvas/webgl/resources/orientation-normal-fragmented.mp4: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-false-expected.txt: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-false.html: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-true-expected.txt: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-true.html: Added.
* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/resources/orientation-flipped-fragmented.mp4 [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/resources/orientation-normal-fragmented.mp4 [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/texImage2D-mse-flipY-false-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/texImage2D-mse-flipY-false.html [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/texImage2D-mse-flipY-true-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/texImage2D-mse-flipY-true.html [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp
Source/WebCore/platform/cocoa/CoreVideoSoftLink.h
Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp