| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 enum WrappingBehavior { | 53 enum WrappingBehavior { |
| 54 kWrappingBehaviorWrap, | 54 kWrappingBehaviorWrap, |
| 55 kWrappingBehaviorNoWrap, | 55 kWrappingBehaviorNoWrap, |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 virtual void Draw(SkCanvas* canvas, const gfx::Size& texture_size) = 0; | 58 virtual void Draw(SkCanvas* canvas, const gfx::Size& texture_size) = 0; |
| 59 | 59 |
| 60 virtual void OnSetMode(); | 60 virtual void OnSetMode(); |
| 61 ColorScheme::Mode mode() const { return mode_; } | 61 ColorScheme::Mode mode() const { return mode_; } |
| 62 const ColorScheme& color_scheme() const; |
| 62 | 63 |
| 63 // Prepares a set of RenderText objects with the given color and fonts. | 64 // Prepares a set of RenderText objects with the given color and fonts. |
| 64 // Attempts to fit the text within the provided size. |flags| specifies how | 65 // Attempts to fit the text within the provided size. |flags| specifies how |
| 65 // the text should be rendered. If multiline is requested and provided height | 66 // the text should be rendered. If multiline is requested and provided height |
| 66 // is 0, it will be set to the minimum needed to fit the whole text. If | 67 // is 0, it will be set to the minimum needed to fit the whole text. If |
| 67 // multiline is not requested and provided width is 0, it will be set to the | 68 // multiline is not requested and provided width is 0, it will be set to the |
| 68 // minimum needed to fit the whole text. | 69 // minimum needed to fit the whole text. |
| 69 static std::vector<std::unique_ptr<gfx::RenderText>> PrepareDrawStringRect( | 70 static std::vector<std::unique_ptr<gfx::RenderText>> PrepareDrawStringRect( |
| 70 const base::string16& text, | 71 const base::string16& text, |
| 71 const gfx::FontList& font_list, | 72 const gfx::FontList& font_list, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 92 private: | 93 private: |
| 93 bool dirty_ = true; | 94 bool dirty_ = true; |
| 94 ColorScheme::Mode mode_ = ColorScheme::kModeNormal; | 95 ColorScheme::Mode mode_ = ColorScheme::kModeNormal; |
| 95 | 96 |
| 96 DISALLOW_COPY_AND_ASSIGN(UiTexture); | 97 DISALLOW_COPY_AND_ASSIGN(UiTexture); |
| 97 }; | 98 }; |
| 98 | 99 |
| 99 } // namespace vr_shell | 100 } // namespace vr_shell |
| 100 | 101 |
| 101 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ | 102 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ |
| OLD | NEW |