1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef UI_GL_GL_OSMESA_API_IMPLEMENTATION_H_ 6 #define UI_GL_GL_OSMESA_API_IMPLEMENTATION_H_ 7 8 #include "base/compiler_specific.h" 9 #include "ui/gl/gl_bindings.h" 10 #include "ui/gl/gl_export.h" 11 12 namespace gfx { 13 14 class GLContext; 15 16 void InitializeStaticGLBindingsOSMESA(); 17 void InitializeDynamicGLBindingsOSMESA(GLContext* context); 18 void InitializeDebugGLBindingsOSMESA(); 19 void ClearGLBindingsOSMESA(); 20 21 class GL_EXPORT OSMESAApiBase : public OSMESAApi { 22 public: 23 // Include the auto-generated part of this class. We split this because 24 // it means we can easily edit the non-auto generated parts right here in 25 // this file instead of having to edit some template or the code generator. 26 #include "gl_bindings_api_autogen_osmesa.h" 27 28 protected: 29 OSMESAApiBase(); 30 virtual ~OSMESAApiBase(); 31 void InitializeBase(DriverOSMESA* driver); 32 33 DriverOSMESA* driver_; 34 }; 35 36 class GL_EXPORT RealOSMESAApi : public OSMESAApiBase { 37 public: 38 RealOSMESAApi(); 39 virtual ~RealOSMESAApi(); 40 void Initialize(DriverOSMESA* driver); 41 }; 42 43 // Inserts a TRACE for every OSMESA call. 44 class GL_EXPORT TraceOSMESAApi : public OSMESAApi { 45 public: TraceOSMESAApi(OSMESAApi * osmesa_api)46 TraceOSMESAApi(OSMESAApi* osmesa_api) : osmesa_api_(osmesa_api) { } 47 virtual ~TraceOSMESAApi(); 48 49 // Include the auto-generated part of this class. We split this because 50 // it means we can easily edit the non-auto generated parts right here in 51 // this file instead of having to edit some template or the code generator. 52 #include "gl_bindings_api_autogen_osmesa.h" 53 54 private: 55 OSMESAApi* osmesa_api_; 56 }; 57 58 } // namespace gfx 59 60 #endif // UI_GL_GL_OSMESA_API_IMPLEMENTATION_H_ 61 62 63 64