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/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_ |
OLD | NEW |