Fix creating non-hardware-accelerated contexts

This commit is contained in:
Pierre Krieger 2015-03-01 11:07:46 +01:00
parent cf252c29b4
commit 7ba8fdf3f3
2 changed files with 8 additions and 6 deletions

View file

@ -197,6 +197,7 @@ pub enum MouseCursor {
#[allow(missing_docs)]
#[derive(Debug)]
pub struct PixelFormat {
pub hardware_accelerated: bool,
pub red_bits: u8,
pub green_bits: u8,
pub blue_bits: u8,
@ -286,6 +287,10 @@ impl<'a> BuilderAttribs<'a> {
// TODO: do this more properly
for (id, format) in iter {
if !format.hardware_accelerated {
continue;
}
if format.red_bits + format.green_bits + format.blue_bits < self.color_bits.unwrap_or(0) {
continue;
}