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 45271f10501436cedbe223ccd84d6904ee0b6ccb..c3b2f9ef047db86d30b64387a03ebf0fbf38aa6b 100644 |
| --- a/content/common/gpu/media/rendering_helper.cc |
| +++ b/content/common/gpu/media/rendering_helper.cc |
| @@ -366,7 +366,8 @@ void RenderingHelper::Initialize(const RenderingHelperParams& params, |
| CHECK(fb_status == GL_FRAMEBUFFER_COMPLETE) << fb_status; |
| glClearColor(0.0f, 0.0f, 0.0f, 1.0f); |
| glClear(GL_COLOR_BUFFER_BIT); |
| - glBindFramebufferEXT(GL_FRAMEBUFFER, 0); |
| + glBindFramebufferEXT(GL_FRAMEBUFFER, |
| + gl_surface_->GetBackingFrameBufferObject()); |
| } |
| // These vertices and texture coords. map (0,0) in the texture to the |
| @@ -572,7 +573,8 @@ void RenderingHelper::RenderThumbnail(uint32 texture_target, |
| glBindFramebufferEXT(GL_FRAMEBUFFER, thumbnails_fbo_id_); |
| GLSetViewPort(area); |
| RenderTexture(texture_target, texture_id); |
| - glBindFramebufferEXT(GL_FRAMEBUFFER, 0); |
| + glBindFramebufferEXT(GL_FRAMEBUFFER, |
| + gl_surface_->GetBackingFrameBufferObject()); |
| // Need to flush the GL commands before we return the tnumbnail texture to |
| // the decoder. |
| @@ -663,7 +665,8 @@ void RenderingHelper::GetThumbnailsAsRGB(std::vector<unsigned char>* rgb, |
| GL_RGBA, |
| GL_UNSIGNED_BYTE, |
| &rgba[0]); |
| - glBindFramebufferEXT(GL_FRAMEBUFFER, 0); |
| + glBindFramebufferEXT(GL_FRAMEBUFFER, |
| + gl_surface_->GetBackingFrameBufferObject()); |
| rgb->resize(num_pixels * 3); |
| // Drop the alpha channel, but check as we go that it is all 0xff. |
| bool solid = true; |
| @@ -700,7 +703,13 @@ void RenderingHelper::RenderContent() { |
| static_cast<base::WaitableEvent*>(NULL))); |
| } |
| - glUniform1i(glGetUniformLocation(program_, "tex_flip"), 1); |
| + int tex_flip = 1; |
| +#if USE_OZONE |
| + // Ozone surfaceless renders flipped from normal GL, so there's no need to |
| + // do an extra flip. |
| + tex_flip = 0; |
|
spang
2015/02/19 00:49:26
What if it's not surfaceless?
achaulk
2015/02/19 00:54:50
Hmm, I could add a property to GLSurface to indica
|
| +#endif |
| + glUniform1i(glGetUniformLocation(program_, "tex_flip"), tex_flip); |
| // Frames that will be returned to the client (via the no_longer_needed_cb) |
| // after this vector falls out of scope at the end of this method. We need |