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

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

Issue 2818553002: Rendering Insecure WebVR Warnings into a texture with Skia. (Closed)
Patch Set: Created 3 years, 8 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
(Empty)
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_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_
7
8 #include <memory>
9
10 #include "third_party/skia/include/core/SkSurface.h"
11 #include "ui/gfx/geometry/size.h"
12
13 namespace cc {
14 class PaintFlags;
15 } // namespace cc
16
17 namespace gfx {
18 class Canvas;
19 } // namespace gfx
20
21 namespace vr_shell {
22
23 class UITexture {
24 public:
25 UITexture(int texture_handle, int texture_size);
26 virtual ~UITexture();
27
28 void DrawAndLayout();
29 void Flush();
30 gfx::Size GetSize() const { return size_; }
cjgrant 2017/04/12 20:38:54 There's a naming convention for simple getters - I
acondor_ 2017/04/12 21:21:46 Done.
31
32 protected:
33 virtual void Draw(gfx::Canvas* canvas) = 0;
34 virtual void SetSize() = 0;
35 void DrawText(gfx::Canvas* canvas,
36 const std::string& text,
37 const cc::PaintFlags& flags,
38 float max_width,
39 bool v_centered);
40
41 int texture_handle_;
42 int texture_size_;
43 gfx::Size size_;
44 sk_sp<SkSurface> surface_;
45 };
46
47 } // namespace vr_shell
48
49 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_UI_TEXTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698