summaryrefslogtreecommitdiff
path: root/content/common/gpu/media/rendering_helper.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2014-07-20 18:25:52 -0700
committerBen Murdoch <benm@google.com>2014-07-20 18:25:52 -0700
commit116680a4aac90f2aa7413d9095a592090648e557 (patch)
treef7c6fed0e63d6a2804243d4a31a752dca39fb076 /content/common/gpu/media/rendering_helper.cc
parent1f14a4515e04c9ffc9bac4dd1e2f68611626b800 (diff)
downloadchromium_org-116680a4aac90f2aa7413d9095a592090648e557.tar.gz
Merge from Chromium at DEPS revision 284076
This commit was generated by merge_to_master.py. Change-Id: I9a279485b02fe7ceddcd32d992a714ff132e99ae
Diffstat (limited to 'content/common/gpu/media/rendering_helper.cc')
-rw-r--r--content/common/gpu/media/rendering_helper.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/content/common/gpu/media/rendering_helper.cc b/content/common/gpu/media/rendering_helper.cc
index 4b7bb192b2..2bd6e02c61 100644
--- a/content/common/gpu/media/rendering_helper.cc
+++ b/content/common/gpu/media/rendering_helper.cc
@@ -275,6 +275,7 @@ void RenderingHelper::Initialize(const RenderingHelperParams& params,
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER, thumbnails_fbo_id_);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER,
@@ -368,7 +369,8 @@ void RenderingHelper::Initialize(const RenderingHelperParams& params,
glVertexAttribPointer(tc_location, 2, GL_FLOAT, GL_FALSE, 0, kTextureCoords);
if (frame_duration_ != base::TimeDelta()) {
- render_timer_.Start(
+ render_timer_.reset(new base::RepeatingTimer<RenderingHelper>());
+ render_timer_->Start(
FROM_HERE, frame_duration_, this, &RenderingHelper::RenderContent);
}
done->Signal();
@@ -376,7 +378,10 @@ void RenderingHelper::Initialize(const RenderingHelperParams& params,
void RenderingHelper::UnInitialize(base::WaitableEvent* done) {
CHECK_EQ(base::MessageLoop::current(), message_loop_);
- render_timer_.Stop();
+
+ // Deletion will also stop the timer.
+ render_timer_.reset();
+
if (render_as_thumbnails_) {
glDeleteTextures(1, &thumbnails_texture_id_);
glDeleteFramebuffersEXT(1, &thumbnails_fbo_id_);
@@ -555,6 +560,7 @@ void RenderingHelper::GetThumbnailsAsRGB(std::vector<unsigned char>* rgb,
}
void RenderingHelper::RenderContent() {
+ CHECK_EQ(base::MessageLoop::current(), message_loop_);
glUniform1i(glGetUniformLocation(program_, "tex_flip"), 1);
if (render_as_thumbnails_) {