| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ | 5 #ifndef UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ |
| 6 #define UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ | 6 #define UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/native_library.h" | 10 #include "base/native_library.h" |
| 10 #include "ui/gfx/gfx_export.h" | 11 #include "ui/gfx/gfx_export.h" |
| 11 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
| 12 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
| 13 | 14 |
| 14 class SkCanvas; | 15 class SkCanvas; |
| 15 | 16 |
| 16 namespace gfx { | 17 namespace gfx { |
| 17 class Screen; | 18 class Screen; |
| 18 class VSyncProvider; | 19 class VSyncProvider; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // Returns a SkCanvas for the backing buffers. Drawing to the canvas will draw | 119 // Returns a SkCanvas for the backing buffers. Drawing to the canvas will draw |
| 119 // to the native surface. The canvas is intended for use when no EGL | 120 // to the native surface. The canvas is intended for use when no EGL |
| 120 // acceleration is possible. Its implementation is optional when an EGL | 121 // acceleration is possible. Its implementation is optional when an EGL |
| 121 // backend is provided for rendering. | 122 // backend is provided for rendering. |
| 122 virtual SkCanvas* GetCanvasForWidget(gfx::AcceleratedWidget w); | 123 virtual SkCanvas* GetCanvasForWidget(gfx::AcceleratedWidget w); |
| 123 | 124 |
| 124 // Returns a gfx::VsyncProvider for the provided AcceleratedWidget. Note | 125 // Returns a gfx::VsyncProvider for the provided AcceleratedWidget. Note |
| 125 // that this may be called after we have entered the sandbox so if there are | 126 // that this may be called after we have entered the sandbox so if there are |
| 126 // operations (e.g. opening a file descriptor providing vsync events) that | 127 // operations (e.g. opening a file descriptor providing vsync events) that |
| 127 // must be done outside of the sandbox, they must have been completed | 128 // must be done outside of the sandbox, they must have been completed |
| 128 // in InitializeHardware. Returns NULL on error. | 129 // in InitializeHardware. Returns an empty scoped_ptr on error. |
| 129 virtual gfx::VSyncProvider* GetVSyncProvider(gfx::AcceleratedWidget w) = 0; | 130 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider( |
| 131 gfx::AcceleratedWidget w) = 0; |
| 130 | 132 |
| 131 // Returns an array of EGL properties, which can be used in any EGL function | 133 // Returns an array of EGL properties, which can be used in any EGL function |
| 132 // used to select a display configuration. Note that all properties should be | 134 // used to select a display configuration. Note that all properties should be |
| 133 // immediately followed by the corresponding desired value and array should be | 135 // immediately followed by the corresponding desired value and array should be |
| 134 // terminated with EGL_NONE. Ownership of the array is not transferred to | 136 // terminated with EGL_NONE. Ownership of the array is not transferred to |
| 135 // caller. desired_list contains list of desired EGL properties and values. | 137 // caller. desired_list contains list of desired EGL properties and values. |
| 136 virtual const int32* GetEGLSurfaceProperties(const int32* desired_list); | 138 virtual const int32* GetEGLSurfaceProperties(const int32* desired_list); |
| 137 | 139 |
| 138 // Create a default SufaceFactoryOzone implementation useful for tests. | 140 // Create a default SufaceFactoryOzone implementation useful for tests. |
| 139 static SurfaceFactoryOzone* CreateTestHelper(); | 141 static SurfaceFactoryOzone* CreateTestHelper(); |
| 140 | 142 |
| 141 private: | 143 private: |
| 142 static SurfaceFactoryOzone* impl_; // not owned | 144 static SurfaceFactoryOzone* impl_; // not owned |
| 143 }; | 145 }; |
| 144 | 146 |
| 145 } // namespace gfx | 147 } // namespace gfx |
| 146 | 148 |
| 147 #endif // UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ | 149 #endif // UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ |
| OLD | NEW |