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

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

Issue 2729523002: Re-land^2 WebVR compositor bypass via BrowserMain context + mailbox (Closed)
Patch Set: 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.h
diff --git a/chrome/browser/android/vr_shell/vr_shell.h b/chrome/browser/android/vr_shell/vr_shell.h
index b887d507962ac933825e72fdb61c8cbb94f1a8e3..eeb42cfccbefcafcc80163e9f9066d81425de3bf 100644
--- a/chrome/browser/android/vr_shell/vr_shell.h
+++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -17,6 +17,8 @@
#include "content/public/browser/web_contents_observer.h"
#include "device/vr/android/gvr/gvr_delegate.h"
#include "device/vr/vr_service.mojom.h"
+#include "ui/android/context_provider_factory.h"
+#include "gpu/ipc/client/gpu_channel_host.h"
#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr.h"
#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h"
@@ -32,7 +34,14 @@ namespace content {
class WebContents;
}
+namespace gpu {
+namespace gles2 {
+class GLES2Interface;
+}
+}
+
namespace ui {
+class ContextProviderCommandBuffer;
class WindowAndroid;
}
@@ -130,6 +139,8 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver {
void UiSurfaceChanged(jobject surface);
void ContentSurfaceChanged(jobject surface);
+ void WebVRSurfaceChanged(int surface_handle);
+ void WebVRFrameCompleted(int frame_index);
void GvrDelegateReady();
void AppButtonPressed();
@@ -184,7 +195,7 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver {
// device::GvrDelegate implementation
void SetWebVRSecureOrigin(bool secure_origin) override;
- void SubmitWebVRFrame() override;
+ void SubmitWebVRFrame(int frame_index, const gpu::Mailbox& mailbox) override;
void UpdateWebVRTextureBounds(int16_t frame_index,
const gvr::Rectf& left_bounds,
const gvr::Rectf& right_bounds) override;
@@ -200,11 +211,21 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver {
void ProcessTabArray(JNIEnv* env, jobjectArray tabs, bool incognito);
+ void OnWebVrGpuChannelEstablished(
+ scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
+ ui::ContextProviderFactory::GpuChannelHostResult result);
+
bool vr_shell_enabled_;
std::unique_ptr<UiInterface> html_interface_;
bool content_paused_ = false;
bool webvr_mode_ = false;
+ int webvr_surface_handle_;
+ int webvr_frames_in_surface_queue_ = 0;
+
+ scoped_refptr<ui::ContextProviderCommandBuffer>
+ webvr_context_provider_command_buffer_;
+ gpu::gles2::GLES2Interface* webvr_surface_gl_ = nullptr;
content::WebContents* main_contents_ = nullptr;
base::android::ScopedJavaGlobalRef<jobject> j_motion_event_synthesizer_;

Powered by Google App Engine
This is Rietveld 408576698