Index: ui/base/ozone/surface_factory_ozone.h |
diff --git a/ui/base/ozone/surface_factory_ozone.h b/ui/base/ozone/surface_factory_ozone.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1a6023d5d71a41b19ce16b913941d3e6ccd31ddb |
--- /dev/null |
+++ b/ui/base/ozone/surface_factory_ozone.h |
@@ -0,0 +1,64 @@ |
+// 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_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ |
+#define UI_BASE_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ |
+ |
+#include "ui/gfx/native_widget_types.h" |
+ |
+namespace gfx { |
+class VSyncProvider; |
+} // namespace gfx |
+ |
+namespace ui { |
+ |
+class SurfaceFactoryOzone { |
+ public: |
+ SurfaceFactoryOzone(); |
+ virtual ~SurfaceFactoryOzone(); |
+ |
+ // Returns the instance |
+ static SurfaceFactoryOzone* GetInstance(); |
+ |
+ // Returns a display spec as in |CreateDisplayFromSpec| for the default |
+ // native surface. |
+ virtual const char* DefaultDisplaySpec(); |
+ |
+ // Set the implementation delegate. |
+ static void SetDelegate(SurfaceFactoryOzone* delegate); |
piman
2013/05/21 18:32:15
nit: SetInstance?
rjkroege
2013/05/22 17:08:30
Done.
|
+ |
+ // TODO(rjkroege): Add a status code if necessary. |
+ // Configure display hardware. Must be called from within the GPU process |
piman
2013/05/21 18:32:15
nit: Configures
rjkroege
2013/05/22 17:08:30
Done.
|
+ // before the sandbox has been activated. |
+ virtual void InitializeHardware() = 0; |
+ |
+ // Clean up display hardware state. Call this from within the GPU process. |
piman
2013/05/21 18:32:15
nit: Cleans
rjkroege
2013/05/22 17:08:30
Done.
|
+ // This method must be safe to run inside of the sandbox. |
+ virtual void ShutdownHardware() = 0; |
+ |
+ // Obtain an AcceleratedWidget backed by a native Linux framebuffer. |
piman
2013/05/21 18:32:15
nit: Obtains
rjkroege
2013/05/22 17:08:30
Done.
|
+ // The AcceleratedWidget is valid only in the GPU process. |
+ virtual gfx::AcceleratedWidget GetAcceleratedWidget( |
+ const gfx::GLSurfaceHandle& handle) = 0; |
piman
2013/05/21 18:32:15
Is this call used? I don't see it. It's also somew
rjkroege
2013/05/22 17:08:30
I think that your comment in https://codereview.ch
|
+ |
+ // Sets up GL bindings for the native surface. |
+ virtual bool LoadEGLGLES2Bindings() = 0; |
+ |
+ // Test if the given AcceleratedWidget instance can be resized. (Native |
piman
2013/05/21 18:32:15
nit: Tests
rjkroege
2013/05/22 17:08:30
Done.
|
+ // hardware may only support a single fixed size.) |
+ // Perhaps, this should be "attempt to resize the accelerated widget"? |
+ virtual bool AcceleratedWidgetCanBeResized(gfx::AcceleratedWidget w) = 0; |
+ |
+ // Returns a gfx::VsyncProvider for the provided AcceleratedWidget. Note |
+ // that this may be called after we have entered the sandbox so if there are |
+ // operations (e.g. opening a file descriptor providing vsync events) that |
+ // must be done outside of the sandbox, they must have been completed |
+ // in InitializeHardware. Returns NULL on error. |
+ virtual gfx::VSyncProvider* GetVSyncProvider(gfx::AcceleratedWidget w) = 0; |
+}; |
+ |
+} // namespace ui |
+ |
+ |
+#endif // UI_BASE_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ |