Chromium Code Reviews| Index: chrome/browser/android/vr_shell/textures/ui_texture.h |
| diff --git a/chrome/browser/android/vr_shell/textures/ui_texture.h b/chrome/browser/android/vr_shell/textures/ui_texture.h |
| index f1529b3dd8ccc4de94ff1d78fe2854354c8f5a1e..2bf0354d2b7268fbd1203bdcfd63580b33b82f7b 100644 |
| --- a/chrome/browser/android/vr_shell/textures/ui_texture.h |
| +++ b/chrome/browser/android/vr_shell/textures/ui_texture.h |
| @@ -6,21 +6,37 @@ |
| #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ |
| #include <memory> |
| +#include <vector> |
| #include "base/strings/string16.h" |
| +#include "third_party/skia/include/core/SkColor.h" |
| +#include "ui/gfx/geometry/rect.h" |
| #include "ui/gfx/geometry/size.h" |
| #include "ui/gfx/geometry/size_f.h" |
| class SkCanvas; |
| namespace gfx { |
| + |
| class FontList; |
| +class RenderText; |
| + |
| } // namespace gfx |
| namespace vr_shell { |
| class UiTexture { |
| public: |
| + enum { |
| + // Flags to configure PrepareDrawStringRect |
| + |
|
cjgrant
2017/05/11 21:15:40
Probably no need for either blank line in here.
acondor_
2017/05/11 22:26:49
Done.
|
| + TEXT_ALIGN_LEFT = 1 << 0, |
| + TEXT_ALIGN_CENTER = 1 << 1, |
| + TEXT_ALIGN_RIGHT = 1 << 2, |
| + |
| + MULTI_LINE = 1 << 3 |
| + }; |
| + |
| UiTexture(); |
| virtual ~UiTexture(); |
| @@ -31,6 +47,19 @@ class UiTexture { |
| protected: |
| virtual void Draw(SkCanvas* canvas, const gfx::Size& texture_size) = 0; |
| + // Prepares a set of RenderText objects with the given color and fonts. |
| + // Attempts to fit the text within the provided size. |flags| specifies how |
| + // the text should be rendered. If multiline is requested and provided height |
| + // is 0, it will be set to the minimum needed to fit the whole text. If |
| + // multiline is not requested and provided width is 0, it will be set to the |
| + // minimum needed to fit the whole text. |
| + static std::vector<std::unique_ptr<gfx::RenderText>> PrepareDrawStringRect( |
| + const base::string16& text, |
| + const gfx::FontList& font_list, |
| + SkColor color, |
| + gfx::Rect* bounds, |
| + int flags); |
| + |
| static bool IsRTL(); |
| static gfx::FontList GetDefaultFontList(int size); |
| static gfx::FontList GetFontList(int size, base::string16 text); |