diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-03 21:39:11 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-03 21:39:11 +0000 |
commit | cfbe8e44e66cdac1d9fd259b66bb0e70dcca84d9 (patch) | |
tree | 7faf929bd42948a604916ffb1b62b2b10387a027 /chrome/gpu/gpu_video_layer_glx.h | |
parent | 9d55c84026a0c4ad34ac7446e6219b8e00d9fc8a (diff) | |
download | chromium_src-cfbe8e44e66cdac1d9fd259b66bb0e70dcca84d9.zip chromium_src-cfbe8e44e66cdac1d9fd259b66bb0e70dcca84d9.tar.gz chromium_src-cfbe8e44e66cdac1d9fd259b66bb0e70dcca84d9.tar.bz2 |
Basic GPU accelerated video rendering.
Fragment shader is used for YUV to RGB conversion. No actual layering yet, so the video is still rendered on top of everything else.
BUG=33329
TEST=Watch some <video> with --enable-video-layering --enable-gpu-rendering
Review URL: http://codereview.chromium.org/661430
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu/gpu_video_layer_glx.h')
-rw-r--r-- | chrome/gpu/gpu_video_layer_glx.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/chrome/gpu/gpu_video_layer_glx.h b/chrome/gpu/gpu_video_layer_glx.h index 772ff6f..bcfb42f4 100644 --- a/chrome/gpu/gpu_video_layer_glx.h +++ b/chrome/gpu/gpu_video_layer_glx.h @@ -22,7 +22,12 @@ class GpuVideoLayerGLX : public IPC::Channel::Listener { const gfx::Size& size); virtual ~GpuVideoLayerGLX(); - const gfx::Size& size() const { return size_; } + // Renders the video layer using the current GL context with respect to the + // given |viewport_size|. + // + // TODO(scherkus): we also need scrolling information to determine where + // exactly to place our quad. + void Render(const gfx::Size& viewport_size); // IPC::Channel::Listener implementation. virtual void OnMessageReceived(const IPC::Message& message); @@ -35,10 +40,34 @@ class GpuVideoLayerGLX : public IPC::Channel::Listener { TransportDIB::Id id, const gfx::Rect& bitmap_rect); + // Calculates vertices for |object| relative to |world|, where |world| is + // assumed to represent a full-screen quad. |vertices| should be an array of + // 8 floats. + // + // TODO(scherkus): not sure how to describe what this does. + static void CalculateVertices(const gfx::Size& world, + const gfx::Rect& object, + float* vertices); + + // GPU process related. GpuViewX* view_; GpuThread* gpu_thread_; int32 routing_id_; - gfx::Size size_; + + // The native size of the incoming YUV frames. + gfx::Size native_size_; + + // The target absolute position and size of the RGB frames. + gfx::Rect target_rect_; + + // The target absolute position and size expressed as quad vertices. + float target_vertices_[8]; + + // 3 textures, one for each plane. + unsigned int textures_[3]; + + // Shader program for YUV->RGB conversion. + unsigned int program_; DISALLOW_COPY_AND_ASSIGN(GpuVideoLayerGLX); }; |