OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_PROXY_H_ | |
6 #define CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_PROXY_H_ | |
7 #pragma once | |
8 | |
9 #include "chrome/browser/renderer_host/video_layer.h" | |
10 #include "ipc/ipc_channel.h" | |
11 | |
12 class GpuProcessHostUIShim; | |
13 | |
14 // Proxies YUV video layer data to the GPU process for rendering. | |
15 class VideoLayerProxy : public VideoLayer, public IPC::Channel::Listener { | |
16 public: | |
17 VideoLayerProxy(RenderWidgetHost* widget, const gfx::Size& size, | |
18 GpuProcessHostUIShim* process_shim, int32 routing_id); | |
19 virtual ~VideoLayerProxy(); | |
20 | |
21 // VideoLayer implementation. | |
22 virtual void CopyTransportDIB(RenderProcessHost* process, | |
23 TransportDIB::Id bitmap, | |
24 const gfx::Rect& bitmap_rect); | |
25 | |
26 // IPC::Channel::Listener implementation. | |
27 virtual void OnMessageReceived(const IPC::Message& message); | |
28 virtual void OnChannelConnected(int32 peer_pid); | |
29 virtual void OnChannelError(); | |
30 | |
31 private: | |
32 // Called when GPU process has finished painting the video layer. | |
33 void OnPaintToVideoLayerACK(); | |
34 | |
35 // GPU process receiving our proxied requests. | |
36 GpuProcessHostUIShim* process_shim_; | |
37 | |
38 // IPC routing ID to use when communicating with the GPU process. | |
39 int32 routing_id_; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(VideoLayerProxy); | |
42 }; | |
43 | |
44 #endif // CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_PROXY_H_ | |
OLD | NEW |