 Chromium Code Reviews
 Chromium Code Reviews Issue 13886018:
  Add a factory and defines for native Linux surfaces.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 13886018:
  Add a factory and defines for native Linux surfaces.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| Index: ui/base/linux/native_surface_linux_factory.h | 
| diff --git a/ui/base/linux/native_surface_linux_factory.h b/ui/base/linux/native_surface_linux_factory.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..0fc5026c20461d6263a13bb657a3695b7f80e129 | 
| --- /dev/null | 
| +++ b/ui/base/linux/native_surface_linux_factory.h | 
| @@ -0,0 +1,58 @@ | 
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#ifndef UI_BASE_LINUX_NATIVE_SURFACE_LNUX_FACTORY_ | 
| +#define UI_BASE_LINUX_NATIVE_SURFACE_LNUX_FACTORY_ | 
| + | 
| +#include "base/memory/scoped_ptr.h" | 
| +#include "ui/gfx/native_widget_types.h" | 
| + | 
| +namespace ui { | 
| + | 
| +class NativeSurfaceLinuxFactoryDelegate; | 
| + | 
| +template <typename T> struct DefaultSingletonTraits; | 
| +class NativeSurfaceLinuxFactory { | 
| + public: | 
| + | 
| 
DaveMoore
2013/04/30 17:53:42
Nit: no blank line
 
rjkroege
2013/05/06 18:46:24
Done.
 | 
| + NativeSurfaceLinuxFactory(); | 
| + ~NativeSurfaceLinuxFactory(); | 
| + | 
| + static NativeSurfaceLinuxFactory* GetInstance(); | 
| + | 
| + // Returns a display spec as in |CreateDisplayFromSpec| for the default | 
| + // native surface. | 
| + const char* DefaultDisplaySpec(); | 
| + | 
| + // Set an optional delegate. | 
| + void SetDelegate(NativeSurfaceLinuxFactoryDelegate* delegate); | 
| + | 
| + // Configure display hardware. Call this once from within the GPU process. | 
| + void InitializeHardware(); | 
| + | 
| + // Clean up display hardware state. | 
| + void ShutdownHardware(); | 
| + | 
| + // Obtain an AcceleratedWidget backed by a native Linux framebuffer. | 
| + gfx::AcceleratedWidget GetAcceleratedWidget( | 
| + const gfx::GLSurfaceHandle& handle); | 
| + | 
| + // Sets up GL bindings for the native surface. | 
| + bool LoadEGLGLES2Bindings(); | 
| + | 
| + // Test if the given AcceleratedWidget instance can be resized. (Native | 
| + // hardware may only support a single fixed size.) | 
| + bool AcceleratedWidgetCanBeResized(gfx::AcceleratedWidget w); | 
| + | 
| + private: | 
| + friend struct DefaultSingletonTraits<NativeSurfaceLinuxFactory>; | 
| + scoped_ptr<NativeSurfaceLinuxFactoryDelegate> delegate_; | 
| + | 
| + DISALLOW_COPY_AND_ASSIGN(NativeSurfaceLinuxFactory); | 
| +}; | 
| + | 
| +} // namespace ui | 
| + | 
| + | 
| +#endif // UI_BASE_LINUX_NATIVE_SURFACE_LNUX_FACTORY_ |