cameralityglprofiler.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (c) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
  3. * All rights reserved.
  4. * This component and the accompanying materials are made available
  5. * under the terms of "Eclipse Public License v1.0"
  6. * which accompanies this distribution, and is available
  7. * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8. *
  9. * Initial Contributors:
  10. * Nokia Corporation - initial contribution.
  11. *
  12. * Contributors:
  13. *
  14. * Description: Camerality OpenGL Profiler.
  15. *
  16. */
  17. #ifndef CAMERALITYGLPROFILER_H_
  18. #define CAMERALITYGLPROFILER_H_
  19. // INCLUDES
  20. #include <e32base.h>
  21. #include <EGL/egl.h>
  22. #include <GLES/gl.h>
  23. // FORWARD DECLARATIONS
  24. class CPeriodic;
  25. typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*);
  26. // CLASS DECLARATION
  27. class CCameralityGLProfiler : public CBase
  28. {
  29. public:
  30. static CCameralityGLProfiler* NewL();
  31. virtual ~CCameralityGLProfiler();
  32. public: // New methods
  33. void Start(EGLDisplay aDisplay);
  34. void Stop();
  35. TInt FreeMemory() const;
  36. private: // Private methods
  37. static TInt ProfilingCallback(TAny* aInstance);
  38. TInt Profile();
  39. void Initialize(EGLDisplay aDisplay);
  40. void TraceProfilingData();
  41. private: // Private constructors
  42. CCameralityGLProfiler();
  43. void ConstructL();
  44. private: // Data
  45. unsigned int iTotalMem;
  46. unsigned int iUsedMem;
  47. /** EGL display */
  48. EGLDisplay iEglDisplay;
  49. /** EGL version */
  50. EGLint iEGLMajor;
  51. EGLint iEGLMinor;
  52. /** EGL implementation details */
  53. const char* iVendor;
  54. const char* iVersion;
  55. const char* iClientAPIS;
  56. const char* iExtensions;
  57. /** Profiling data count and array */
  58. EGLint iDataCount;
  59. /** Profiling data array */
  60. EGLint* iProfilingData;
  61. /** Pointer to resource profiling method, if available */
  62. NOK_resource_profiling iEglQueryProfilingData;
  63. /** Periodic timer for profiling */
  64. CPeriodic* iPeriodic;
  65. };
  66. #endif /* CAMERALITYGLPROFILER_H_ */