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 FontList; | 17 class FontList; |
18 } // namespace gfx | 18 } // namespace gfx |
19 | 19 |
20 namespace vr_shell { | 20 namespace vr_shell { |
21 | 21 |
22 class UiTexture { | 22 class UiTexture { |
23 public: | 23 public: |
24 UiTexture(); | 24 UiTexture(); |
25 virtual ~UiTexture(); | 25 virtual ~UiTexture(); |
26 | 26 |
27 void DrawAndLayout(SkCanvas* canvas, const gfx::Size& texture_size); | 27 void DrawAndLayout(SkCanvas* canvas, const gfx::Size& texture_size); |
28 virtual gfx::Size GetPreferredTextureSize(int maximum_width) const = 0; | 28 virtual gfx::Size GetPreferredTextureSize(int maximum_width) const = 0; |
29 virtual gfx::SizeF GetDrawnSize() const = 0; | 29 virtual gfx::SizeF GetDrawnSize() const = 0; |
30 // Returns true if the state changed. | |
cjgrant
2017/05/10 20:16:25
Are you adding this here as a general purpose mean
mthiesse
2017/05/10 21:09:08
Changed to SetDrawFlags, missing getter was an ove
| |
31 bool Update(int draw_flags); | |
30 | 32 |
31 protected: | 33 protected: |
32 virtual void Draw(SkCanvas* canvas, const gfx::Size& texture_size) = 0; | 34 virtual void Draw(SkCanvas* canvas, const gfx::Size& texture_size) = 0; |
33 | 35 |
34 static bool IsRTL(); | 36 static bool IsRTL(); |
35 static gfx::FontList GetDefaultFontList(int size); | 37 static gfx::FontList GetDefaultFontList(int size); |
36 static gfx::FontList GetFontList(int size, base::string16 text); | 38 static gfx::FontList GetFontList(int size, base::string16 text); |
39 | |
40 int draw_flags_ = 0; | |
37 }; | 41 }; |
38 | 42 |
39 } // namespace vr_shell | 43 } // namespace vr_shell |
40 | 44 |
41 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ | 45 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ |
OLD | NEW |