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

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

Issue 2301633002: Refactor Vr activity into ChromeTabbedActivity. (Closed)
Patch Set: UiElements are now structs Created 4 years, 3 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 585d6fd1c2d23aad14e083a4b5f5ee42c1614368..b415f2ab5a2692a16c498f296f27f4de6b037f72 100644
--- a/chrome/browser/android/vr_shell/vr_shell.h
+++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -7,33 +7,26 @@
#include <jni.h>
#include <memory>
+#include <vector>
#include "base/android/jni_weak_ref.h"
#include "base/macros.h"
+#include "chrome/browser/android/vr_shell/ui_elements.h"
#include "device/vr/android/gvr/gvr_delegate.h"
#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr.h"
#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr_types.h"
+
namespace vr_shell {
class VrShellRenderer;
-class ContentRect {
- public:
- ContentRect();
- ~ContentRect();
- void SetIdentity();
- void Translate(float x, float y, float z);
- gvr::Mat4f transfrom_to_world;
- int content_texture_handle;
-};
class VrShell : public device::GvrDelegate {
public:
VrShell(JNIEnv* env, jobject obj);
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
-
void GvrInit(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
jlong native_gvr_api);
@@ -54,14 +47,28 @@ class VrShell : public device::GvrDelegate {
private:
virtual ~VrShell();
-
void DrawVrShell();
void DrawEye(const gvr::Mat4f& view_matrix,
const gvr::BufferViewport& params);
void DrawContentRect();
void DrawWebVr();
+ void DrawUI();
+
+ void UpdateTransforms(float screen_width_meters,
+ float screen_height_meters,
+ float scree_tilt);
+
+ // samplerExternalOES texture data for content area image.
+ jint content_texture_id_ = 0;
+
+ float desktop_screen_tilt_;
+ float desktop_height_;
+
+ ContentRectangle* desktop_plane_;
+ gvr::Vec3f desktop_position_;
+
+ std::vector<std::unique_ptr<ContentRectangle>> ui_rects_;
- std::unique_ptr<ContentRect> content_rect_;
std::unique_ptr<gvr::GvrApi> gvr_api_;
std::unique_ptr<gvr::BufferViewportList> buffer_viewport_list_;
std::unique_ptr<gvr::BufferViewport> buffer_viewport_;
@@ -75,10 +82,9 @@ class VrShell : public device::GvrDelegate {
gvr::Sizei render_size_;
std::unique_ptr<VrShellRenderer> vr_shell_renderer_;
-
base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_;
- bool webvr_mode_;
+ bool webvr_mode_ = false;
DISALLOW_COPY_AND_ASSIGN(VrShell);
};

Powered by Google App Engine
This is Rietveld 408576698