OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 extern "C" { | 5 extern "C" { |
6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
7 } | 7 } |
8 | 8 |
9 #include "ui/gl/gl_surface_glx.h" | 9 #include "ui/gl/gl_surface_glx.h" |
10 | 10 |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 } | 575 } |
576 | 576 |
577 NativeViewGLSurfaceGLX::~NativeViewGLSurfaceGLX() { | 577 NativeViewGLSurfaceGLX::~NativeViewGLSurfaceGLX() { |
578 Destroy(); | 578 Destroy(); |
579 } | 579 } |
580 | 580 |
581 PbufferGLSurfaceGLX::PbufferGLSurfaceGLX(const gfx::Size& size) | 581 PbufferGLSurfaceGLX::PbufferGLSurfaceGLX(const gfx::Size& size) |
582 : size_(size), | 582 : size_(size), |
583 config_(NULL), | 583 config_(NULL), |
584 pbuffer_(0) { | 584 pbuffer_(0) { |
| 585 // Some implementations of Pbuffer do not support having a 0 size. For such |
| 586 // cases use a (1, 1) surface. |
| 587 if (size_.GetArea() == 0) |
| 588 size_.SetSize(1, 1); |
585 } | 589 } |
586 | 590 |
587 bool PbufferGLSurfaceGLX::Initialize() { | 591 bool PbufferGLSurfaceGLX::Initialize() { |
588 DCHECK(!pbuffer_); | 592 DCHECK(!pbuffer_); |
589 | 593 |
590 static const int config_attributes[] = { | 594 static const int config_attributes[] = { |
591 GLX_BUFFER_SIZE, 32, | 595 GLX_BUFFER_SIZE, 32, |
592 GLX_ALPHA_SIZE, 8, | 596 GLX_ALPHA_SIZE, 8, |
593 GLX_BLUE_SIZE, 8, | 597 GLX_BLUE_SIZE, 8, |
594 GLX_GREEN_SIZE, 8, | 598 GLX_GREEN_SIZE, 8, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 | 665 |
662 void* PbufferGLSurfaceGLX::GetConfig() { | 666 void* PbufferGLSurfaceGLX::GetConfig() { |
663 return config_; | 667 return config_; |
664 } | 668 } |
665 | 669 |
666 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { | 670 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { |
667 Destroy(); | 671 Destroy(); |
668 } | 672 } |
669 | 673 |
670 } // namespace gfx | 674 } // namespace gfx |
OLD | NEW |