1 /* 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 11 #ifndef TEST_LINUX_GLX_RENDERER_H_ 12 #define TEST_LINUX_GLX_RENDERER_H_ 13 14 #include <GL/glx.h> 15 #include <X11/X.h> 16 #include <X11/Xlib.h> 17 #include <stddef.h> 18 19 #include "api/video/video_frame.h" 20 #include "test/gl/gl_renderer.h" 21 22 namespace webrtc { 23 namespace test { 24 25 class GlxRenderer : public GlRenderer { 26 public: 27 static GlxRenderer* Create(const char* window_title, 28 size_t width, 29 size_t height); 30 virtual ~GlxRenderer(); 31 32 void OnFrame(const webrtc::VideoFrame& frame) override; 33 34 private: 35 GlxRenderer(size_t width, size_t height); 36 37 bool Init(const char* window_title); 38 void Resize(size_t width, size_t height); 39 void Destroy(); 40 41 size_t width_, height_; 42 43 Display* display_; 44 Window window_; 45 GLXContext context_; 46 }; 47 } // namespace test 48 } // namespace webrtc 49 50 #endif // TEST_LINUX_GLX_RENDERER_H_ 51