Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc

Issue 4101002: Mac/gpu: Don't show uninitialized surfaces while resizing plugins / composited tabs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: white padding Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/renderer_host/accelerated_surface_container_mac.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 AcceleratedSurfaceContainerMac* container = MapIDToContainer(move.window); 92 AcceleratedSurfaceContainerMac* container = MapIDToContainer(move.window);
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 glClearColor(0, 0, 0, 0); 102 // Should match the clear color of RenderWidgetHostViewMac.
103 glClearColor(255, 255, 255, 255);
stuartmorgan 2010/11/05 17:35:26 This needs to be conditional on the surface being
104 // TODO(thakis): Clearing the whole color buffer is wasteful, since most of
105 // it is overwritten by the surface.
103 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 106 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
104 glDisable(GL_DEPTH_TEST); 107 glDisable(GL_DEPTH_TEST);
105 glDisable(GL_BLEND); 108 glDisable(GL_BLEND);
106 109
107 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); 110 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
108 111
109 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id); 112 AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
110 CHECK(container); 113 CHECK(container);
111 container->Draw(context); 114 container->Draw(context);
112 115
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 gfx::PluginWindowHandle id) const { 164 gfx::PluginWindowHandle id) const {
162 PluginWindowToContainerMap::const_iterator i = 165 PluginWindowToContainerMap::const_iterator i =
163 plugin_window_to_container_map_.find(id); 166 plugin_window_to_container_map_.find(id);
164 if (i != plugin_window_to_container_map_.end()) 167 if (i != plugin_window_to_container_map_.end())
165 return i->second; 168 return i->second;
166 169
167 LOG(ERROR) << "Request for plugin container for unknown window id " << id; 170 LOG(ERROR) << "Request for plugin container for unknown window id " << id;
168 171
169 return NULL; 172 return NULL;
170 } 173 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/accelerated_surface_container_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698