X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/4ebd765cac9f8a7ae4934147ed876a9e228eeb8d..aa052184a12e61d01983f8c9047183e6b0d499f3:/lib/gdi/gfbdc.cpp diff --git a/lib/gdi/gfbdc.cpp b/lib/gdi/gfbdc.cpp index a1f4c981..bd259bd2 100644 --- a/lib/gdi/gfbdc.cpp +++ b/lib/gdi/gfbdc.cpp @@ -2,7 +2,6 @@ #include #include -#include #include @@ -34,20 +33,24 @@ gFBDC::gFBDC() surface.data_phys = 50*1024*1024; // FIXME - surface_back.type = 0; - surface_back.x = 720; - surface_back.y = 576; - surface_back.bpp = 32; - surface_back.bypp = 4; - surface_back.stride = fb->Stride(); - surface_back.offset = surface.y; - int fb_size = surface.stride * surface.y; - surface_back.data = fb->lfb + fb_size; - surface_back.data_phys = surface.data_phys + fb_size; + if (fb->getNumPages() > 1) + { + m_enable_double_buffering = 1; + surface_back.type = 0; + surface_back.x = 720; + surface_back.y = 576; + surface_back.bpp = 32; + surface_back.bypp = 4; + surface_back.stride = fb->Stride(); + surface_back.offset = surface.y; + surface_back.data = fb->lfb + fb_size; + surface_back.data_phys = surface.data_phys + fb_size; - fb_size *= 2; + fb_size *= 2; + } else + m_enable_double_buffering = 0; eDebug("%dkB available for acceleration surfaces.", (fb->Available() - fb_size)/1024); @@ -139,11 +142,14 @@ void gFBDC::exec(gOpcode *o) } case gOpcode::flip: { - gSurface s(surface); - surface = surface_back; - surface_back = s; + if (m_enable_double_buffering) + { + gSurface s(surface); + surface = surface_back; + surface_back = s; - fb->setOffset(surface_back.offset); + fb->setOffset(surface_back.offset); + } break; } case gOpcode::waitVSync: @@ -199,19 +205,13 @@ void gFBDC::setGamma(int g) void gFBDC::saveSettings() { - eConfig::getInstance()->setKey("/ezap/osd/alpha", alpha); - eConfig::getInstance()->setKey("/ezap/osd/gamma", gamma); - eConfig::getInstance()->setKey("/ezap/osd/brightness", brightness); } void gFBDC::reloadSettings() { - if (eConfig::getInstance()->getKey("/ezap/osd/alpha", alpha)) - alpha=255; - if (eConfig::getInstance()->getKey("/ezap/osd/gamma", gamma)) - gamma=128; - if (eConfig::getInstance()->getKey("/ezap/osd/brightness", brightness)) - brightness=128; + alpha=255; + gamma=128; + brightness=128; calcRamp(); setPalette();