| 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..37a62aea22873ff864984df4b77a1c2297ef3489
|
| --- /dev/null
|
| +++ b/ui/base/linux/native_surface_linux_factory.h
|
| @@ -0,0 +1,59 @@
|
| +// 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/base/ui_export.h"
|
| +#include "ui/gfx/native_widget_types.h"
|
| +
|
| +namespace ui {
|
| +
|
| +class NativeSurfaceLinuxFactoryDelegate;
|
| +
|
| +template <typename T> struct DefaultSingletonTraits;
|
| +class NativeSurfaceLinuxFactory {
|
| + public:
|
| +
|
| + NativeSurfaceLinuxFactory();
|
| + ~NativeSurfaceLinuxFactory();
|
| +
|
| + UI_EXPORT 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.
|
| + UI_EXPORT 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.
|
| + UI_EXPORT 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_
|
|
|