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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2729523002: Re-land^2 WebVR compositor bypass via BrowserMain context + mailbox (Closed)
Patch Set: Further cleanups Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/vr_shell.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
index ba595ae5bf5dd9ef7d0c95cf17f634cc532c5eb2..cdf96ea27dd0def7aaf0c77f1188d3df32c0032d 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -36,6 +36,7 @@
#include "content/public/common/referrer.h"
#include "device/vr/android/gvr/gvr_device.h"
#include "device/vr/android/gvr/gvr_device_provider.h"
+#include "gpu/command_buffer/common/mailbox.h"
#include "jni/VrShellImpl_jni.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "ui/android/view_android.h"
@@ -324,7 +325,24 @@ void VrShell::SetWebVRSecureOrigin(bool secure_origin) {
html_interface_->SetWebVRSecureOrigin(secure_origin);
}
-void VrShell::SubmitWebVRFrame() {}
+void VrShell::SubmitWebVRFrame(
mthiesse 2017/03/02 15:55:16 In a future patch we should consider binding Submi
klausw 2017/03/07 02:55:54 Acknowledged.
+ int frame_index, const gpu::Mailbox& mailbox,
+ device::mojom::VRSubmitFrameClientPtr submit_client) {
+ PostToGlThreadWhenReady(base::Bind(&VrShellGl::SubmitWebVRFrame,
+ gl_thread_->GetVrShellGl(), frame_index,
+ mailbox));
+ webvr_submit_client_transferring_ = std::move(submit_client);
+}
+
+void VrShell::OnSubmitWebVRFrameTransferred(int frame_index) {
+ webvr_submit_client_transferring_->OnSubmitFrameTransferred();
+ webvr_submit_client_rendering_ = std::move(webvr_submit_client_transferring_);
+}
+
+void VrShell::OnSubmitWebVRFrameRendered(int frame_index) {
+ webvr_submit_client_rendering_->OnSubmitFrameRendered();
+ webvr_submit_client_rendering_.reset();
+}
void VrShell::UpdateWebVRTextureBounds(int16_t frame_index,
const gvr::Rectf& left_bounds,

Powered by Google App Engine
This is Rietveld 408576698