src/hbcore/image/hbeglstate.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
equal deleted inserted replaced
0:16d8024aca5e 1:f7ac710697a9
    32                           EGLSurface rs,
    32                           EGLSurface rs,
    33                           EGLSurface ds,
    33                           EGLSurface ds,
    34                           EGLContext  c,
    34                           EGLContext  c,
    35                           EGLConfig cfg )
    35                           EGLConfig cfg )
    36         : refCount(0),
    36         : refCount(0),
    37         init(0),
    37         init(0)
    38         background(0)
    38        
    39 {
    39 {
    40     fgWatcher = HbForegroundWatcher::instance();
       
    41     connect(fgWatcher, SIGNAL(foregroundLost()),
       
    42             SLOT(handleForegroundLost()));
       
    43     set(d, rs, ds, c, cfg);
    40     set(d, rs, ds, c, cfg);
    44 }
    41 }
    45 
    42 
    46 HbEglStates::HbEglStates()
    43 HbEglStates::HbEglStates()
    47         : refCount(0),
    44         : refCount(0),
    48         init(0),
    45         init(0)
    49         background(0)
    46        
    50 {
    47 {   reset();
    51     fgWatcher = HbForegroundWatcher::instance();
       
    52     connect(fgWatcher, SIGNAL(foregroundLost()),
       
    53             SLOT(handleForegroundLost()));
       
    54     reset();
       
    55 }
    48 }
    56 
    49 
    57 void HbEglStates::handleForegroundLost()
    50 void HbEglStates::handleForegroundLost()
    58 {
    51 {
    59     reset();
    52     reset();
    60     background = 1;
       
    61     init = 0;
    53     init = 0;
    62     HbNVGEnginePool::instance()->resetNVGEngine();
    54     HbNvgEnginePool::instance()->resetNvgEngine();
    63     clearImages();
    55     clearImages();
    64 }
       
    65 
       
    66 void HbEglStates::handleForegroundGained()
       
    67 {
       
    68     background = 0;
       
    69 }
    56 }
    70 
    57 
    71 void HbEglStates::clearImages()
    58 void HbEglStates::clearImages()
    72 {
    59 {
    73     if (!imageList.empty()) {
    60     if (!imageList.empty()) {