Index: content/browser/renderer_host/compositing_iosurface_mac.mm |
diff --git a/content/browser/renderer_host/compositing_iosurface_mac.mm b/content/browser/renderer_host/compositing_iosurface_mac.mm |
index 2013eb718a5d6e928fbc841fbe1947d92decc58c..9e4887a0982219da5f6d0b97c37c1ea9b6b4b576 100644 |
--- a/content/browser/renderer_host/compositing_iosurface_mac.mm |
+++ b/content/browser/renderer_host/compositing_iosurface_mac.mm |
@@ -386,11 +386,13 @@ void CompositingIOSurfaceMac::DrawIOSurface(NSView* view, float scale_factor) { |
} |
} |
- glUseProgram(0); CHECK_GL_ERROR(); |
+ // Workaround for issue 158469. Issue a dummy draw call with texture_ not |
+ // bound to blit_rgb_sampler_location_, in order to shake all references |
+ // to the IOSurface out of the driver. |
+ glBegin(GL_TRIANGLES); |
+ glEnd(); |
- // Issue a dummy draw call to flush references to the IOSurface out of |
- // the GL driver. |
- DoWorkaroundForIOSurfaceLeak(); |
+ glUseProgram(0); CHECK_GL_ERROR(); |
} else { |
// Should match the clear color of RenderWidgetHostViewMac. |
glClearColor(1.0f, 1.0f, 1.0f, 1.0f); |
@@ -530,34 +532,6 @@ void CompositingIOSurfaceMac::DrawQuad(const SurfaceQuad& quad) { |
glDisableClientState(GL_TEXTURE_COORD_ARRAY); |
} |
-void CompositingIOSurfaceMac::DoWorkaroundForIOSurfaceLeak() { |
- if (!shader_program_blit_rgb_) |
- return; |
- |
- glMatrixMode(GL_PROJECTION); |
- glLoadIdentity(); |
- glOrtho(0, 1, 0, 1, -1, 1); |
- glMatrixMode(GL_MODELVIEW); |
- glLoadIdentity(); |
- |
- // Workaround for issue 158469. Issue a dummy draw call with texture_ not |
- // bound to blit_rgb_sampler_location_, in order to shake all references |
- // to the IOSurface out of the driver. |
- glUseProgram(shader_program_blit_rgb_); |
- glUniform1i(blit_rgb_sampler_location_, 0); |
- glActiveTexture(GL_TEXTURE0 + 0); |
- glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0); |
- |
- // Let invisible_quad be a quad that is outside of the viewport. |
- SurfaceQuad invisible_quad; |
- invisible_quad.set_rect(-2.0f, -2.0f, -1.9f, -1.9f); |
- invisible_quad.set_texcoord_rect(0.0f, 0.0f, 1.0f, 1.0f); |
- DrawQuad(invisible_quad); |
- glUseProgram(0); |
- |
- CHECK_GL_ERROR(); |
-} |
- |
void CompositingIOSurfaceMac::UnrefIOSurfaceWithContextCurrent() { |
if (texture_) { |
glDeleteTextures(1, &texture_); |