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

Unified Diff: chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc

Issue 1110011: Fixed missing code in EnqueueTextureForDeletion.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months 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 | « chrome/browser/renderer_host/accelerated_surface_container_mac.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc
===================================================================
--- chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc (revision 42374)
+++ chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc (working copy)
@@ -15,7 +15,7 @@
gfx::PluginWindowHandle
AcceleratedSurfaceContainerManagerMac::AllocateFakePluginWindowHandle() {
AcceleratedSurfaceContainerMac* container =
- new AcceleratedSurfaceContainerMac();
+ new AcceleratedSurfaceContainerMac(this);
gfx::PluginWindowHandle res =
static_cast<gfx::PluginWindowHandle>(++current_id_);
plugin_window_to_container_map_.insert(std::make_pair(res, container));
@@ -37,8 +37,7 @@
uint64 io_surface_identifier) {
AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
if (container)
- container->SetSizeAndIOSurface(width, height,
- io_surface_identifier, this);
+ container->SetSizeAndIOSurface(width, height, io_surface_identifier);
}
void AcceleratedSurfaceContainerManagerMac::SetSizeAndTransportDIB(
@@ -48,8 +47,7 @@
TransportDIB::Handle transport_dib) {
AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
if (container)
- container->SetSizeAndTransportDIB(width, height,
- transport_dib, this);
+ container->SetSizeAndTransportDIB(width, height, transport_dib);
}
void AcceleratedSurfaceContainerManagerMac::MovePluginContainer(
@@ -60,6 +58,24 @@
}
void AcceleratedSurfaceContainerManagerMac::Draw(CGLContextObj context) {
+ // Clean up old texture objects. This is essentially a pre-emptive
+ // cleanup, as the resources will be released when the OpenGL
+ // context associated with the CAOpenGLLayer is destroyed. However,
+ // if we render many plugins in the same layer, we should try to
+ // eagerly reclaim their resources. Note also that the OpenGL
+ // context must be current when performing the deletion, and it
+ // seems risky to make the OpenGL context current at an arbitrary
+ // point in time, which is why the deletion does not occur in the
+ // container's destructor.
+ for (std::vector<GLuint>::iterator iter =
+ textures_pending_deletion_.begin();
+ iter != textures_pending_deletion_.end();
+ ++iter) {
+ GLuint texture = *iter;
+ glDeleteTextures(1, &texture);
+ }
+ textures_pending_deletion_.clear();
+
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
« no previous file with comments | « chrome/browser/renderer_host/accelerated_surface_container_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698