| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/native_library.h" | 10 #include "base/native_library.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 #include "ui/gfx/native_pixmap_handle_ozone.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/gfx/overlay_transform.h" | 14 #include "ui/gfx/overlay_transform.h" |
| 14 #include "ui/ozone/ozone_base_export.h" | 15 #include "ui/ozone/ozone_base_export.h" |
| 16 #include "ui/ozone/public/native_pixmap.h" |
| 15 | 17 |
| 16 namespace ui { | 18 namespace ui { |
| 17 | 19 |
| 18 class NativePixmap; | 20 class NativePixmap; |
| 19 class SurfaceOzoneCanvas; | 21 class SurfaceOzoneCanvas; |
| 20 class SurfaceOzoneEGL; | 22 class SurfaceOzoneEGL; |
| 21 | 23 |
| 22 // The Ozone interface allows external implementations to hook into Chromium to | 24 // The Ozone interface allows external implementations to hook into Chromium to |
| 23 // provide a system specific implementation. The Ozone interface supports two | 25 // provide a system specific implementation. The Ozone interface supports two |
| 24 // drawing modes: 1) accelerated drawing through EGL and 2) software drawing | 26 // drawing modes: 1) accelerated drawing through EGL and 2) software drawing |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Create a single native buffer to be used for overlay planes or zero copy | 116 // Create a single native buffer to be used for overlay planes or zero copy |
| 115 // for |widget| representing a particular display controller or default | 117 // for |widget| representing a particular display controller or default |
| 116 // display controller for kNullAcceleratedWidget. | 118 // display controller for kNullAcceleratedWidget. |
| 117 // It can be called on any thread. | 119 // It can be called on any thread. |
| 118 virtual scoped_refptr<NativePixmap> CreateNativePixmap( | 120 virtual scoped_refptr<NativePixmap> CreateNativePixmap( |
| 119 gfx::AcceleratedWidget widget, | 121 gfx::AcceleratedWidget widget, |
| 120 gfx::Size size, | 122 gfx::Size size, |
| 121 BufferFormat format, | 123 BufferFormat format, |
| 122 BufferUsage usage); | 124 BufferUsage usage); |
| 123 | 125 |
| 126 // Create a single native buffer from an existing handle. Takes ownership of |
| 127 // |handle| and can be called on any thread. |
| 128 virtual scoped_refptr<NativePixmap> CreateNativePixmapFromHandle( |
| 129 gfx::AcceleratedWidget widget, |
| 130 gfx::Size size, |
| 131 const gfx::NativePixmapHandle& handle); |
| 132 |
| 124 // Returns true if overlays can be shown at z-index 0, replacing the main | 133 // Returns true if overlays can be shown at z-index 0, replacing the main |
| 125 // surface. Combined with surfaceless extensions, it allows for an | 134 // surface. Combined with surfaceless extensions, it allows for an |
| 126 // overlay-only mode. | 135 // overlay-only mode. |
| 127 virtual bool CanShowPrimaryPlaneAsOverlay(); | 136 virtual bool CanShowPrimaryPlaneAsOverlay(); |
| 128 | 137 |
| 129 // Returns true if the platform is able to create buffers for a specific usage | 138 // Returns true if the platform is able to create buffers for a specific usage |
| 130 // such as MAP for zero copy or SCANOUT for display controller. | 139 // such as MAP for zero copy or SCANOUT for display controller. |
| 131 virtual bool CanCreateNativePixmap(BufferUsage usage); | 140 virtual bool CanCreateNativePixmap(BufferUsage usage); |
| 132 | 141 |
| 133 protected: | 142 protected: |
| 134 SurfaceFactoryOzone(); | 143 SurfaceFactoryOzone(); |
| 135 virtual ~SurfaceFactoryOzone(); | 144 virtual ~SurfaceFactoryOzone(); |
| 136 | 145 |
| 137 private: | 146 private: |
| 138 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryOzone); | 147 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryOzone); |
| 139 }; | 148 }; |
| 140 | 149 |
| 141 } // namespace ui | 150 } // namespace ui |
| 142 | 151 |
| 143 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ | 152 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ |
| OLD | NEW |