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

Side by Side Diff: ui/base/linux/native_surface_linux_factory.h

Issue 13886018: Add a factory and defines for native Linux surfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get {base,ui,aura}_unittests working with native linux surface Created 7 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 | Annotate | Revision Log
OLDNEW
(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/base/ui_export.h"
10 #include "ui/gfx/native_widget_types.h"
11
12 namespace ui {
13
14 class NativeSurfaceLinuxFactoryDelegate;
15
16 template <typename T> struct DefaultSingletonTraits;
17 class NativeSurfaceLinuxFactory {
18 public:
19
20 NativeSurfaceLinuxFactory();
21 ~NativeSurfaceLinuxFactory();
22
23 UI_EXPORT static NativeSurfaceLinuxFactory* GetInstance();
24
25 // Returns a display spec as in |CreateDisplayFromSpec| for the default
26 // native surface.
27 const char* DefaultDisplaySpec();
28
29 // Set an optional delegate.
30 void SetDelegate(NativeSurfaceLinuxFactoryDelegate* delegate);
31
32 // Configure display hardware. Call this once from within the GPU process.
33 UI_EXPORT void InitializeHardware();
34
35 // Clean up display hardware state.
36 void ShutdownHardware();
37
38 // Obtain an AcceleratedWidget backed by a native Linux framebuffer.
39 gfx::AcceleratedWidget GetAcceleratedWidget(
40 const gfx::GLSurfaceHandle& handle);
41
42 // Sets up GL bindings for the native surface.
43 UI_EXPORT bool LoadEGLGLES2Bindings();
44
45 // Test if the given AcceleratedWidget instance can be resized. (Native
46 // hardware may only support a single fixed size.)
47 bool AcceleratedWidgetCanBeResized(gfx::AcceleratedWidget w);
48
49 private:
50 friend struct DefaultSingletonTraits<NativeSurfaceLinuxFactory>;
51 scoped_ptr<NativeSurfaceLinuxFactoryDelegate> delegate_;
52
53 DISALLOW_COPY_AND_ASSIGN(NativeSurfaceLinuxFactory);
54 };
55
56 } // namespace ui
57
58
59 #endif // UI_BASE_LINUX_NATIVE_SURFACE_LNUX_FACTORY_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698