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

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

Issue 2861343002: Enable gpu rasterization in the vr shell
Patch Set: additional trace instrumentation Created 3 years, 7 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/ui_elements/ui_element.h
diff --git a/chrome/browser/android/vr_shell/ui_elements/ui_element.h b/chrome/browser/android/vr_shell/ui_elements/ui_element.h
index da5d829c4cab8cf7bf62d7f299cf9c309f05d8e4..5948fea688c2ab39493b281f8b44407a27d2e6a2 100644
--- a/chrome/browser/android/vr_shell/ui_elements/ui_element.h
+++ b/chrome/browser/android/vr_shell/ui_elements/ui_element.h
@@ -20,6 +20,7 @@ namespace vr_shell {
class Animation;
class VrShellRenderer;
+class VrSurfaceProvider;
enum XAnchoring {
XNONE = 0,
@@ -104,7 +105,7 @@ class UiElement : public WorldRectangle {
virtual void Render(VrShellRenderer* renderer,
vr::Mat4f view_proj_matrix) const;
- virtual void Initialize();
+ void Initialize(VrSurfaceProvider* provider);
// Controller interaction methods.
virtual void OnHoverEnter();
@@ -219,6 +220,12 @@ class UiElement : public WorldRectangle {
bool dirty() const { return dirty_; }
void set_dirty(bool dirty) { dirty_ = dirty; }
+ protected:
+ virtual void Initialize();
+
+ // This obtains a GPU-backed surface. Only valid after initialized.
+ VrSurfaceProvider* surface_provider() { return surface_provider_; }
+
private:
// Valid IDs are non-negative.
int id_ = -1;
@@ -285,6 +292,8 @@ class UiElement : public WorldRectangle {
Transform transform_;
+ VrSurfaceProvider* surface_provider_ = nullptr;
+
DISALLOW_COPY_AND_ASSIGN(UiElement);
};

Powered by Google App Engine
This is Rietveld 408576698