Chromium Code Reviews| 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_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ | |
| 6 #define UI_BASE_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ | |
| 7 | |
| 8 #include "ui/gfx/native_widget_types.h" | |
| 9 | |
| 10 namespace gfx { | |
| 11 class VSyncProvider; | |
| 12 } // namespace gfx | |
| 13 | |
| 14 namespace ui { | |
| 15 | |
| 16 class SurfaceFactoryOzone { | |
| 17 public: | |
| 18 SurfaceFactoryOzone(); | |
| 19 virtual ~SurfaceFactoryOzone(); | |
| 20 | |
| 21 // Returns the instance | |
| 22 static SurfaceFactoryOzone* GetInstance(); | |
| 23 | |
| 24 // Returns a display spec as in |CreateDisplayFromSpec| for the default | |
| 25 // native surface. | |
| 26 virtual const char* DefaultDisplaySpec(); | |
| 27 | |
| 28 // Set the implementation delegate. | |
| 29 static void SetDelegate(SurfaceFactoryOzone* delegate); | |
|
piman
2013/05/21 18:32:15
nit: SetInstance?
rjkroege
2013/05/22 17:08:30
Done.
| |
| 30 | |
| 31 // TODO(rjkroege): Add a status code if necessary. | |
| 32 // 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.
| |
| 33 // before the sandbox has been activated. | |
| 34 virtual void InitializeHardware() = 0; | |
| 35 | |
| 36 // 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.
| |
| 37 // This method must be safe to run inside of the sandbox. | |
| 38 virtual void ShutdownHardware() = 0; | |
| 39 | |
| 40 // 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.
| |
| 41 // The AcceleratedWidget is valid only in the GPU process. | |
| 42 virtual gfx::AcceleratedWidget GetAcceleratedWidget( | |
| 43 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
| |
| 44 | |
| 45 // Sets up GL bindings for the native surface. | |
| 46 virtual bool LoadEGLGLES2Bindings() = 0; | |
| 47 | |
| 48 // 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.
| |
| 49 // hardware may only support a single fixed size.) | |
| 50 // Perhaps, this should be "attempt to resize the accelerated widget"? | |
| 51 virtual bool AcceleratedWidgetCanBeResized(gfx::AcceleratedWidget w) = 0; | |
| 52 | |
| 53 // Returns a gfx::VsyncProvider for the provided AcceleratedWidget. Note | |
| 54 // that this may be called after we have entered the sandbox so if there are | |
| 55 // operations (e.g. opening a file descriptor providing vsync events) that | |
| 56 // must be done outside of the sandbox, they must have been completed | |
| 57 // in InitializeHardware. Returns NULL on error. | |
| 58 virtual gfx::VSyncProvider* GetVSyncProvider(gfx::AcceleratedWidget w) = 0; | |
| 59 }; | |
| 60 | |
| 61 } // namespace ui | |
| 62 | |
| 63 | |
| 64 #endif // UI_BASE_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ | |
| OLD | NEW |