[email protected] | ab9327c | 2012-05-02 02:38:08 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 5 | #ifndef UI_GL_GL_CONTEXT_OSMESA_H_ |
6 | #define UI_GL_GL_CONTEXT_OSMESA_H_ | ||||
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 7 | |
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 8 | #include "base/basictypes.h" |
9 | #include "base/compiler_specific.h" | ||||
10 | #include "ui/gl/gl_context.h" | ||||
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 11 | |
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 12 | typedef struct osmesa_context* OSMesaContext; |
[email protected] | 5a6db6c | 2010-04-22 18:32:06 | [diff] [blame] | 13 | |
14 | namespace gfx { | ||||
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 15 | |
[email protected] | 7196e01 | 2011-06-16 20:54:53 | [diff] [blame] | 16 | class GLShareGroup; |
[email protected] | f62a5ab | 2011-05-23 20:34:15 | [diff] [blame] | 17 | class GLSurface; |
18 | |||||
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 19 | // Encapsulates an OSMesa OpenGL context that uses software rendering. |
[email protected] | 1e9c0c8 | 2013-06-06 14:59:24 | [diff] [blame^] | 20 | class GLContextOSMesa : public GLContextReal { |
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 21 | public: |
[email protected] | 7196e01 | 2011-06-16 20:54:53 | [diff] [blame] | 22 | explicit GLContextOSMesa(GLShareGroup* share_group); |
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 23 | |
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 24 | // Implement GLContext. |
[email protected] | ab9327c | 2012-05-02 02:38:08 | [diff] [blame] | 25 | virtual bool Initialize(GLSurface* compatible_surface, |
26 | GpuPreference gpu_preference) OVERRIDE; | ||||
[email protected] | 0f52f46 | 2011-11-16 19:50:36 | [diff] [blame] | 27 | virtual void Destroy() OVERRIDE; |
28 | virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; | ||||
29 | virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE; | ||||
30 | virtual bool IsCurrent(GLSurface* surface) OVERRIDE; | ||||
31 | virtual void* GetHandle() OVERRIDE; | ||||
32 | virtual void SetSwapInterval(int interval) OVERRIDE; | ||||
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 33 | |
[email protected] | ab9327c | 2012-05-02 02:38:08 | [diff] [blame] | 34 | protected: |
35 | virtual ~GLContextOSMesa(); | ||||
36 | |||||
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 37 | private: |
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 38 | OSMesaContext context_; |
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 39 | |
[email protected] | ad7bbbd6 | 2011-04-22 23:04:37 | [diff] [blame] | 40 | DISALLOW_COPY_AND_ASSIGN(GLContextOSMesa); |
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 41 | }; |
42 | |||||
[email protected] | 5a6db6c | 2010-04-22 18:32:06 | [diff] [blame] | 43 | } // namespace gfx |
[email protected] | 4bedba7 | 2010-04-20 22:08:54 | [diff] [blame] | 44 | |
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 45 | #endif // UI_GL_GL_CONTEXT_OSMESA_H_ |