Atomic: Notify Watcher to observe device fd
[chromium-blink-merge.git] / ui / ozone / platform / drm / gpu / scanout_buffer.h
bloba0bd87a63a71c5ea063054e89859b095ada5c7e3
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
3 // found in the LICENSE file.
5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_SCANOUT_BUFFER_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_SCANOUT_BUFFER_H_
8 #include <stdint.h>
10 #include "base/memory/ref_counted.h"
11 #include "ui/gfx/geometry/size.h"
13 namespace ui {
15 class DrmDevice;
17 // Abstraction for a DRM buffer that can be scanned-out of.
18 class ScanoutBuffer : public base::RefCountedThreadSafe<ScanoutBuffer> {
19 public:
20 // ID allocated by the KMS API when the buffer is registered (via the handle).
21 virtual uint32_t GetFramebufferId() const = 0;
23 // Handle for the buffer. This is received when allocating the buffer.
24 virtual uint32_t GetHandle() const = 0;
26 // Size of the buffer.
27 virtual gfx::Size GetSize() const = 0;
29 // Format of the buffer.
30 virtual uint32_t GetFormat() const = 0;
32 protected:
33 virtual ~ScanoutBuffer() {}
35 friend class base::RefCountedThreadSafe<ScanoutBuffer>;
38 class ScanoutBufferGenerator {
39 public:
40 virtual ~ScanoutBufferGenerator() {}
42 virtual scoped_refptr<ScanoutBuffer> Create(
43 const scoped_refptr<DrmDevice>& drm,
44 const gfx::Size& size) = 0;
47 } // namespace ui
49 #endif // UI_OZONE_PLATFORM_DRM_GPU_SCANOUT_BUFFER_H_