| 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 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/native_library.h" | 16 #include "base/native_library.h" |
| 17 #include "ui/gfx/buffer_types.h" | 17 #include "ui/gfx/buffer_types.h" |
| 18 #include "ui/gfx/geometry/rect.h" | 18 #include "ui/gfx/geometry/rect.h" |
| 19 #include "ui/gfx/native_pixmap.h" | 19 #include "ui/gfx/native_pixmap.h" |
| 20 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
| 21 #include "ui/gfx/overlay_transform.h" | 21 #include "ui/gfx/overlay_transform.h" |
| 22 #include "ui/gl/gl_implementation.h" | 22 #include "ui/gl/gl_implementation.h" |
| 23 #include "ui/ozone/ozone_base_export.h" | 23 #include "ui/ozone/ozone_base_export.h" |
| 24 #include "ui/ozone/public/gl_ozone.h" | 24 #include "ui/ozone/public/gl_ozone.h" |
| 25 | 25 |
| 26 namespace gfx { |
| 27 class NativePixmap; |
| 28 } |
| 29 |
| 26 namespace ui { | 30 namespace ui { |
| 27 | 31 |
| 28 class NativePixmap; | |
| 29 class SurfaceOzoneCanvas; | 32 class SurfaceOzoneCanvas; |
| 30 | 33 |
| 31 // The Ozone interface allows external implementations to hook into Chromium to | 34 // The Ozone interface allows external implementations to hook into Chromium to |
| 32 // provide a system specific implementation. The Ozone interface supports two | 35 // provide a system specific implementation. The Ozone interface supports two |
| 33 // drawing modes: 1) accelerated drawing using GL and 2) software drawing | 36 // drawing modes: 1) accelerated drawing using GL and 2) software drawing |
| 34 // through Skia. | 37 // through Skia. |
| 35 // | 38 // |
| 36 // If you want to paint on a window with ozone, you need to create a GLSurface | 39 // If you want to paint on a window with ozone, you need to create a GLSurface |
| 37 // or SurfaceOzoneCanvas for that window. The platform can support software, GL, | 40 // or SurfaceOzoneCanvas for that window. The platform can support software, GL, |
| 38 // or both for painting on the window. The following functionality is specific | 41 // or both for painting on the window. The following functionality is specific |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 78 |
| 76 // Returns all scanout formats for |widget| representing a particular display | 79 // Returns all scanout formats for |widget| representing a particular display |
| 77 // controller or default display controller for kNullAcceleratedWidget. | 80 // controller or default display controller for kNullAcceleratedWidget. |
| 78 virtual std::vector<gfx::BufferFormat> GetScanoutFormats( | 81 virtual std::vector<gfx::BufferFormat> GetScanoutFormats( |
| 79 gfx::AcceleratedWidget widget); | 82 gfx::AcceleratedWidget widget); |
| 80 | 83 |
| 81 // Create a single native buffer to be used for overlay planes or zero copy | 84 // Create a single native buffer to be used for overlay planes or zero copy |
| 82 // for |widget| representing a particular display controller or default | 85 // for |widget| representing a particular display controller or default |
| 83 // display controller for kNullAcceleratedWidget. | 86 // display controller for kNullAcceleratedWidget. |
| 84 // It can be called on any thread. | 87 // It can be called on any thread. |
| 85 virtual scoped_refptr<NativePixmap> CreateNativePixmap( | 88 virtual scoped_refptr<gfx::NativePixmap> CreateNativePixmap( |
| 86 gfx::AcceleratedWidget widget, | 89 gfx::AcceleratedWidget widget, |
| 87 gfx::Size size, | 90 gfx::Size size, |
| 88 gfx::BufferFormat format, | 91 gfx::BufferFormat format, |
| 89 gfx::BufferUsage usage); | 92 gfx::BufferUsage usage); |
| 90 | 93 |
| 91 // Create a single native buffer from an existing handle. Takes ownership of | 94 // Create a single native buffer from an existing handle. Takes ownership of |
| 92 // |handle| and can be called on any thread. | 95 // |handle| and can be called on any thread. |
| 93 virtual scoped_refptr<NativePixmap> CreateNativePixmapFromHandle( | 96 virtual scoped_refptr<gfx::NativePixmap> CreateNativePixmapFromHandle( |
| 94 gfx::AcceleratedWidget widget, | 97 gfx::AcceleratedWidget widget, |
| 95 gfx::Size size, | 98 gfx::Size size, |
| 96 gfx::BufferFormat format, | 99 gfx::BufferFormat format, |
| 97 const gfx::NativePixmapHandle& handle); | 100 const gfx::NativePixmapHandle& handle); |
| 98 | 101 |
| 99 protected: | 102 protected: |
| 100 SurfaceFactoryOzone(); | 103 SurfaceFactoryOzone(); |
| 101 virtual ~SurfaceFactoryOzone(); | 104 virtual ~SurfaceFactoryOzone(); |
| 102 | 105 |
| 103 private: | 106 private: |
| 104 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryOzone); | 107 DISALLOW_COPY_AND_ASSIGN(SurfaceFactoryOzone); |
| 105 }; | 108 }; |
| 106 | 109 |
| 107 } // namespace ui | 110 } // namespace ui |
| 108 | 111 |
| 109 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ | 112 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ |
| OLD | NEW |