summaryrefslogtreecommitdiffstats
path: root/chrome/gpu/gpu_video_layer_glx.h
blob: 772ff6f2c553685e21f94a2cca45f6aa90d2cd1c (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
38
39
40
41
42
43
44
45
46
// Copyright (c) 2010 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 CHROME_GPU_GPU_VIDEO_LAYER_GLX_H_
#define CHROME_GPU_GPU_VIDEO_LAYER_GLX_H_

#include "base/basictypes.h"
#include "base/process.h"
#include "chrome/common/transport_dib.h"
#include "chrome/common/x11_util.h"
#include "ipc/ipc_channel.h"

class GpuViewX;
class GpuThread;

class GpuVideoLayerGLX : public IPC::Channel::Listener {
 public:
  GpuVideoLayerGLX(GpuViewX* view,
                   GpuThread* gpu_thread,
                   int32 routing_id,
                   const gfx::Size& size);
  virtual ~GpuVideoLayerGLX();

  const gfx::Size& size() const { return size_; }

  // IPC::Channel::Listener implementation.
  virtual void OnMessageReceived(const IPC::Message& message);
  virtual void OnChannelConnected(int32 peer_pid);
  virtual void OnChannelError();

 private:
  // Message handlers.
  void OnPaintToVideoLayer(base::ProcessId source_process_id,
                           TransportDIB::Id id,
                           const gfx::Rect& bitmap_rect);

  GpuViewX* view_;
  GpuThread* gpu_thread_;
  int32 routing_id_;
  gfx::Size size_;

  DISALLOW_COPY_AND_ASSIGN(GpuVideoLayerGLX);
};

#endif  // CHROME_GPU_GPU_VIDEO_LAYER_GLX_H_