summaryrefslogtreecommitdiffstats
path: root/ui/ozone/platform/drm/gpu/mock_scanout_buffer.h
blob: d1b4f0fa4cb9ed15f51e5a94e83ab22265a6da19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2015 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_DRM_GPU_MOCK_SCANOUT_BUFFER_H_
#define UI_OZONE_PLATFORM_DRM_GPU_MOCK_SCANOUT_BUFFER_H_

#include <drm_fourcc.h>

#include "ui/ozone/platform/drm/gpu/scanout_buffer.h"

namespace ui {

class MockScanoutBuffer : public ScanoutBuffer {
 public:
  MockScanoutBuffer(const gfx::Size& size,
                    uint32_t format = DRM_FORMAT_XRGB8888);

  // ScanoutBuffer:
  uint32_t GetFramebufferId() const override;
  uint32_t GetHandle() const override;
  gfx::Size GetSize() const override;
  uint32_t GetFramebufferPixelFormat() const override;
  bool RequiresGlFinish() const override;

 private:
  ~MockScanoutBuffer() override;

  gfx::Size size_;
  uint32_t format_;

  DISALLOW_COPY_AND_ASSIGN(MockScanoutBuffer);
};

}  // namespace ui

#endif  // UI_OZONE_PLATFORM_DRM_GPU_MOCK_SCANOUT_BUFFER_H_