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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 for (PluginWindowToContainerMap::const_iterator i = | 118 for (PluginWindowToContainerMap::const_iterator i = |
119 plugin_window_to_container_map_.begin(); | 119 plugin_window_to_container_map_.begin(); |
120 i != plugin_window_to_container_map_.end(); ++i) { | 120 i != plugin_window_to_container_map_.end(); ++i) { |
121 AcceleratedSurfaceContainerMac* container = i->second; | 121 AcceleratedSurfaceContainerMac* container = i->second; |
122 container->ForceTextureReload(); | 122 container->ForceTextureReload(); |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo( | 126 void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo( |
127 gfx::PluginWindowHandle id) { | 127 gfx::PluginWindowHandle id, uint64 surface_id) { |
128 AutoLock lock(lock_); | 128 AutoLock lock(lock_); |
129 | 129 |
130 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); | 130 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); |
131 if (container) | 131 if (container) |
132 container->set_was_painted_to(); | 132 container->set_was_painted_to(surface_id); |
133 } | 133 } |
134 | 134 |
135 bool AcceleratedSurfaceContainerManagerMac::SurfaceShouldBeVisible( | 135 bool AcceleratedSurfaceContainerManagerMac::SurfaceShouldBeVisible( |
136 gfx::PluginWindowHandle id) const { | 136 gfx::PluginWindowHandle id) const { |
137 AutoLock lock(lock_); | 137 AutoLock lock(lock_); |
138 | 138 |
139 if (IsRootContainer(id) && !gpu_rendering_active_) | 139 if (IsRootContainer(id) && !gpu_rendering_active_) |
140 return false; | 140 return false; |
141 | 141 |
142 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); | 142 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); |
143 return container && container->should_be_visible(); | 143 return container && container->should_be_visible(); |
144 } | 144 } |
145 | 145 |
146 AcceleratedSurfaceContainerMac* | 146 AcceleratedSurfaceContainerMac* |
147 AcceleratedSurfaceContainerManagerMac::MapIDToContainer( | 147 AcceleratedSurfaceContainerManagerMac::MapIDToContainer( |
148 gfx::PluginWindowHandle id) const { | 148 gfx::PluginWindowHandle id) const { |
149 PluginWindowToContainerMap::const_iterator i = | 149 PluginWindowToContainerMap::const_iterator i = |
150 plugin_window_to_container_map_.find(id); | 150 plugin_window_to_container_map_.find(id); |
151 if (i != plugin_window_to_container_map_.end()) | 151 if (i != plugin_window_to_container_map_.end()) |
152 return i->second; | 152 return i->second; |
153 | 153 |
154 LOG(ERROR) << "Request for plugin container for unknown window id " << id; | 154 LOG(ERROR) << "Request for plugin container for unknown window id " << id; |
155 | 155 |
156 return NULL; | 156 return NULL; |
157 } | 157 } |
OLD | NEW |