| 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_TEXTURES_UI_TEXTURE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" |
| 10 #include "third_party/skia/include/core/SkSurface.h" | 11 #include "third_party/skia/include/core/SkSurface.h" |
| 11 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
| 12 | 13 |
| 13 namespace gfx { | 14 namespace gfx { |
| 14 class Canvas; | 15 class Canvas; |
| 16 class FontList; |
| 15 } // namespace gfx | 17 } // namespace gfx |
| 16 | 18 |
| 17 namespace vr_shell { | 19 namespace vr_shell { |
| 18 | 20 |
| 19 class UITexture { | 21 class UITexture { |
| 20 public: | 22 public: |
| 21 UITexture(int texture_handle, int texture_size); | 23 UITexture(int texture_handle, int texture_size); |
| 22 virtual ~UITexture(); | 24 virtual ~UITexture(); |
| 23 | 25 |
| 24 void DrawAndLayout(); | 26 void DrawAndLayout(); |
| 25 void Flush(); | 27 void Flush(); |
| 26 gfx::Size size() const { return size_; } | 28 gfx::Size size() const { return size_; } |
| 27 | 29 |
| 28 protected: | 30 protected: |
| 29 virtual void Draw(gfx::Canvas* canvas) = 0; | 31 virtual void Draw(gfx::Canvas* canvas) = 0; |
| 30 virtual void SetSize() = 0; | 32 virtual void SetSize() = 0; |
| 33 static gfx::FontList GetFontList(int size, base::string16 text); |
| 31 | 34 |
| 32 int texture_handle_; | 35 int texture_handle_; |
| 33 int texture_size_; | 36 int texture_size_; |
| 34 gfx::Size size_; | 37 gfx::Size size_; |
| 35 sk_sp<SkSurface> surface_; | 38 sk_sp<SkSurface> surface_; |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 } // namespace vr_shell | 41 } // namespace vr_shell |
| 39 | 42 |
| 40 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ | 43 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ |
| OLD | NEW |