Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell_gl.cc

Issue 2833773005: Pause drawing webvr when the App button is pressed (Closed)
Patch Set: nit Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" 5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h"
6 6
7 #include <chrono> 7 #include <chrono>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 &gesture_xz_angle)) { 653 &gesture_xz_angle)) {
654 if (fabs(gesture_xz_angle) > kMinAppButtonGestureAngleRad) { 654 if (fabs(gesture_xz_angle) > kMinAppButtonGestureAngleRad) {
655 direction = 655 direction =
656 gesture_xz_angle < 0 ? UiInterface::LEFT : UiInterface::RIGHT; 656 gesture_xz_angle < 0 ? UiInterface::LEFT : UiInterface::RIGHT;
657 main_thread_task_runner_->PostTask( 657 main_thread_task_runner_->PostTask(
658 FROM_HERE, base::Bind(&VrShell::AppButtonGesturePerformed, 658 FROM_HERE, base::Bind(&VrShell::AppButtonGesturePerformed,
659 weak_vr_shell_, direction)); 659 weak_vr_shell_, direction));
660 } 660 }
661 } 661 }
662 if (direction == UiInterface::NONE) { 662 if (direction == UiInterface::NONE) {
663 content_paused_ = !content_paused_;
bshe 2017/04/21 21:08:42 perhaps rename to content_rendering_enabled_ to ma
ymalik 2017/04/28 00:12:04 Done.
664 scene_->SetWebVrRenderingEnabled(!content_paused_);
663 main_thread_task_runner_->PostTask( 665 main_thread_task_runner_->PostTask(
664 FROM_HERE, base::Bind(&VrShell::AppButtonPressed, weak_vr_shell_)); 666 FROM_HERE, base::Bind(&VrShell::AppButtonPressed, weak_vr_shell_,
667 content_paused_));
665 } 668 }
666 } 669 }
667 } 670 }
668 671
669 void VrShellGl::SendEventsToTarget(InputTarget input_target, 672 void VrShellGl::SendEventsToTarget(InputTarget input_target,
670 int pixel_x, 673 int pixel_x,
671 int pixel_y) { 674 int pixel_y) {
672 std::vector<std::unique_ptr<WebGestureEvent>> gesture_list = 675 std::vector<std::unique_ptr<WebGestureEvent>> gesture_list =
673 controller_->DetectGestures(); 676 controller_->DetectGestures();
674 double timestamp = gesture_list.front()->TimeStampSeconds(); 677 double timestamp = gesture_list.front()->TimeStampSeconds();
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 // InitializeGl. Revisit if the initialization order changes. 1328 // InitializeGl. Revisit if the initialization order changes.
1326 device::mojom::VRDisplayInfoPtr info = 1329 device::mojom::VRDisplayInfoPtr info =
1327 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), 1330 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(),
1328 webvr_surface_size_, device_id); 1331 webvr_surface_size_, device_id);
1329 main_thread_task_runner_->PostTask( 1332 main_thread_task_runner_->PostTask(
1330 FROM_HERE, 1333 FROM_HERE,
1331 base::Bind(&RunVRDisplayInfoCallback, callback, base::Passed(&info))); 1334 base::Bind(&RunVRDisplayInfoCallback, callback, base::Passed(&info)));
1332 } 1335 }
1333 1336
1334 } // namespace vr_shell 1337 } // namespace vr_shell
OLDNEW
« chrome/browser/android/vr_shell/vr_shell.cc ('K') | « chrome/browser/android/vr_shell/vr_shell_gl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698