| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/renderer_host/accelerated_surface_container_manager_ma
c.h" | 5 #include "content/browser/renderer_host/accelerated_surface_container_manager_ma
c.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/browser/renderer_host/accelerated_surface_container_mac.h" | 8 #include "content/browser/renderer_host/accelerated_surface_container_mac.h" |
| 9 #include "webkit/plugins/npapi/webplugin.h" | 9 #include "webkit/plugins/npapi/webplugin.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 for (PluginWindowToContainerMap::const_iterator i = | 132 for (PluginWindowToContainerMap::const_iterator i = |
| 133 plugin_window_to_container_map_.begin(); | 133 plugin_window_to_container_map_.begin(); |
| 134 i != plugin_window_to_container_map_.end(); ++i) { | 134 i != plugin_window_to_container_map_.end(); ++i) { |
| 135 AcceleratedSurfaceContainerMac* container = i->second; | 135 AcceleratedSurfaceContainerMac* container = i->second; |
| 136 container->ForceTextureReload(); | 136 container->ForceTextureReload(); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo( | 140 void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo( |
| 141 gfx::PluginWindowHandle id, uint64 surface_id) { | 141 gfx::PluginWindowHandle id, uint64 surface_handle) { |
| 142 base::AutoLock lock(lock_); | 142 base::AutoLock lock(lock_); |
| 143 | 143 |
| 144 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); | 144 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); |
| 145 if (container) | 145 if (container) |
| 146 container->set_was_painted_to(surface_id); | 146 container->set_was_painted_to(surface_handle); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo( | 149 void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo( |
| 150 gfx::PluginWindowHandle id, | 150 gfx::PluginWindowHandle id, |
| 151 uint64 surface_id, | 151 uint64 surface_handle, |
| 152 const gfx::Rect& update_rect) { | 152 const gfx::Rect& update_rect) { |
| 153 base::AutoLock lock(lock_); | 153 base::AutoLock lock(lock_); |
| 154 | 154 |
| 155 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); | 155 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); |
| 156 if (container) | 156 if (container) |
| 157 container->set_was_painted_to(surface_id, update_rect); | 157 container->set_was_painted_to(surface_handle, update_rect); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void AcceleratedSurfaceContainerManagerMac::SetRootSurfaceInvalid() { | 160 void AcceleratedSurfaceContainerManagerMac::SetRootSurfaceInvalid() { |
| 161 base::AutoLock lock(lock_); | 161 base::AutoLock lock(lock_); |
| 162 if (root_container_) | 162 if (root_container_) |
| 163 root_container_->set_surface_invalid(); | 163 root_container_->set_surface_invalid(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 bool AcceleratedSurfaceContainerManagerMac::SurfaceShouldBeVisible( | 166 bool AcceleratedSurfaceContainerManagerMac::SurfaceShouldBeVisible( |
| 167 gfx::PluginWindowHandle id) const { | 167 gfx::PluginWindowHandle id) const { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 179 gfx::PluginWindowHandle id) const { | 179 gfx::PluginWindowHandle id) const { |
| 180 PluginWindowToContainerMap::const_iterator i = | 180 PluginWindowToContainerMap::const_iterator i = |
| 181 plugin_window_to_container_map_.find(id); | 181 plugin_window_to_container_map_.find(id); |
| 182 if (i != plugin_window_to_container_map_.end()) | 182 if (i != plugin_window_to_container_map_.end()) |
| 183 return i->second; | 183 return i->second; |
| 184 | 184 |
| 185 LOG(ERROR) << "Request for plugin container for unknown window id " << id; | 185 LOG(ERROR) << "Request for plugin container for unknown window id " << id; |
| 186 | 186 |
| 187 return NULL; | 187 return NULL; |
| 188 } | 188 } |
| OLD | NEW |