Chromium Code Reviews| 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/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/gfx_export.h" | 13 #include "ui/gfx/gfx_export.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 15 #include "ui/gfx/rect.h" | |
| 15 | 16 |
| 16 class SkBitmap; | 17 class SkBitmap; |
| 17 class SkCanvas; | 18 class SkCanvas; |
| 18 | 19 |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 class VSyncProvider; | 21 class VSyncProvider; |
| 22 class OverlayHALOzone; | |
| 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 |
| 25 // through Skia. | 27 // through Skia. |
| 26 // | 28 // |
| 27 // The following functionality is specific to the drawing mode and may not have | 29 // The following functionality is specific to the drawing mode and may not have |
| 28 // any meaningful implementation in the other mode. An implementation must | 30 // any meaningful implementation in the other mode. An implementation must |
| 29 // provide functionality for at least one mode. | 31 // provide functionality for at least one mode. |
| 30 // | 32 // |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 48 // modes (See comments bellow for descriptions). | 50 // modes (See comments bellow for descriptions). |
| 49 class GFX_EXPORT SurfaceFactoryOzone { | 51 class GFX_EXPORT SurfaceFactoryOzone { |
| 50 public: | 52 public: |
| 51 // Describes the state of the hardware after initialization. | 53 // Describes the state of the hardware after initialization. |
| 52 enum HardwareState { | 54 enum HardwareState { |
| 53 UNINITIALIZED, | 55 UNINITIALIZED, |
| 54 INITIALIZED, | 56 INITIALIZED, |
| 55 FAILED, | 57 FAILED, |
| 56 }; | 58 }; |
| 57 | 59 |
| 60 // Describes overlay buffer format. | |
| 61 enum BufferFormat { | |
|
rjkroege
2014/02/27 23:18:19
I would imagine that we would add more here.
Is t
alexst (slow to review)
2014/02/28 18:59:34
We may have some new formats like multiplane YUV t
| |
| 62 UNKNOWN, | |
| 63 RGBA, | |
| 64 RGB, | |
| 65 }; | |
| 66 | |
| 67 // Describes transformation to be applied to the buffer before presenting | |
|
rjkroege
2014/02/27 23:18:19
do we anticipate that there will be more complex t
alexst (slow to review)
2014/02/28 18:59:34
Possibly, but let's walk before we run. This expos
| |
| 68 // to screen. | |
| 69 enum OverlayTransform { | |
| 70 NONE, | |
| 71 FLIP_HORIZONTAL, | |
| 72 FLIP_VERTICAL, | |
| 73 ROTATE_90, | |
| 74 ROTATE_180, | |
| 75 ROTATE_270, | |
| 76 }; | |
| 77 | |
| 58 typedef void*(*GLGetProcAddressProc)(const char* name); | 78 typedef void*(*GLGetProcAddressProc)(const char* name); |
| 59 typedef base::Callback<void(base::NativeLibrary)> AddGLLibraryCallback; | 79 typedef base::Callback<void(base::NativeLibrary)> AddGLLibraryCallback; |
| 60 typedef base::Callback<void(GLGetProcAddressProc)> | 80 typedef base::Callback<void(GLGetProcAddressProc)> |
| 61 SetGLGetProcAddressProcCallback; | 81 SetGLGetProcAddressProcCallback; |
| 62 | 82 |
| 63 SurfaceFactoryOzone(); | 83 SurfaceFactoryOzone(); |
| 64 virtual ~SurfaceFactoryOzone(); | 84 virtual ~SurfaceFactoryOzone(); |
| 65 | 85 |
| 66 // Returns the instance | 86 // Returns the instance |
| 67 static SurfaceFactoryOzone* GetInstance(); | 87 static SurfaceFactoryOzone* GetInstance(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 // terminated with EGL_NONE. Ownership of the array is not transferred to | 149 // terminated with EGL_NONE. Ownership of the array is not transferred to |
| 130 // caller. desired_list contains list of desired EGL properties and values. | 150 // caller. desired_list contains list of desired EGL properties and values. |
| 131 virtual const int32* GetEGLSurfaceProperties(const int32* desired_list); | 151 virtual const int32* GetEGLSurfaceProperties(const int32* desired_list); |
| 132 | 152 |
| 133 // Sets the cursor image to |image|. | 153 // Sets the cursor image to |image|. |
| 134 virtual void SetCursorImage(const SkBitmap& image); | 154 virtual void SetCursorImage(const SkBitmap& image); |
| 135 | 155 |
| 136 // Sets the cursor position to |location|. | 156 // Sets the cursor position to |location|. |
| 137 virtual void MoveCursorTo(const gfx::Point& location); | 157 virtual void MoveCursorTo(const gfx::Point& location); |
| 138 | 158 |
| 159 // Get the hal struct to check for overlay support. | |
| 160 virtual gfx::OverlayHALOzone* GetOverlayHAL(); | |
| 161 | |
| 162 // Sets the overlay plane to switch to at the next page flip. | |
|
rjkroege
2014/02/27 23:18:19
the comment needs to specify what the args are for
alexst (slow to review)
2014/02/28 18:59:34
Done.
| |
| 163 virtual void SetOverlayPlane(int plane_id, | |
| 164 OverlayTransform plane_transform, | |
| 165 gfx::AcceleratedWidget handle, | |
| 166 const gfx::Rect& bounds); | |
| 167 | |
| 168 // Cleate a single native buffer to be used for overlay planes. | |
| 169 virtual gfx::AcceleratedWidget CreateNativeBuffer(gfx::Size size, | |
|
rjkroege
2014/02/27 23:18:19
The properties of bing an overlay plan end up bein
alexst (slow to review)
2014/02/28 18:59:34
Done.
| |
| 170 BufferFormat format); | |
| 171 | |
| 139 private: | 172 private: |
| 140 static SurfaceFactoryOzone* impl_; // not owned | 173 static SurfaceFactoryOzone* impl_; // not owned |
| 141 }; | 174 }; |
| 142 | 175 |
| 143 } // namespace gfx | 176 } // namespace gfx |
| 144 | 177 |
| 145 #endif // UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ | 178 #endif // UI_GFX_OZONE_SURFACE_LNUX_FACTORY_OZONE_H_ |
| OLD | NEW |