Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Side by Side Diff: chrome/browser/android/vr_shell/textures/ui_texture.h

Issue 2877133002: VR: Add a loading indicator to the scene. (Closed)
Patch Set: Rebase onto render text change. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 26 matching lines...) Expand all
37 37
38 UiTexture(); 38 UiTexture();
39 virtual ~UiTexture(); 39 virtual ~UiTexture();
40 40
41 void DrawAndLayout(SkCanvas* canvas, const gfx::Size& texture_size); 41 void DrawAndLayout(SkCanvas* canvas, const gfx::Size& texture_size);
42 virtual gfx::Size GetPreferredTextureSize(int maximum_width) const = 0; 42 virtual gfx::Size GetPreferredTextureSize(int maximum_width) const = 0;
43 virtual gfx::SizeF GetDrawnSize() const = 0; 43 virtual gfx::SizeF GetDrawnSize() const = 0;
44 // Returns true if the state changed. 44 // Returns true if the state changed.
45 virtual bool SetDrawFlags(int draw_flags); 45 virtual bool SetDrawFlags(int draw_flags);
46 int GetDrawFlags() { return draw_flags_; } 46 int GetDrawFlags() { return draw_flags_; }
47 bool dirty() const { return dirty_; }
47 48
48 protected: 49 protected:
49 virtual void Draw(SkCanvas* canvas, const gfx::Size& texture_size) = 0; 50 virtual void Draw(SkCanvas* canvas, const gfx::Size& texture_size) = 0;
50 51
51 // Prepares a set of RenderText objects with the given color and fonts. 52 // Prepares a set of RenderText objects with the given color and fonts.
52 // Attempts to fit the text within the provided size. |flags| specifies how 53 // Attempts to fit the text within the provided size. |flags| specifies how
53 // the text should be rendered. If multiline is requested and provided height 54 // the text should be rendered. If multiline is requested and provided height
54 // is 0, it will be set to the minimum needed to fit the whole text. If 55 // is 0, it will be set to the minimum needed to fit the whole text. If
55 // multiline is not requested and provided width is 0, it will be set to the 56 // multiline is not requested and provided width is 0, it will be set to the
56 // minimum needed to fit the whole text. 57 // minimum needed to fit the whole text.
57 static std::vector<std::unique_ptr<gfx::RenderText>> PrepareDrawStringRect( 58 static std::vector<std::unique_ptr<gfx::RenderText>> PrepareDrawStringRect(
58 const base::string16& text, 59 const base::string16& text,
59 const gfx::FontList& font_list, 60 const gfx::FontList& font_list,
60 SkColor color, 61 SkColor color,
61 gfx::Rect* bounds, 62 gfx::Rect* bounds,
62 int flags); 63 int flags);
63 64
65 void set_dirty() { dirty_ = true; }
66
64 static bool IsRTL(); 67 static bool IsRTL();
65 static gfx::FontList GetDefaultFontList(int size); 68 static gfx::FontList GetDefaultFontList(int size);
66 static gfx::FontList GetFontList(int size, base::string16 text); 69 static gfx::FontList GetFontList(int size, base::string16 text);
67 70
68 private: 71 private:
69 int draw_flags_ = 0; 72 int draw_flags_ = 0;
73 bool dirty_ = false;
70 }; 74 };
71 75
72 } // namespace vr_shell 76 } // namespace vr_shell
73 77
74 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ 78 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698