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

Unified 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, 8 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698