OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PLATFORM_DRI_SCANOUT_SURFACE_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_SCANOUT_SURFACE_H_ |
6 #define UI_OZONE_PLATFORM_DRI_SCANOUT_SURFACE_H_ | 6 #define UI_OZONE_PLATFORM_DRI_SCANOUT_SURFACE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 class ScanoutSurface { | 52 class ScanoutSurface { |
53 public: | 53 public: |
54 virtual ~ScanoutSurface() {} | 54 virtual ~ScanoutSurface() {} |
55 | 55 |
56 // Used to allocate all necessary buffers for this surface. If the | 56 // Used to allocate all necessary buffers for this surface. If the |
57 // initialization succeeds, the device is ready to be used for drawing | 57 // initialization succeeds, the device is ready to be used for drawing |
58 // operations. | 58 // operations. |
59 // Returns true if the initialization is successful, false otherwise. | 59 // Returns true if the initialization is successful, false otherwise. |
60 virtual bool Initialize() = 0; | 60 virtual bool Initialize() = 0; |
61 | 61 |
| 62 // Prepare the surface to be displayed. |
| 63 virtual void PreSwapBuffers() = 0; |
| 64 |
62 // Swaps the back buffer with the front buffer. | 65 // Swaps the back buffer with the front buffer. |
63 virtual void SwapBuffers() = 0; | 66 virtual void SwapBuffers() = 0; |
64 | 67 |
65 // Returns the ID of the current backbuffer. | 68 // Returns the ID of the current backbuffer. |
66 virtual uint32_t GetFramebufferId() const = 0; | 69 virtual uint32_t GetFramebufferId() const = 0; |
67 | 70 |
68 // Returns the handle of the current backbuffer. | 71 // Returns the handle of the current backbuffer. |
69 virtual uint32_t GetHandle() const = 0; | 72 virtual uint32_t GetHandle() const = 0; |
70 | 73 |
71 // Returns the surface size. | 74 // Returns the surface size. |
72 virtual gfx::Size Size() const = 0; | 75 virtual gfx::Size Size() const = 0; |
73 }; | 76 }; |
74 | 77 |
75 class ScanoutSurfaceGenerator { | 78 class ScanoutSurfaceGenerator { |
76 public: | 79 public: |
77 virtual ~ScanoutSurfaceGenerator() {} | 80 virtual ~ScanoutSurfaceGenerator() {} |
78 | 81 |
79 virtual ScanoutSurface* Create(const gfx::Size& size) = 0; | 82 virtual ScanoutSurface* Create(const gfx::Size& size) = 0; |
80 }; | 83 }; |
81 | 84 |
82 } // namespace ui | 85 } // namespace ui |
83 | 86 |
84 #endif // UI_OZONE_PLATFORM_DRI_SCANOUT_SURFACE_H_ | 87 #endif // UI_OZONE_PLATFORM_DRI_SCANOUT_SURFACE_H_ |
OLD | NEW |