OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 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 UI_BASE_LINUX_NATIVE_SURFACE_LNUX_FACTORY_ | |
6 #define UI_BASE_LINUX_NATIVE_SURFACE_LNUX_FACTORY_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "ui/gfx/native_widget_types.h" | |
10 | |
11 namespace ui { | |
12 | |
13 class NativeSurfaceLinuxFactoryDelegate; | |
14 | |
15 template <typename T> struct DefaultSingletonTraits; | |
16 class NativeSurfaceLinuxFactory { | |
17 public: | |
18 | |
DaveMoore
2013/04/30 17:53:42
Nit: no blank line
rjkroege
2013/05/06 18:46:24
Done.
| |
19 NativeSurfaceLinuxFactory(); | |
20 ~NativeSurfaceLinuxFactory(); | |
21 | |
22 static NativeSurfaceLinuxFactory* GetInstance(); | |
23 | |
24 // Returns a display spec as in |CreateDisplayFromSpec| for the default | |
25 // native surface. | |
26 const char* DefaultDisplaySpec(); | |
27 | |
28 // Set an optional delegate. | |
29 void SetDelegate(NativeSurfaceLinuxFactoryDelegate* delegate); | |
30 | |
31 // Configure display hardware. Call this once from within the GPU process. | |
32 void InitializeHardware(); | |
33 | |
34 // Clean up display hardware state. | |
35 void ShutdownHardware(); | |
36 | |
37 // Obtain an AcceleratedWidget backed by a native Linux framebuffer. | |
38 gfx::AcceleratedWidget GetAcceleratedWidget( | |
39 const gfx::GLSurfaceHandle& handle); | |
40 | |
41 // Sets up GL bindings for the native surface. | |
42 bool LoadEGLGLES2Bindings(); | |
43 | |
44 // Test if the given AcceleratedWidget instance can be resized. (Native | |
45 // hardware may only support a single fixed size.) | |
46 bool AcceleratedWidgetCanBeResized(gfx::AcceleratedWidget w); | |
47 | |
48 private: | |
49 friend struct DefaultSingletonTraits<NativeSurfaceLinuxFactory>; | |
50 scoped_ptr<NativeSurfaceLinuxFactoryDelegate> delegate_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(NativeSurfaceLinuxFactory); | |
53 }; | |
54 | |
55 } // namespace ui | |
56 | |
57 | |
58 #endif // UI_BASE_LINUX_NATIVE_SURFACE_LNUX_FACTORY_ | |
OLD | NEW |