uifw/ganes/src/HgVgEGL.cpp
branchRCL_3
changeset 21 978afdc0236f
parent 20 d48ab3b357f1
equal deleted inserted replaced
20:d48ab3b357f1 21:978afdc0236f
    45 // -----------------------------------------------------------------------------
    45 // -----------------------------------------------------------------------------
    46 //
    46 //
    47 void CHgVgEGL::ConstructL (RWindow& aWindow)
    47 void CHgVgEGL::ConstructL (RWindow& aWindow)
    48     {
    48     {
    49     InitEGL(aWindow);
    49     InitEGL(aWindow);
       
    50     // Enable flag that is used to determine whether egl has been initialized.
       
    51     // For example vgImages shouldn't be created before egl has been initialized.
       
    52     // There will be only one instance of this class so there is no need to check
       
    53     // whether there is already something in the DLL tls.
       
    54     TBool* eglInitialized = new TBool(ETrue);
       
    55     Dll::SetTls((TAny*)eglInitialized);
    50     }
    56     }
    51 
    57 
    52 // -----------------------------------------------------------------------------
    58 // -----------------------------------------------------------------------------
    53 // CHgVgEGL::CHgVgEGL()
    59 // CHgVgEGL::CHgVgEGL()
    54 // C++ default constructor can NOT contain any code, that might leave.
    60 // C++ default constructor can NOT contain any code, that might leave.
    64 // -----------------------------------------------------------------------------
    70 // -----------------------------------------------------------------------------
    65 //
    71 //
    66 CHgVgEGL::~CHgVgEGL ( )
    72 CHgVgEGL::~CHgVgEGL ( )
    67     {
    73     {
    68     DestroyEGL();
    74     DestroyEGL();
       
    75     // Disable flag that is used to determine whether egl has been initialized.
       
    76     // For example vgImages shouldn't be created before egl has been initialized.
       
    77     delete Dll::Tls();
       
    78     Dll::FreeTls();
    69     }
    79     }
    70 
    80 
    71 // ---------------------------------------------------------------------------
    81 // ---------------------------------------------------------------------------
    72 // CHgVgEGL::InitWindowSurfaceL()
    82 // CHgVgEGL::InitWindowSurfaceL()
    73 // ---------------------------------------------------------------------------
    83 // ---------------------------------------------------------------------------
   355         }
   365         }
   356     
   366     
   357     return bitmap;    
   367     return bitmap;    
   358     }
   368     }
   359 
   369 
       
   370 // ---------------------------------------------------------------------------
       
   371 // CHgVgEGL::EglInitialized()
       
   372 // ---------------------------------------------------------------------------
       
   373 //     
       
   374 TBool CHgVgEGL::EglInitialized()
       
   375 {
       
   376     TBool* eglInitialized = (TBool*)Dll::Tls();
       
   377     return eglInitialized ? *eglInitialized : EFalse;
       
   378 }
       
   379 
   360 // End of File
   380 // End of File