blob: ec8b3ddd6c057df5a7774a4b21bcd87b22f3844c [file] [log] [blame]
pbos@webrtc.org29d58392013-05-16 12:08:03 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef TEST_LINUX_GLX_RENDERER_H_
12#define TEST_LINUX_GLX_RENDERER_H_
pbos@webrtc.org29d58392013-05-16 12:08:03 +000013
pbos@webrtc.org29d58392013-05-16 12:08:03 +000014#include <GL/glx.h>
pbos@webrtc.orgf5d4cb12013-05-17 13:44:48 +000015#include <X11/Xlib.h>
pbos@webrtc.org29d58392013-05-16 12:08:03 +000016
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "test/gl/gl_renderer.h"
Mirko Bonadei71207422017-09-15 13:58:09 +020018#include "typedefs.h" // NOLINT(build/include)
pbos@webrtc.org29d58392013-05-16 12:08:03 +000019
20namespace webrtc {
21namespace test {
22
23class GlxRenderer : public GlRenderer {
24 public:
Yves Gerey665174f2018-06-19 15:03:05 +020025 static GlxRenderer* Create(const char* window_title,
26 size_t width,
pbos@webrtc.org29d58392013-05-16 12:08:03 +000027 size_t height);
28 virtual ~GlxRenderer();
29
nisseeb83a1a2016-03-21 01:27:56 -070030 void OnFrame(const webrtc::VideoFrame& frame) override;
pbos@webrtc.org0d852d52015-02-09 15:14:36 +000031
pbos@webrtc.org29d58392013-05-16 12:08:03 +000032 private:
33 GlxRenderer(size_t width, size_t height);
34
35 bool Init(const char* window_title);
36 void Resize(size_t width, size_t height);
37 void Destroy();
38
pbos@webrtc.org29d58392013-05-16 12:08:03 +000039 size_t width_, height_;
40
41 Display* display_;
42 Window window_;
43 GLXContext context_;
44};
Yves Gerey665174f2018-06-19 15:03:05 +020045} // namespace test
46} // namespace webrtc
pbos@webrtc.org29d58392013-05-16 12:08:03 +000047
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020048#endif // TEST_LINUX_GLX_RENDERER_H_