Ian Vollick | 213fbd0 | 2017-08-11 04:20:03 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_VR_ELEMENTS_TEXT_H_ |
| 6 | #define CHROME_BROWSER_VR_ELEMENTS_TEXT_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | |
Biao She | 767d39e3 | 2017-08-23 23:23:31 | [diff] [blame] | 10 | #include "base/callback.h" |
Ian Vollick | 213fbd0 | 2017-08-11 04:20:03 | [diff] [blame] | 11 | #include "chrome/browser/vr/elements/textured_element.h" |
Biao She | 767d39e3 | 2017-08-23 23:23:31 | [diff] [blame] | 12 | #include "third_party/skia/include/core/SkColor.h" |
Ian Vollick | 213fbd0 | 2017-08-11 04:20:03 | [diff] [blame] | 13 | |
| 14 | namespace vr { |
| 15 | |
Biao She | 767d39e3 | 2017-08-23 23:23:31 | [diff] [blame] | 16 | struct ColorScheme; |
Ian Vollick | 213fbd0 | 2017-08-11 04:20:03 | [diff] [blame] | 17 | class TextTexture; |
| 18 | class UiTexture; |
| 19 | |
| 20 | class Text : public TexturedElement { |
| 21 | public: |
| 22 | Text(int maximum_width_pixels, |
| 23 | float font_height_meters, |
| 24 | float text_width_meters, |
Biao She | 767d39e3 | 2017-08-23 23:23:31 | [diff] [blame] | 25 | const base::Callback<SkColor(ColorScheme)>& color_callback, |
Ian Vollick | 213fbd0 | 2017-08-11 04:20:03 | [diff] [blame] | 26 | int resource_id); |
| 27 | ~Text() override; |
| 28 | |
| 29 | private: |
| 30 | UiTexture* GetTexture() const override; |
| 31 | |
| 32 | std::unique_ptr<TextTexture> texture_; |
| 33 | DISALLOW_COPY_AND_ASSIGN(Text); |
| 34 | }; |
| 35 | |
| 36 | } // namespace vr |
| 37 | |
| 38 | #endif // CHROME_BROWSER_VR_ELEMENTS_TEXT_H_ |