summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/video_layer.h
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-26 18:50:11 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-26 18:50:11 +0000
commit8400e0328996ef46e390903b6c378549f7b13aa3 (patch)
tree351883f0cdc05aca6f61c0ca0cf9bb945d0b807d /chrome/browser/renderer_host/video_layer.h
parent7386be50a212a569840f8da41be445cb00e90beb (diff)
downloadchromium_src-8400e0328996ef46e390903b6c378549f7b13aa3.zip
chromium_src-8400e0328996ef46e390903b6c378549f7b13aa3.tar.gz
chromium_src-8400e0328996ef46e390903b6c378549f7b13aa3.tar.bz2
Initial work for cross-process video rendering using layers.
Introduces VideoLayer, which is similar to BackingStore except handles YUV surfaces and conversion to RGB. BUG=33329 TEST=N/A Review URL: http://codereview.chromium.org/597066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40137 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/video_layer.h')
-rw-r--r--chrome/browser/renderer_host/video_layer.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/video_layer.h b/chrome/browser/renderer_host/video_layer.h
new file mode 100644
index 0000000..66a084f
--- /dev/null
+++ b/chrome/browser/renderer_host/video_layer.h
@@ -0,0 +1,51 @@
+// 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_BROWSER_RENDERER_HOST_VIDEO_LAYER_H_
+#define CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_H_
+
+#include "base/gfx/size.h"
+#include "base/scoped_ptr.h"
+#include "chrome/common/transport_dib.h"
+
+class RenderProcessHost;
+class RenderWidgetHost;
+
+namespace gfx {
+class Rect;
+}
+
+// Represents a layer of YUV data owned by RenderWidgetHost and composited with
+// the backing store. VideoLayer is responsible for converting to RGB as
+// needed.
+class VideoLayer {
+ public:
+ virtual ~VideoLayer();
+
+ RenderWidgetHost* render_widget_host() const { return render_widget_host_; }
+ const gfx::Size& size() { return size_; }
+
+ // Copy the incoming bitmap into this video layer. |bitmap| contains YUV
+ // pixel data in YV12 format and must be the same dimensions as this video
+ // layer. |bitmap_rect| specifies the absolute position and destination size
+ // of the bitmap on the backing store.
+ virtual void CopyTransportDIB(RenderProcessHost* process,
+ TransportDIB::Id bitmap,
+ const gfx::Rect& bitmap_rect) = 0;
+
+ protected:
+ // Can only be constructed via subclasses.
+ VideoLayer(RenderWidgetHost* widget, const gfx::Size& size);
+
+ private:
+ // The owner of this video layer.
+ RenderWidgetHost* render_widget_host_;
+
+ // The size of the video layer.
+ gfx::Size size_;
+
+ DISALLOW_COPY_AND_ASSIGN(VideoLayer);
+};
+
+#endif // CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_H_