WebXR: Fix viewport height calculation in GetViewportForLayer Use GetVerticalViewCount() to correctly compute the viewport height in GetViewportForLayer. Bug: 468035615 Change-Id: I29840be73ff710c9e5326802b56d88719bd61efe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7254815 Reviewed-by: Alexander Cooper <alcooper@chromium.org> Commit-Queue: Ho Cheung <hocheung@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Cr-Commit-Position: refs/heads/main@{#1558337}
diff --git a/AUTHORS b/AUTHORS index d99946b..4d89f58 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -1745,6 +1745,7 @@ Zhenyu Shan <zhenyu.shan@intel.com> Zhibo Wang <zhibo1.wang@intel.com> Zhifei Fang <facetothefate@gmail.com> +Zhixin Tu <tuzhixin25@gmail.com> Zhiyuan Ye <zhiyuanye@tencent.com> Zhongwei Wang <carolwolfking@gmail.com> Zhou Jun <zhoujun@uniontech.com>
diff --git a/third_party/blink/renderer/modules/xr/xr_webgl_binding.cc b/third_party/blink/renderer/modules/xr/xr_webgl_binding.cc index aa05fe2..6e92f441 100644 --- a/third_party/blink/renderer/modules/xr/xr_webgl_binding.cc +++ b/third_party/blink/renderer/modules/xr/xr_webgl_binding.cc
@@ -366,7 +366,7 @@ uint32_t width = layer.textureWidth() / GetHorizontalViewCount(layer.layout()); uint32_t height = - layer.textureHeight() / GetHorizontalViewCount(layer.layout()); + layer.textureHeight() / GetVerticalViewCount(layer.layout()); if (eye == V8XREye::Enum::kRight && (layer.layout() == V8XRLayerLayout::Enum::kStereoTopBottom ||