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

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

Issue 2834543006: Hook up insecure content warnings for http webVR presentation. (Closed)
Patch Set: rebase Created 3 years, 8 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/textured_element.h
diff --git a/chrome/browser/android/vr_shell/ui_elements/textured_element.h b/chrome/browser/android/vr_shell/ui_elements/textured_element.h
new file mode 100644
index 0000000000000000000000000000000000000000..e6cc7f73e7523b01fd20eafe61b8c6bbfac30b6d
--- /dev/null
+++ b/chrome/browser/android/vr_shell/ui_elements/textured_element.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TEXTURED_ELEMENT_H_
+#define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TEXTURED_ELEMENT_H_
+
+#include "base/macros.h"
+#include "chrome/browser/android/vr_shell/ui_elements/ui_element.h"
+#include "ui/gl/gl_bindings.h"
+
+class SkSurface;
+
+namespace vr_shell {
+
+class UiTexture;
+
+class TexturedElement : public UiElement {
+ public:
+ // |preferred_width| is the element's desired width in meters. Constraints
+ // implied by the texture being rendered may or may not allow it to be
+ // rendered exactly at the preferred width.
+ explicit TexturedElement(int maximum_width);
+ ~TexturedElement() override;
+
+ void Initialize() override;
+
+ // UiElement interface.
+ void Render(VrShellRenderer* renderer,
+ vr::Mat4f view_proj_matrix) const override;
+
+ protected:
+ virtual UiTexture* GetTexture() const = 0;
+
+ private:
+ void Flush(SkSurface* surface);
+
+ gfx::Size texture_size_;
+ GLuint texture_handle_;
+ int maximum_width_;
+
+ DISALLOW_COPY_AND_ASSIGN(TexturedElement);
+};
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TEXTURED_ELEMENT_H_

Powered by Google App Engine
This is Rietveld 408576698