| 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_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ | 5 #ifndef UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ |
| 6 #define UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ | 6 #define UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 |
| 10 #include <memory> |
| 9 #include <vector> | 11 #include <vector> |
| 10 | 12 |
| 11 #include "base/callback.h" | 13 #include "base/callback.h" |
| 12 #include "base/macros.h" | 14 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/native_library.h" | 15 #include "base/native_library.h" |
| 15 #include "ui/gfx/buffer_types.h" | 16 #include "ui/gfx/buffer_types.h" |
| 16 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
| 17 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
| 18 #include "ui/gfx/overlay_transform.h" | 19 #include "ui/gfx/overlay_transform.h" |
| 19 #include "ui/ozone/ozone_base_export.h" | 20 #include "ui/ozone/ozone_base_export.h" |
| 20 #include "ui/ozone/public/native_pixmap.h" | 21 #include "ui/ozone/public/native_pixmap.h" |
| 21 | 22 |
| 22 namespace ui { | 23 namespace ui { |
| 23 | 24 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 64 |
| 64 // Returns native platform display handle. This is used to obtain the EGL | 65 // Returns native platform display handle. This is used to obtain the EGL |
| 65 // display connection for the native display. | 66 // display connection for the native display. |
| 66 virtual intptr_t GetNativeDisplay(); | 67 virtual intptr_t GetNativeDisplay(); |
| 67 | 68 |
| 68 // Create SurfaceOzoneEGL for the specified gfx::AcceleratedWidget. | 69 // Create SurfaceOzoneEGL for the specified gfx::AcceleratedWidget. |
| 69 // | 70 // |
| 70 // Note: When used from content, this is called in the GPU process. The | 71 // Note: When used from content, this is called in the GPU process. The |
| 71 // platform must support creation of SurfaceOzoneEGL from the GPU process | 72 // platform must support creation of SurfaceOzoneEGL from the GPU process |
| 72 // using only the handle contained in gfx::AcceleratedWidget. | 73 // using only the handle contained in gfx::AcceleratedWidget. |
| 73 virtual scoped_ptr<SurfaceOzoneEGL> CreateEGLSurfaceForWidget( | 74 virtual std::unique_ptr<SurfaceOzoneEGL> CreateEGLSurfaceForWidget( |
| 74 gfx::AcceleratedWidget widget); | 75 gfx::AcceleratedWidget widget); |
| 75 | 76 |
| 76 // Create an EGL surface that isn't backed by any buffers, and is used | 77 // Create an EGL surface that isn't backed by any buffers, and is used |
| 77 // for overlay-only displays. This will return NULL if this mode is | 78 // for overlay-only displays. This will return NULL if this mode is |
| 78 // not supported. | 79 // not supported. |
| 79 virtual scoped_ptr<SurfaceOzoneEGL> CreateSurfacelessEGLSurfaceForWidget( | 80 virtual std::unique_ptr<SurfaceOzoneEGL> CreateSurfacelessEGLSurfaceForWidget( |
| 80 gfx::AcceleratedWidget widget); | 81 gfx::AcceleratedWidget widget); |
| 81 | 82 |
| 82 // Create SurfaceOzoneCanvas for the specified gfx::AcceleratedWidget. | 83 // Create SurfaceOzoneCanvas for the specified gfx::AcceleratedWidget. |
| 83 // | 84 // |
| 84 // Note: The platform must support creation of SurfaceOzoneCanvas from the | 85 // Note: The platform must support creation of SurfaceOzoneCanvas from the |
| 85 // Browser Process using only the handle contained in gfx::AcceleratedWidget. | 86 // Browser Process using only the handle contained in gfx::AcceleratedWidget. |
| 86 virtual scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( | 87 virtual std::unique_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget( |
| 87 gfx::AcceleratedWidget widget); | 88 gfx::AcceleratedWidget widget); |
| 88 | 89 |
| 89 // Sets up GL bindings for the native surface. Takes two callback parameters | 90 // Sets up GL bindings for the native surface. Takes two callback parameters |
| 90 // that allow Ozone to register the GL bindings. | 91 // that allow Ozone to register the GL bindings. |
| 91 virtual bool LoadEGLGLES2Bindings( | 92 virtual bool LoadEGLGLES2Bindings( |
| 92 AddGLLibraryCallback add_gl_library, | 93 AddGLLibraryCallback add_gl_library, |
| 93 SetGLGetProcAddressProcCallback set_gl_get_proc_address) = 0; | 94 SetGLGetProcAddressProcCallback set_gl_get_proc_address) = 0; |
| 94 | 95 |
| 95 // Returns all scanout formats for |widget| representing a particular display | 96 // Returns all scanout formats for |widget| representing a particular display |
| 96 // controller or default display controller for kNullAcceleratedWidget. | 97 // controller or default display controller for kNullAcceleratedWidget. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 118 SurfaceFactoryOzone(); | 119 SurfaceFactoryOzone(); |
| 119 virtual ~SurfaceFactoryOzone(); | 120 virtual ~SurfaceFactoryOzone(); |
| 120 | 121 |
| 121 private: | 122 private: |
| 122 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryOzone); | 123 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryOzone); |
| 123 }; | 124 }; |
| 124 | 125 |
| 125 } // namespace ui | 126 } // namespace ui |
| 126 | 127 |
| 127 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ | 128 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ |
| OLD | NEW |