Change External Texture Rotation To Counter-Clockwise

When rotation metadata is added to videos by ffmpeg, it is specified as counter-clockwise. Dawn should follow this format to avoid confusion during integration.

Bug: chromium:1316671
Change-Id: I99ff30bffb1664aafd060d9a5bb1b15845388386
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117912
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Brandon Jones
2023-01-30 18:26:11 +00:00
committed by Dawn LUCI CQ
parent 6767a8998e
commit 574b94e566
2 changed files with 99 additions and 101 deletions

View File

@@ -270,8 +270,8 @@ MaybeError ExternalTextureBase::Initialize(DeviceBase* device,
case wgpu::ExternalTextureRotation::Rotate0Degrees:
break;
case wgpu::ExternalTextureRotation::Rotate90Degrees:
coordTransformMatrix = Mul(mat2x3{0, +1, 0, // x' = y
-1, 0, 0}, // y' = -x
coordTransformMatrix = Mul(mat2x3{0, -1, 0, // x' = -y
+1, 0, 0}, // y' = x
coordTransformMatrix);
break;
case wgpu::ExternalTextureRotation::Rotate180Degrees:
@@ -280,8 +280,8 @@ MaybeError ExternalTextureBase::Initialize(DeviceBase* device,
coordTransformMatrix);
break;
case wgpu::ExternalTextureRotation::Rotate270Degrees:
coordTransformMatrix = Mul(mat2x3{0, -1, 0, // x' = -y
+1, 0, 0}, // y' = x
coordTransformMatrix = Mul(mat2x3{0, +1, 0, // x' = y
-1, 0, 0}, // y' = -x
coordTransformMatrix);
break;
}