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; |
34 class HbNvgEngine; |
35 |
|
36 #ifdef HB_ICON_CACHE_DEBUG |
|
37 typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*); |
35 typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*); |
38 #endif |
|
39 |
|
40 class HbSgImageRenderer |
36 class HbSgImageRenderer |
41 { |
37 { |
42 public: |
38 public: |
43 |
39 |
44 HbSgImageRenderer(); |
40 HbSgImageRenderer(); |
49 void endRendering(); |
45 void endRendering(); |
50 static HbSgImageRenderer *global(); |
46 static HbSgImageRenderer *global(); |
51 static void addSgImageToHash(unsigned long long id, RSgImage* sgImage); |
47 static void addSgImageToHash(unsigned long long id, RSgImage* sgImage); |
52 static void removeSgImageFromHash(unsigned long long id); |
48 static void removeSgImageFromHash(unsigned long long id); |
53 void terminate(); |
49 void terminate(); |
54 |
50 int lastError(); |
55 #ifdef HB_ICON_CACHE_DEBUG |
51 void setLastError(int lastError); |
56 unsigned long totalGPUMemory(); |
52 unsigned long totalGPUMemory(); |
57 unsigned long freeGPUMemory(); |
53 unsigned long freeGPUMemory(); |
58 #endif |
54 |
59 |
55 |
60 private: |
56 private: |
61 |
57 |
62 bool createContext(RSgImage * sgImage); |
58 bool createContext(RSgImage * sgImage); |
63 |
59 EGLint* getProfileData(EGLint & data_count); |
64 #ifdef HB_ICON_CACHE_DEBUG |
|
65 EGLint* HbSgImageRenderer::getProfileData(EGLint & data_count); |
|
66 NOK_resource_profiling eglQueryProfilingData; |
60 NOK_resource_profiling eglQueryProfilingData; |
67 EGLint data_count; |
61 EGLint data_count; |
68 EGLint* prof_data; |
62 EGLint* prof_data; |
69 #endif |
|
70 |
63 |
71 EGLDisplay display; |
64 EGLDisplay display; |
72 EGLSurface currentSurface; |
65 EGLSurface currentSurface; |
73 EGLContext eglContext; |
66 EGLContext eglContext; |
74 EGLConfig eglConfig; |
67 EGLConfig eglConfig; |
75 bool init; |
68 bool init; |
76 RSgDriver sgDriver; |
69 RSgDriver sgDriver; |
77 static QHash<unsigned long long, RSgImage*> sgImageHash; |
70 static QHash<unsigned long long, RSgImage*> sgImageHash; |
78 HbNvgEngine *engine; |
71 HbNvgEngine *engine; |
|
72 int errorCode; |
79 }; |
73 }; |
80 |
74 |
81 #endif |
75 #endif |
82 |
76 |