Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05270f4d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Preserve phones screen aspect ratio for VR Window Manager."

parents 7311c4a8 8a0be906
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -301,10 +301,10 @@ Error VrHwc::getDisplayAttribute(Display display, Config config,

  switch (attribute) {
    case IComposerClient::Attribute::WIDTH:
      *outValue = 1920;
      *outValue = 1080;
      break;
    case IComposerClient::Attribute::HEIGHT:
      *outValue = 1080;
      *outValue = 1920;
      break;
    case IComposerClient::Attribute::VSYNC_PERIOD:
      *outValue = 1000 * 1000 * 1000 / 30;  // 30fps
+5 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ namespace dvr {

namespace {

constexpr float kLayerScaleFactor = 4.0f;
constexpr float kLayerScaleFactor = 3.0f;

constexpr unsigned int kVRAppLayerCount = 2;

@@ -131,7 +131,7 @@ mat4 GetHorizontallyAlignedMatrixFromPose(const Posef& pose) {
  m(3, 0) = 0.0f; m(3, 1) = 0.0f; m(3, 2) = 0.0f; m(3, 3) = 1.0f;
  // clang-format on

  return m * Eigen::AngleAxisf(M_PI * 0.5f, vec3::UnitZ());
  return m;
}

// Helper function that applies the crop transform to the texture layer and
@@ -712,10 +712,12 @@ void ShellView::Touch() {
    return;
  }

  // Device is portrait, but in landscape when in VR.
  // Rotate touch input appropriately.
  const android::status_t status = virtual_touchpad_->Touch(
      VirtualTouchpad::PRIMARY,
      1.0f - hit_location_in_window_coord_.y() / size_.y(),
      hit_location_in_window_coord_.x() / size_.x(),
      hit_location_in_window_coord_.y() / size_.y(),
      is_touching_ ? 1.0f : 0.0f);
  if (status != OK) {
    ALOGE("touch failed: %d", status);