Remove ExternalTextureDescriptor::flipY
It has been replaced by ::mirrored instead.
Bug: 41487285
Change-Id: I102d84dca5144d4a564a860dd5d31d62e36e7977
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/188800
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
diff --git a/src/dawn/dawn.json b/src/dawn/dawn.json
index 6c5b3f9..c76f9c2 100644
--- a/src/dawn/dawn.json
+++ b/src/dawn/dawn.json
@@ -1801,7 +1801,6 @@
"length": 7},
{"name": "gamut conversion matrix", "type": "float", "annotation": "const*",
"length": 9},
- {"name": "flip y", "type": "bool", "default": "false", "tags": ["deprecated"]},
{"name": "mirrored", "type": "bool", "default": "false"},
{"name": "rotation", "type": "external texture rotation", "default": "rotate 0 degrees"}
]
diff --git a/src/dawn/native/ExternalTexture.cpp b/src/dawn/native/ExternalTexture.cpp
index a1a8a3b..5ebe350 100644
--- a/src/dawn/native/ExternalTexture.cpp
+++ b/src/dawn/native/ExternalTexture.cpp
@@ -290,14 +290,10 @@
// y-flips. After translation, coordinates range from [-0.5 .. +0.5] in both U and V.
mat2x3 sampleTransform = Translate(-0.5, -0.5);
- // Texture applies rotation first and do mirrored(horizontal flip) next.
- // Do reverse order here to mapping final uv coordinate to origin texture.
- // TODO(crbug.com/1514732): VideoFrame metadata defines horizontal flip (mirrored) and rotation.
- // The vertical flip (which is flipY) could be achieved by rotate 180 + mirrored. Deprecate
- // flipY attribute to align with VideoFrame metadata. Chrome is the only place to use this
- // attribute and pass mirrored to descriptor->flipY and this is incorrect. Workaround to fix
- // mirrored issue by delegate flipY operation to mirrored and remove flipY attribute in future.
- if (descriptor->flipY || descriptor->mirrored) {
+ // The video frame metadata both rotation and mirroring information. The rotation happens before
+ // the mirroring when processing the video frame, so do the inverse order when converting UV
+ // coordinates.
+ if (descriptor->mirrored) {
sampleTransform = Mul(Scale(-1, 1), sampleTransform);
}