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

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

Issue 3010054: Mac: Well-behaved accelerated plugins, preparation (Closed)
Patch Set: '' Created 10 years, 4 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
Index: chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc
diff --git a/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc
index 96f09be6725e9a19cd8665542ef6440d38035038..9f1d9f3b642db4232522eb354fff373a4c77d5ee 100644
--- a/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc
+++ b/chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc
@@ -38,8 +38,10 @@ void AcceleratedSurfaceContainerManagerMac::DestroyFakePluginWindowHandle(
plugin_window_to_container_map_.erase(id);
}
-bool AcceleratedSurfaceContainerManagerMac::HasRootContainer() {
- return root_container_ != NULL;
+bool AcceleratedSurfaceContainerManagerMac::IsRootContainer(
+ gfx::PluginWindowHandle id) {
+ AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
+ return root_container_ == container;
}
void AcceleratedSurfaceContainerManagerMac::SetSizeAndIOSurface(
@@ -50,17 +52,6 @@ void AcceleratedSurfaceContainerManagerMac::SetSizeAndIOSurface(
AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
if (container) {
container->SetSizeAndIOSurface(width, height, io_surface_identifier);
- if (container == root_container_) {
- // Fake up a WebPluginGeometry for the root window to set the
- // container's size; we will never get a notification from the
- // browser about the root window, only plugins.
- webkit_glue::WebPluginGeometry geom;
- gfx::Rect rect(0, 0, width, height);
- geom.window_rect = rect;
- geom.clip_rect = rect;
- geom.visible = true;
- container->MoveTo(geom);
- }
}
}
@@ -82,6 +73,7 @@ void AcceleratedSurfaceContainerManagerMac::MovePluginContainer(
}
void AcceleratedSurfaceContainerManagerMac::Draw(CGLContextObj context,
+ gfx::PluginWindowHandle id,
bool draw_root_container) {
// Clean up old texture objects. This is essentially a pre-emptive
// cleanup, as the resources will be released when the OpenGL
@@ -109,19 +101,9 @@ void AcceleratedSurfaceContainerManagerMac::Draw(CGLContextObj context,
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- // Draw the root container, if any, first.
- if (draw_root_container && root_container_) {
- root_container_->Draw(context);
- }
-
- for (PluginWindowToContainerMap::const_iterator i =
- plugin_window_to_container_map_.begin();
- i != plugin_window_to_container_map_.end(); ++i) {
- AcceleratedSurfaceContainerMac* container = i->second;
- if (container != root_container_) {
- container->Draw(context);
- }
- }
+ AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
+ CHECK(container);
+ container->Draw(context);
// Unbind any texture from the texture target to ensure that the
// next time through we will have to re-bind the texture and thereby

Powered by Google App Engine
This is Rietveld 408576698