Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: content/browser/renderer_host/compositing_iosurface_mac.mm

Issue 11418303: Don't issue any extra geometry for the IOSurface leak workaround (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/compositing_iosurface_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « content/browser/renderer_host/compositing_iosurface_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698