Commit 1a32b2ec authored by Michael Thiessen's avatar Michael Thiessen Committed by Commit Bot

VR: Avoid erroneous content window resize at VR entry

We were resizing the content window based off of an uninitialized
projection matrix, causing it to be very large.

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I6fabecefefe75c78bfecef746ec298e24da5b771
Reviewed-on: https://chromium-review.googlesource.com/827625Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524183}
parent dc558473
...@@ -105,6 +105,13 @@ void ContentElement::SetProjectionMatrix(const gfx::Transform& matrix) { ...@@ -105,6 +105,13 @@ void ContentElement::SetProjectionMatrix(const gfx::Transform& matrix) {
bool ContentElement::OnBeginFrame(const base::TimeTicks& time, bool ContentElement::OnBeginFrame(const base::TimeTicks& time,
const gfx::Vector3dF& look_at) { const gfx::Vector3dF& look_at) {
// TODO(mthiesse): This projection matrix is always going to be a frame
// behind when computing the content size. We'll need to address this somehow
// when we allow content resizing, or we could end up triggering an extra
// incorrect resize.
if (projection_matrix_.IsIdentity())
return false;
// Determine if the projected size of the content quad changed more than a // Determine if the projected size of the content quad changed more than a
// given threshold. If so, propagate this info so that the content's // given threshold. If so, propagate this info so that the content's
// resolution and size can be adjusted. For the calculation, we cannot take // resolution and size can be adjusted. For the calculation, we cannot take
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment