| 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 "base/strings/string16.h" |
| 11 #include "ui/gfx/geometry/size.h" | 11 #include "ui/gfx/geometry/size.h" |
| 12 #include "ui/gfx/geometry/size_f.h" | 12 #include "ui/gfx/geometry/size_f.h" |
| 13 | 13 |
| 14 class SkCanvas; | 14 class SkCanvas; |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class Canvas; | |
| 18 class FontList; | 17 class FontList; |
| 19 } // namespace gfx | 18 } // namespace gfx |
| 20 | 19 |
| 21 namespace vr_shell { | 20 namespace vr_shell { |
| 22 | 21 |
| 23 class UiTexture { | 22 class UiTexture { |
| 24 public: | 23 public: |
| 25 UiTexture(); | 24 UiTexture(); |
| 26 virtual ~UiTexture(); | 25 virtual ~UiTexture(); |
| 27 | 26 |
| 28 void DrawAndLayout(SkCanvas* canvas, const gfx::Size& texture_size); | 27 void DrawAndLayout(SkCanvas* canvas, const gfx::Size& texture_size); |
| 29 virtual gfx::Size GetPreferredTextureSize(int maximum_width) const = 0; | 28 virtual gfx::Size GetPreferredTextureSize(int maximum_width) const = 0; |
| 30 virtual gfx::SizeF GetDrawnSize() const = 0; | 29 virtual gfx::SizeF GetDrawnSize() const = 0; |
| 31 | 30 |
| 32 protected: | 31 protected: |
| 33 virtual void Draw(gfx::Canvas* canvas, const gfx::Size& texture_size) = 0; | 32 virtual void Draw(SkCanvas* canvas, const gfx::Size& texture_size) = 0; |
| 34 | 33 |
| 35 static bool IsRTL(); | 34 static bool IsRTL(); |
| 35 static gfx::FontList GetDefaultFontList(int size); |
| 36 static gfx::FontList GetFontList(int size, base::string16 text); | 36 static gfx::FontList GetFontList(int size, base::string16 text); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 } // namespace vr_shell | 39 } // namespace vr_shell |
| 40 | 40 |
| 41 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ | 41 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ |
| OLD | NEW |