| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TEXTURED_ELEMENT_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TEXTURED_ELEMENT_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TEXTURED_ELEMENT_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TEXTURED_ELEMENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" | 9 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" |
| 10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // rendered exactly at the preferred width. | 23 // rendered exactly at the preferred width. |
| 24 explicit TexturedElement(int maximum_width); | 24 explicit TexturedElement(int maximum_width); |
| 25 ~TexturedElement() override; | 25 ~TexturedElement() override; |
| 26 | 26 |
| 27 void Initialize() final; | 27 void Initialize() final; |
| 28 | 28 |
| 29 // UiElement interface. | 29 // UiElement interface. |
| 30 void Render(UiElementRenderer* renderer, | 30 void Render(UiElementRenderer* renderer, |
| 31 gfx::Transform view_proj_matrix) const final; | 31 gfx::Transform view_proj_matrix) const final; |
| 32 | 32 |
| 33 void OnBeginFrame(const base::TimeTicks& begin_frame_time) override; |
| 34 |
| 33 protected: | 35 protected: |
| 34 virtual UiTexture* GetTexture() const = 0; | 36 virtual UiTexture* GetTexture() const = 0; |
| 35 virtual void UpdateTexture(); | 37 virtual void UpdateTexture(); |
| 36 virtual void UpdateElementSize(); | 38 virtual void UpdateElementSize(); |
| 37 | 39 |
| 38 private: | 40 private: |
| 39 void Flush(SkSurface* surface); | 41 void Flush(SkSurface* surface); |
| 40 void OnSetMode() override; | 42 void OnSetMode() override; |
| 41 | 43 |
| 42 gfx::Size texture_size_; | 44 gfx::Size texture_size_; |
| 43 GLuint texture_handle_; | 45 GLuint texture_handle_; |
| 44 int maximum_width_; | 46 int maximum_width_; |
| 45 bool initialized_ = false; | 47 bool initialized_ = false; |
| 46 | 48 |
| 47 DISALLOW_COPY_AND_ASSIGN(TexturedElement); | 49 DISALLOW_COPY_AND_ASSIGN(TexturedElement); |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 } // namespace vr_shell | 52 } // namespace vr_shell |
| 51 | 53 |
| 52 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TEXTURED_ELEMENT_H_ | 54 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_TEXTURED_ELEMENT_H_ |
| OLD | NEW |