12a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org/*
22a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
32a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org *
42a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org *  Use of this source code is governed by a BSD-style license
52a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org *  that can be found in the LICENSE file in the root of the source
62a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org *  tree. An additional intellectual property rights grant can be found
72a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org *  in the file PATENTS.  All contributing project authors may
82a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org *  be found in the AUTHORS file in the root of the source tree.
92a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org */
102a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org
112a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org#ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_LINUX_GLX_RENDERER_H_
122a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org#define WEBRTC_VIDEO_ENGINE_TEST_COMMON_LINUX_GLX_RENDERER_H_
132a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org
142a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org#include <GL/glx.h>
15281cff8cd679728fe395f7f0203c05e763c0c789pbos@webrtc.org#include <X11/Xlib.h>
162a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org
1724e2089750e9e51228b82d6c7ebf4fa064c797bapbos@webrtc.org#include "webrtc/test/gl/gl_renderer.h"
184988d94bf043d7dff95e7dcb6716e6f4b16f5460pbos@webrtc.org#include "webrtc/typedefs.h"
192a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org
202a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.orgnamespace webrtc {
212a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.orgnamespace test {
222a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org
232a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.orgclass GlxRenderer : public GlRenderer {
242a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org public:
252a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  static GlxRenderer* Create(const char* window_title, size_t width,
262a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org                             size_t height);
272a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  virtual ~GlxRenderer();
282a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org
292a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  virtual void RenderFrame(const webrtc::I420VideoFrame& frame, int delta)
302a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org      OVERRIDE;
312a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org private:
322a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  GlxRenderer(size_t width, size_t height);
332a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org
342a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  bool Init(const char* window_title);
352a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  void Resize(size_t width, size_t height);
362a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  void Destroy();
372a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org
382a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  size_t width_, height_;
392a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org
402a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  Display* display_;
412a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  Window window_;
422a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org  GLXContext context_;
432a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org};
442a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org}  // test
452a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org}  // webrtc
462a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org
472a9108f911ae7a758f16061ba06bb73b270dd170pbos@webrtc.org#endif  // WEBRTC_VIDEO_ENGINE_TEST_COMMON_LINUX_GLX_RENDERER_H_
48