OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/renderer_host/accelerated_surface_container_manager_mac .h" | 5 #include "chrome/browser/renderer_host/accelerated_surface_container_manager_mac .h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/renderer_host/accelerated_surface_container_mac.h" | 8 #include "chrome/browser/renderer_host/accelerated_surface_container_mac.h" |
9 #include "webkit/glue/plugins/webplugin.h" | 9 #include "webkit/glue/plugins/webplugin.h" |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 | 98 |
99 void AcceleratedSurfaceContainerManagerMac::ForceTextureReload() { | 99 void AcceleratedSurfaceContainerManagerMac::ForceTextureReload() { |
100 for (PluginWindowToContainerMap::const_iterator i = | 100 for (PluginWindowToContainerMap::const_iterator i = |
101 plugin_window_to_container_map_.begin(); | 101 plugin_window_to_container_map_.begin(); |
102 i != plugin_window_to_container_map_.end(); ++i) { | 102 i != plugin_window_to_container_map_.end(); ++i) { |
103 AcceleratedSurfaceContainerMac* container = i->second; | 103 AcceleratedSurfaceContainerMac* container = i->second; |
104 container->ForceTextureReload(); | 104 container->ForceTextureReload(); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo( | |
109 gfx::PluginWindowHandle id) { | |
110 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); | |
111 if (container) | |
112 container->set_was_painted_to(); | |
113 } | |
114 | |
115 bool AcceleratedSurfaceContainerManagerMac::SurfaceShouldBeVisible( | |
116 gfx::PluginWindowHandle id) const { | |
117 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); | |
118 if (!container) | |
stuartmorgan
2010/08/23 16:02:44
Might be clearer as just |return container && cont
Nico
2010/08/23 16:03:40
Done.
| |
119 return false; | |
120 return container->should_be_visible(); | |
121 } | |
122 | |
108 AcceleratedSurfaceContainerMac* | 123 AcceleratedSurfaceContainerMac* |
109 AcceleratedSurfaceContainerManagerMac::MapIDToContainer( | 124 AcceleratedSurfaceContainerManagerMac::MapIDToContainer( |
110 gfx::PluginWindowHandle id) { | 125 gfx::PluginWindowHandle id) const { |
111 PluginWindowToContainerMap::const_iterator i = | 126 PluginWindowToContainerMap::const_iterator i = |
112 plugin_window_to_container_map_.find(id); | 127 plugin_window_to_container_map_.find(id); |
113 if (i != plugin_window_to_container_map_.end()) | 128 if (i != plugin_window_to_container_map_.end()) |
114 return i->second; | 129 return i->second; |
115 | 130 |
116 LOG(ERROR) << "Request for plugin container for unknown window id " << id; | 131 LOG(ERROR) << "Request for plugin container for unknown window id " << id; |
117 | 132 |
118 return NULL; | 133 return NULL; |
119 } | 134 } |
OLD | NEW |