| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 if (container) | 93 if (container) |
| 94 container->SetGeometry(move); | 94 container->SetGeometry(move); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void AcceleratedSurfaceContainerManagerMac::Draw(CGLContextObj context, | 97 void AcceleratedSurfaceContainerManagerMac::Draw(CGLContextObj context, |
| 98 gfx::PluginWindowHandle id) { | 98 gfx::PluginWindowHandle id) { |
| 99 AutoLock lock(lock_); | 99 AutoLock lock(lock_); |
| 100 | 100 |
| 101 glColorMask(true, true, true, true); | 101 glColorMask(true, true, true, true); |
| 102 // Should match the clear color of RenderWidgetHostViewMac. | 102 // Should match the clear color of RenderWidgetHostViewMac. |
| 103 glClearColor(255, 255, 255, 255); | 103 glClearColor(1.0f, 1.0f, 1.0f, 1.0f); |
| 104 // TODO(thakis): Clearing the whole color buffer is wasteful, since most of | 104 // TODO(thakis): Clearing the whole color buffer is wasteful, since most of |
| 105 // it is overwritten by the surface. | 105 // it is overwritten by the surface. |
| 106 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | 106 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| 107 glDisable(GL_DEPTH_TEST); | 107 glDisable(GL_DEPTH_TEST); |
| 108 glDisable(GL_BLEND); | 108 glDisable(GL_BLEND); |
| 109 | 109 |
| 110 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); | 110 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); |
| 111 | 111 |
| 112 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); | 112 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); |
| 113 CHECK(container); | 113 CHECK(container); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 gfx::PluginWindowHandle id) const { | 164 gfx::PluginWindowHandle id) const { |
| 165 PluginWindowToContainerMap::const_iterator i = | 165 PluginWindowToContainerMap::const_iterator i = |
| 166 plugin_window_to_container_map_.find(id); | 166 plugin_window_to_container_map_.find(id); |
| 167 if (i != plugin_window_to_container_map_.end()) | 167 if (i != plugin_window_to_container_map_.end()) |
| 168 return i->second; | 168 return i->second; |
| 169 | 169 |
| 170 LOG(ERROR) << "Request for plugin container for unknown window id " << id; | 170 LOG(ERROR) << "Request for plugin container for unknown window id " << id; |
| 171 | 171 |
| 172 return NULL; | 172 return NULL; |
| 173 } | 173 } |
| OLD | NEW |