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 "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 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo( | 139 void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo( |
140 gfx::PluginWindowHandle id, uint64 surface_id) { | 140 gfx::PluginWindowHandle id, uint64 surface_id) { |
141 base::AutoLock lock(lock_); | 141 base::AutoLock lock(lock_); |
142 | 142 |
143 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); | 143 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); |
144 if (container) | 144 if (container) |
145 container->set_was_painted_to(surface_id); | 145 container->set_was_painted_to(surface_id); |
146 } | 146 } |
147 | 147 |
| 148 void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo( |
| 149 gfx::PluginWindowHandle id, uint64 surface_id, |
| 150 int x, int y, int width, int height) { |
| 151 base::AutoLock lock(lock_); |
| 152 |
| 153 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); |
| 154 if (container) |
| 155 container->set_was_painted_to(surface_id, x, y, width, height); |
| 156 } |
| 157 |
148 void AcceleratedSurfaceContainerManagerMac::SetRootSurfaceInvalid() { | 158 void AcceleratedSurfaceContainerManagerMac::SetRootSurfaceInvalid() { |
149 base::AutoLock lock(lock_); | 159 base::AutoLock lock(lock_); |
150 if (root_container_) | 160 if (root_container_) |
151 root_container_->set_surface_invalid(); | 161 root_container_->set_surface_invalid(); |
152 } | 162 } |
153 | 163 |
154 bool AcceleratedSurfaceContainerManagerMac::SurfaceShouldBeVisible( | 164 bool AcceleratedSurfaceContainerManagerMac::SurfaceShouldBeVisible( |
155 gfx::PluginWindowHandle id) const { | 165 gfx::PluginWindowHandle id) const { |
156 base::AutoLock lock(lock_); | 166 base::AutoLock lock(lock_); |
157 | 167 |
158 if (IsRootContainer(id) && !gpu_rendering_active_) | 168 if (IsRootContainer(id) && !gpu_rendering_active_) |
159 return false; | 169 return false; |
160 | 170 |
161 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); | 171 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); |
162 return container && container->ShouldBeVisible(); | 172 return container && container->ShouldBeVisible(); |
163 } | 173 } |
164 | 174 |
165 AcceleratedSurfaceContainerMac* | 175 AcceleratedSurfaceContainerMac* |
166 AcceleratedSurfaceContainerManagerMac::MapIDToContainer( | 176 AcceleratedSurfaceContainerManagerMac::MapIDToContainer( |
167 gfx::PluginWindowHandle id) const { | 177 gfx::PluginWindowHandle id) const { |
168 PluginWindowToContainerMap::const_iterator i = | 178 PluginWindowToContainerMap::const_iterator i = |
169 plugin_window_to_container_map_.find(id); | 179 plugin_window_to_container_map_.find(id); |
170 if (i != plugin_window_to_container_map_.end()) | 180 if (i != plugin_window_to_container_map_.end()) |
171 return i->second; | 181 return i->second; |
172 | 182 |
173 LOG(ERROR) << "Request for plugin container for unknown window id " << id; | 183 LOG(ERROR) << "Request for plugin container for unknown window id " << id; |
174 | 184 |
175 return NULL; | 185 return NULL; |
176 } | 186 } |
OLD | NEW |