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

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

Issue 2834543006: Hook up insecure content warnings for http webVR presentation. (Closed)
Patch Set: rebase 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 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "third_party/skia/include/core/SkSurface.h"
12 #include "ui/gfx/geometry/size.h" 11 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/geometry/size_f.h"
13
14 class SkCanvas;
13 15
14 namespace gfx { 16 namespace gfx {
15 class Canvas; 17 class Canvas;
16 class FontList; 18 class FontList;
17 } // namespace gfx 19 } // namespace gfx
18 20
19 namespace vr_shell { 21 namespace vr_shell {
20 22
21 class UITexture { 23 class UiTexture {
22 public: 24 public:
23 UITexture(int texture_handle, int texture_size); 25 UiTexture();
24 virtual ~UITexture(); 26 virtual ~UiTexture();
25 27
26 void DrawAndLayout(); 28 void DrawAndLayout(SkCanvas* canvas, const gfx::Size& texture_size);
27 void Flush(); 29 virtual gfx::Size GetPreferredTextureSize(int maximum_width) const = 0;
28 gfx::Size size() const { return size_; } 30 virtual gfx::SizeF GetDrawnSize() const = 0;
29 31
30 protected: 32 protected:
31 virtual void Draw(gfx::Canvas* canvas) = 0; 33 virtual void Draw(gfx::Canvas* canvas, const gfx::Size& texture_size) = 0;
32 virtual void SetSize() = 0; 34
33 static bool IsRTL(); 35 static bool IsRTL();
34 static gfx::FontList GetFontList(int size, base::string16 text); 36 static gfx::FontList GetFontList(int size, base::string16 text);
35
36 int texture_handle_;
37 int texture_size_;
38 gfx::Size size_;
39 sk_sp<SkSurface> surface_;
40 }; 37 };
41 38
42 } // namespace vr_shell 39 } // namespace vr_shell
43 40
44 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_ 41 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698