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

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

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
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 435ef38182bb96a0144335ab42e82d8d85c25da3..dead3020309ecebbb096b3f407e74bd3d2651a6b 100644
--- a/chrome/browser/android/vr_shell/vr_shell.h
+++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -14,10 +14,13 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
+#include "content/public/browser/android/video_surface_provider.h"
#include "content/public/browser/web_contents_observer.h"
#include "device/vr/android/gvr/gvr_delegate.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"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gl/android/scoped_java_surface.h"
namespace base {
class ListValue;
@@ -54,7 +57,8 @@ class VrMetricsHelper;
// The native instance of the Java VrShell. This class is not threadsafe and
// must only be used on the UI thread.
-class VrShell : public device::GvrDelegate, content::WebContentsObserver {
+class VrShell : public device::GvrDelegate, content::WebContentsObserver,
+ content::VideoSurfaceProvider {
public:
VrShell(JNIEnv* env, jobject obj,
content::WebContents* main_contents,
@@ -131,6 +135,12 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver {
void ContentFrameWasResized(bool width_changed);
+ // Called by the Java class when the video surface changes.
+ void SetVideoSurface(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ const base::android::JavaParamRef<jobject>& surface);
+
+
void ForceExitVr();
private:
@@ -144,6 +154,12 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver {
void MainFrameWasResized(bool width_changed) override;
void WebContentsDestroyed() override;
+ // content::VideoSurfaceProvider implementation. (not sure what thread).
+ void OnVideoSizeChanged(int width, int height) override;
+ void CreateVideoSurface(content::VideoSurfaceProvider::Client* client,
+ const gfx::Size& video_natural_size) override;
+ content::VideoSurfaceProvider::Client* client_;
+
std::unique_ptr<UiInterface> html_interface_;
content::WebContents* main_contents_;

Powered by Google App Engine
This is Rietveld 408576698