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_H_ | |
6 #define CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_H_ | |
7 #pragma once | |
8 | |
9 #include "app/surface/transport_dib.h" | |
10 #include "gfx/size.h" | |
11 | |
12 class RenderProcessHost; | |
13 class RenderWidgetHost; | |
14 | |
15 namespace gfx { | |
16 class Rect; | |
17 } | |
18 | |
19 // Represents a layer of YUV data owned by RenderWidgetHost and composited with | |
20 // the backing store. VideoLayer is responsible for converting to RGB as | |
21 // needed. | |
22 class VideoLayer { | |
23 public: | |
24 virtual ~VideoLayer(); | |
25 | |
26 RenderWidgetHost* render_widget_host() const { return render_widget_host_; } | |
27 const gfx::Size& size() { return size_; } | |
28 | |
29 // Copy the incoming bitmap into this video layer. |bitmap| contains YUV | |
30 // pixel data in YV12 format and must be the same dimensions as this video | |
31 // layer. |bitmap_rect| specifies the absolute position and destination size | |
32 // of the bitmap on the backing store. | |
33 virtual void CopyTransportDIB(RenderProcessHost* process, | |
34 TransportDIB::Id bitmap, | |
35 const gfx::Rect& bitmap_rect) = 0; | |
36 | |
37 protected: | |
38 // Can only be constructed via subclasses. | |
39 VideoLayer(RenderWidgetHost* widget, const gfx::Size& size); | |
40 | |
41 private: | |
42 // The owner of this video layer. | |
43 RenderWidgetHost* render_widget_host_; | |
44 | |
45 // The size of the video layer. | |
46 gfx::Size size_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(VideoLayer); | |
49 }; | |
50 | |
51 #endif // CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_H_ | |
OLD | NEW |