summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 01:18:26 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 01:18:26 +0000
commit6e15b7ef2551732d3583955287caee19b540dc9e (patch)
tree09d6d429b00b8908ce999fd31121fb80f07849e1 /app
parent627e3e9edda05b4b30732ee8b8b48e2e0284df92 (diff)
downloadchromium_src-6e15b7ef2551732d3583955287caee19b540dc9e.zip
chromium_src-6e15b7ef2551732d3583955287caee19b540dc9e.tar.gz
chromium_src-6e15b7ef2551732d3583955287caee19b540dc9e.tar.bz2
Fixed mismatched channel order in OSMesaViewGLContext.
Made failing SwapBuffers not an error. We have a race condition whereby a window can be closed while the GPU process is rendering. This could make ui and browser tests flaky. TEST=try, make sure color channels are not reversed BUG=none Review URL: http://codereview.chromium.org/4281003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/gfx/gl/gl_context_win.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/gfx/gl/gl_context_win.cc b/app/gfx/gl/gl_context_win.cc
index f264b93..80af050 100644
--- a/app/gfx/gl/gl_context_win.cc
+++ b/app/gfx/gl/gl_context_win.cc
@@ -490,10 +490,10 @@ bool OSMesaViewGLContext::SwapBuffers() {
info.bV4Planes = 1;
info.bV4BitCount = 32;
info.bV4V4Compression = BI_BITFIELDS;
- info.bV4RedMask = 0xFF000000;
- info.bV4GreenMask = 0x00FF0000;
- info.bV4BlueMask = 0x0000FF00;
- info.bV4AlphaMask = 0x000000FF;
+ info.bV4RedMask = 0x000000FF;
+ info.bV4GreenMask = 0x0000FF00;
+ info.bV4BlueMask = 0x00FF0000;
+ info.bV4AlphaMask = 0xFF000000;
// Copy the back buffer to the window's device context.
return StretchDIBits(device_context_,
@@ -522,7 +522,9 @@ void OSMesaViewGLContext::SetSwapInterval(int interval) {
void OSMesaViewGLContext::UpdateSize() {
// Change back buffer size to that of window.
RECT rect;
- GetClientRect(window_, &rect);
+ if (!GetClientRect(window_, &rect))
+ return;
+
gfx::Size window_size = gfx::Size(
std::max(1, static_cast<int>(rect.right - rect.left)),
std::max(1, static_cast<int>(rect.bottom - rect.top)));