src/hbservers/hbthemeserver/hbsgimagerenderer_p.h
changeset 2 06ff229162e9
parent 1 f7ac710697a9
child 21 4633027730f5
equal deleted inserted replaced
1:f7ac710697a9 2:06ff229162e9
    29 #include <QHash>
    29 #include <QHash>
    30 #include <EGL/egl.h>
    30 #include <EGL/egl.h>
    31 #include <sgresource/sgimage.h>
    31 #include <sgresource/sgimage.h>
    32 #include <hbthemecommon_symbian_p.h>
    32 #include <hbthemecommon_symbian_p.h>
    33 
    33 
       
    34 class HbNvgEngine;
       
    35 
    34 #ifdef HB_ICON_CACHE_DEBUG
    36 #ifdef HB_ICON_CACHE_DEBUG
    35 typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*);
    37 typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*);
    36 #endif
    38 #endif
    37 
    39 
    38 class HbSgImageRenderer
    40 class HbSgImageRenderer
    39 {
    41 {
    40 public:
    42 public:
    41 
    43 
    42     HbSgImageRenderer();
    44     HbSgImageRenderer();
    43     ~HbSgImageRenderer();
    45     ~HbSgImageRenderer();
       
    46     HbNvgEngine * nvgEngine() { return engine;}
    44     bool initialize();
    47     bool initialize();
    45     bool beginRendering(RSgImage * sgImage);
    48     bool beginRendering(RSgImage * sgImage);
    46     void endRendering();    
    49     void endRendering();    
    47     static HbSgImageRenderer *global();
    50     static HbSgImageRenderer *global();
    48     static void addSgImageToHash(unsigned long long id, RSgImage* sgImage);
    51     static void addSgImageToHash(unsigned long long id, RSgImage* sgImage);
    49     static void removeSgImageFromHash(unsigned long long id);
    52     static void removeSgImageFromHash(unsigned long long id);
       
    53     void terminate();
    50 
    54 
    51 #ifdef HB_ICON_CACHE_DEBUG
    55 #ifdef HB_ICON_CACHE_DEBUG
    52     unsigned long totalGPUMemory();
    56     unsigned long totalGPUMemory();
    53     unsigned long freeGPUMemory();
    57     unsigned long freeGPUMemory();
    54 #endif
    58 #endif
    55     
    59     
    56 private:
    60 private:
    57     
    61 
    58     void terminate();
       
    59     bool createContext(RSgImage * sgImage);
    62     bool createContext(RSgImage * sgImage);
    60     
    63     
    61 #ifdef HB_ICON_CACHE_DEBUG
    64 #ifdef HB_ICON_CACHE_DEBUG
    62     EGLint* HbSgImageRenderer::getProfileData(EGLint & data_count);
    65     EGLint* HbSgImageRenderer::getProfileData(EGLint & data_count);
    63     NOK_resource_profiling eglQueryProfilingData;
    66     NOK_resource_profiling eglQueryProfilingData;
    70     EGLContext  eglContext;
    73     EGLContext  eglContext;
    71     EGLConfig   eglConfig;
    74     EGLConfig   eglConfig;
    72     bool        init;
    75     bool        init;
    73     RSgDriver sgDriver;
    76     RSgDriver sgDriver;
    74     static QHash<unsigned long long, RSgImage*> sgImageHash;
    77     static QHash<unsigned long long, RSgImage*> sgImageHash;
       
    78     HbNvgEngine *engine;
    75 };
    79 };
    76 
    80 
    77 #endif
    81 #endif
    78 
    82