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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 glDeleteTextures(1, &texture); | 76 glDeleteTextures(1, &texture); |
77 } | 77 } |
78 textures_pending_deletion_.clear(); | 78 textures_pending_deletion_.clear(); |
79 | 79 |
80 glColorMask(true, true, true, true); | 80 glColorMask(true, true, true, true); |
81 glClearColor(0, 0, 0, 0); | 81 glClearColor(0, 0, 0, 0); |
82 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | 82 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
83 glDisable(GL_DEPTH_TEST); | 83 glDisable(GL_DEPTH_TEST); |
84 glDisable(GL_BLEND); | 84 glDisable(GL_BLEND); |
85 | 85 |
86 GLenum target = GL_TEXTURE_RECTANGLE_ARB; | 86 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); |
87 glTexEnvi(target, GL_TEXTURE_ENV_MODE, GL_REPLACE); | |
88 | 87 |
89 for (PluginWindowToContainerMap::const_iterator i = | 88 for (PluginWindowToContainerMap::const_iterator i = |
90 plugin_window_to_container_map_.begin(); | 89 plugin_window_to_container_map_.begin(); |
91 i != plugin_window_to_container_map_.end(); ++i) { | 90 i != plugin_window_to_container_map_.end(); ++i) { |
92 AcceleratedSurfaceContainerMac* container = i->second; | 91 AcceleratedSurfaceContainerMac* container = i->second; |
93 container->Draw(context); | 92 container->Draw(context); |
94 } | 93 } |
95 | 94 |
96 // Unbind any texture from the texture target to ensure that the | 95 // Unbind any texture from the texture target to ensure that the |
97 // next time through we will have to re-bind the texture and thereby | 96 // next time through we will have to re-bind the texture and thereby |
98 // pick up modifications from the other process. | 97 // pick up modifications from the other process. |
| 98 GLenum target = GL_TEXTURE_RECTANGLE_ARB; |
99 glBindTexture(target, 0); | 99 glBindTexture(target, 0); |
100 | 100 |
101 glFlush(); | 101 glFlush(); |
102 } | 102 } |
103 | 103 |
104 void AcceleratedSurfaceContainerManagerMac::ForceTextureReload() { | 104 void AcceleratedSurfaceContainerManagerMac::ForceTextureReload() { |
105 for (PluginWindowToContainerMap::const_iterator i = | 105 for (PluginWindowToContainerMap::const_iterator i = |
106 plugin_window_to_container_map_.begin(); | 106 plugin_window_to_container_map_.begin(); |
107 i != plugin_window_to_container_map_.end(); ++i) { | 107 i != plugin_window_to_container_map_.end(); ++i) { |
108 AcceleratedSurfaceContainerMac* container = i->second; | 108 AcceleratedSurfaceContainerMac* container = i->second; |
(...skipping 13 matching lines...) Expand all Loading... |
122 gfx::PluginWindowHandle id) { | 122 gfx::PluginWindowHandle id) { |
123 PluginWindowToContainerMap::const_iterator i = | 123 PluginWindowToContainerMap::const_iterator i = |
124 plugin_window_to_container_map_.find(id); | 124 plugin_window_to_container_map_.find(id); |
125 if (i != plugin_window_to_container_map_.end()) | 125 if (i != plugin_window_to_container_map_.end()) |
126 return i->second; | 126 return i->second; |
127 | 127 |
128 LOG(ERROR) << "Request for plugin container for unknown window id " << id; | 128 LOG(ERROR) << "Request for plugin container for unknown window id " << id; |
129 | 129 |
130 return NULL; | 130 return NULL; |
131 } | 131 } |
OLD | NEW |