| 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/point.h" | 11 #include "ui/gfx/geometry/point.h" |
| 12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
| 14 #include "ui/gfx/gpu_memory_buffer.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 15 #include "ui/gfx/overlay_transform.h" | 16 #include "ui/gfx/overlay_transform.h" |
| 16 #include "ui/ozone/ozone_base_export.h" | 17 #include "ui/ozone/ozone_base_export.h" |
| 17 | 18 |
| 18 class SkBitmap; | 19 class SkBitmap; |
| 19 class SkCanvas; | 20 class SkCanvas; |
| 20 | 21 |
| 21 namespace ui { | 22 namespace ui { |
| 22 | 23 |
| 23 class NativePixmap; | 24 class NativePixmap; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // | 57 // |
| 57 // The remaining functions are not covered since they are needed in both drawing | 58 // The remaining functions are not covered since they are needed in both drawing |
| 58 // modes (See comments bellow for descriptions). | 59 // modes (See comments bellow for descriptions). |
| 59 class OZONE_BASE_EXPORT SurfaceFactoryOzone { | 60 class OZONE_BASE_EXPORT SurfaceFactoryOzone { |
| 60 public: | 61 public: |
| 61 // Describes overlay buffer format. | 62 // Describes overlay buffer format. |
| 62 // TODO: this is a placeholder for now and will be populated with more | 63 // TODO: this is a placeholder for now and will be populated with more |
| 63 // formats once we know what sorts of content, video, etc. we can support. | 64 // formats once we know what sorts of content, video, etc. we can support. |
| 64 enum BufferFormat { | 65 enum BufferFormat { |
| 65 UNKNOWN, | 66 UNKNOWN, |
| 66 RGBA_8888, | 67 BGRA_8888, |
| 67 RGBX_8888, | 68 RGBX_8888, |
| 68 RGB_888, | 69 RGB_888, |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 enum BufferUsage { | 72 enum BufferUsage { |
| 72 MAP, | 73 MAP, |
| 73 SCANOUT, | 74 SCANOUT, |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 typedef void* (*GLGetProcAddressProc)(const char* name); | 77 typedef void* (*GLGetProcAddressProc)(const char* name); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 virtual OverlayCandidatesOzone* GetOverlayCandidates( | 131 virtual OverlayCandidatesOzone* GetOverlayCandidates( |
| 131 gfx::AcceleratedWidget w); | 132 gfx::AcceleratedWidget w); |
| 132 | 133 |
| 133 // Create a single native buffer to be used for overlay planes or zero copy | 134 // Create a single native buffer to be used for overlay planes or zero copy |
| 134 // for |widget| representing a particular display controller or default | 135 // for |widget| representing a particular display controller or default |
| 135 // display controller for kNullAcceleratedWidget. | 136 // display controller for kNullAcceleratedWidget. |
| 136 virtual scoped_refptr<NativePixmap> CreateNativePixmap( | 137 virtual scoped_refptr<NativePixmap> CreateNativePixmap( |
| 137 gfx::AcceleratedWidget widget, | 138 gfx::AcceleratedWidget widget, |
| 138 gfx::Size size, | 139 gfx::Size size, |
| 139 BufferFormat format, | 140 BufferFormat format, |
| 140 BufferUsage usage); | 141 BufferUsage usage, |
| 142 gfx::GpuMemoryBufferHandle* handle); |
| 141 | 143 |
| 142 // Sets the overlay plane to switch to at the next page flip. | 144 // Sets the overlay plane to switch to at the next page flip. |
| 143 // |w| specifies the screen to display this overlay plane on. | 145 // |w| specifies the screen to display this overlay plane on. |
| 144 // |plane_z_order| specifies the stacking order of the plane relative to the | 146 // |plane_z_order| specifies the stacking order of the plane relative to the |
| 145 // main framebuffer located at index 0. | 147 // main framebuffer located at index 0. |
| 146 // |plane_transform| specifies how the buffer is to be transformed during. | 148 // |plane_transform| specifies how the buffer is to be transformed during. |
| 147 // composition. | 149 // composition. |
| 148 // |buffer| to be presented by the overlay. | 150 // |buffer| to be presented by the overlay. |
| 149 // |display_bounds| specify where it is supposed to be on the screen. | 151 // |display_bounds| specify where it is supposed to be on the screen. |
| 150 // |crop_rect| specifies the region within the buffer to be placed | 152 // |crop_rect| specifies the region within the buffer to be placed |
| (...skipping 15 matching lines...) Expand all Loading... |
| 166 // such as MAP for zero copy or SCANOUT for display controller. | 168 // such as MAP for zero copy or SCANOUT for display controller. |
| 167 virtual bool CanCreateNativePixmap(BufferUsage usage); | 169 virtual bool CanCreateNativePixmap(BufferUsage usage); |
| 168 | 170 |
| 169 private: | 171 private: |
| 170 static SurfaceFactoryOzone* impl_; // not owned | 172 static SurfaceFactoryOzone* impl_; // not owned |
| 171 }; | 173 }; |
| 172 | 174 |
| 173 } // namespace ui | 175 } // namespace ui |
| 174 | 176 |
| 175 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ | 177 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ |
| OLD | NEW |