Chromium Code Reviews| Index: content/common/gpu/media/rendering_helper.cc |
| diff --git a/content/common/gpu/media/rendering_helper.cc b/content/common/gpu/media/rendering_helper.cc |
| index 5f8ae749e1eef31f9e7972f3bbd8c075cb711452..9302b4afedcde3311dc44294e65113093b7b241e 100644 |
| --- a/content/common/gpu/media/rendering_helper.cc |
| +++ b/content/common/gpu/media/rendering_helper.cc |
| @@ -490,6 +490,18 @@ void RenderingHelper::GetThumbnailsAsRGB(std::vector<unsigned char>* rgb, |
| done->Signal(); |
| } |
| +void RenderingHelper::SetWaitRenderingCB( |
| + size_t window_id, |
| + const base::Closure& wait_rendering_cb) { |
| + RenderingClient* client = &clients_[window_id]; |
| + if (client->pending_frames.empty() || client->last_frame_rendered) { |
| + // The rendering has been completed. |
| + wait_rendering_cb.Run(); |
| + return; |
| + } |
| + client->wait_rendering_cb = wait_rendering_cb; |
| +} |
| + |
| void RenderingHelper::RenderContent() { |
| CHECK_EQ(base::MessageLoop::current(), message_loop_); |
| glUniform1i(glGetUniformLocation(program_, "tex_flip"), 1); |
| @@ -524,6 +536,8 @@ void RenderingHelper::RenderContent() { |
| continue; |
| } |
| client->last_frame_rendered = true; |
| + if (!client->wait_rendering_cb.is_null()) |
| + base::ResetAndReturn(&client->wait_rendering_cb).Run(); |
|
Pawel Osciak
2014/08/14 05:11:07
I think we have to pop the last frame here?
Owen Lin
2014/08/14 10:55:35
Done.
|
| } |
| } |