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

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

Issue 2567233002: Use GVR async reprojection video surface for fullscreen in VR shell
Patch Set: Refactor using new interface and manager, also rebased Created 3 years, 11 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
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ccff37fc607841bfdc5032bd1adea5edfd7be7b4..dc377441b7a4f1ee0625c52ca1620161751f21e3 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/android/vr_shell/vr_shell_gl.h"
#include "chrome/browser/android/vr_shell/vr_usage_monitor.h"
#include "chrome/browser/android/vr_shell/vr_web_contents_observer.h"
+#include "content/public/browser/android/video_surface_manager.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
@@ -150,9 +151,13 @@ VrShell::VrShell(JNIEnv* env,
main_contents, html_interface_.get(), this));
SetShowingOverscrollGlow(false);
+ content::VideoSurfaceManager::GetInstance()->
+ SetOverrideVideoSurfaceProvider(this);
}
void VrShell::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) {
+ content::VideoSurfaceManager::GetInstance()->
+ RemoveOverrideVideoSurfaceProvider(this);
delete this;
}
@@ -463,6 +468,25 @@ void VrShell::SetUiCssSize(float width, float height, float dpr) {
Java_VrShellImpl_setUiCssSize(env, j_vr_shell_.obj(), width, height, dpr);
}
+void VrShell::OnVideoSizeChanged(int width, int height) {
+ // TODO(amp): Do something intelligent with the size.
+}
+
+void VrShell::CreateVideoSurface(content::VideoSurfaceProvider::Client* client,
+ const gfx::Size& video_natural_size) {
+ client_ = client;
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_VrShellImpl_createVideoSurface(env, j_vr_shell_.obj());
+ // TODO(amp): Use the natural size somehow.
+}
+
+void VrShell::SetVideoSurface(JNIEnv*,
+ const JavaParamRef<jobject>&,
+ const JavaParamRef<jobject>& surface) {
+ client_->SetVideoSurface(
+ gl::ScopedJavaSurface::AcquireExternalSurface(surface));
+}
+
// ----------------------------------------------------------------------------
// Native JNI methods
// ----------------------------------------------------------------------------
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698