Chromium Code Reviews| Index: ui/ozone/platform/dri/scanout_surface.h |
| diff --git a/ui/ozone/platform/dri/scanout_surface.h b/ui/ozone/platform/dri/scanout_surface.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f7775c8bef54e26f25e397c2118864f66f3e27d0 |
| --- /dev/null |
| +++ b/ui/ozone/platform/dri/scanout_surface.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_OZONE_PLATFORM_DRI_SCANOUT_SURFACE_H_ |
| +#define UI_OZONE_PLATFORM_DRI_SCANOUT_SURFACE_H_ |
| + |
| +#include <stdint.h> |
| + |
| +namespace gfx { |
| +class Size; |
| +} |
| + |
| +namespace ui { |
| + |
| +// Initializes and stores state associated with the drawing surface. |
|
rjkroege
2014/05/27 15:33:42
I'd appreciate a bit more explanation here.
dnicoara
2014/05/27 17:20:52
Done. Moved the generic part from DriSurface here.
|
| +class ScanoutSurface { |
| + public: |
| + virtual ~ScanoutSurface() {} |
| + |
| + // Used to allocate all necessary buffers for this surface. If the |
| + // initialization succeeds, the device is ready to be used for drawing |
| + // operations. |
| + // Returns true if the initialization is successful, false otherwise. |
| + virtual bool Initialize() = 0; |
| + |
| + // Swaps the back buffer with the front buffer. |
| + virtual void SwapBuffers() = 0; |
| + |
| + // Returns the ID of the current backbuffer. |
| + virtual uint32_t GetFramebufferId() const = 0; |
| + |
| + // Returns the handle of the current backbuffer. |
| + virtual uint32_t GetHandle() const = 0; |
| + |
| + // Returns the surface size. |
| + virtual gfx::Size Size() const = 0; |
| +}; |
| + |
| +class ScanoutSurfaceGenerator { |
| + public: |
| + virtual ~ScanoutSurfaceGenerator() {} |
| + |
| + virtual ScanoutSurface* Create(const gfx::Size& size) = 0; |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // UI_OZONE_PLATFORM_DRI_SCANOUT_SURFACE_H_ |