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