summaryrefslogtreecommitdiffstats
path: root/app/gfx/gl/gl_context_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'app/gfx/gl/gl_context_win.cc')
-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)));