blob: f78b525db56c8f3d7d1c6be8d90d21117129b186 [file] [log] [blame]
[email protected]ab9327c2012-05-02 02:38:081// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]4bedba72010-04-20 22:08:542// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]c9e2cbbb2012-05-12 21:17:275#ifndef UI_GL_GL_CONTEXT_OSMESA_H_
6#define UI_GL_GL_CONTEXT_OSMESA_H_
[email protected]4bedba72010-04-20 22:08:547
[email protected]c9e2cbbb2012-05-12 21:17:278#include "base/basictypes.h"
9#include "base/compiler_specific.h"
10#include "ui/gl/gl_context.h"
[email protected]4bedba72010-04-20 22:08:5411
[email protected]c9e2cbbb2012-05-12 21:17:2712typedef struct osmesa_context* OSMesaContext;
[email protected]5a6db6c2010-04-22 18:32:0613
14namespace gfx {
[email protected]4bedba72010-04-20 22:08:5415
[email protected]7196e012011-06-16 20:54:5316class GLShareGroup;
[email protected]f62a5ab2011-05-23 20:34:1517class GLSurface;
18
[email protected]4bedba72010-04-20 22:08:5419// Encapsulates an OSMesa OpenGL context that uses software rendering.
[email protected]1e9c0c82013-06-06 14:59:2420class GLContextOSMesa : public GLContextReal {
[email protected]4bedba72010-04-20 22:08:5421 public:
[email protected]7196e012011-06-16 20:54:5322 explicit GLContextOSMesa(GLShareGroup* share_group);
[email protected]4bedba72010-04-20 22:08:5423
[email protected]4bedba72010-04-20 22:08:5424 // Implement GLContext.
[email protected]ab9327c2012-05-02 02:38:0825 virtual bool Initialize(GLSurface* compatible_surface,
26 GpuPreference gpu_preference) OVERRIDE;
[email protected]0f52f462011-11-16 19:50:3627 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]4bedba72010-04-20 22:08:5433
[email protected]ab9327c2012-05-02 02:38:0834 protected:
35 virtual ~GLContextOSMesa();
36
[email protected]4bedba72010-04-20 22:08:5437 private:
[email protected]4bedba72010-04-20 22:08:5438 OSMesaContext context_;
[email protected]4bedba72010-04-20 22:08:5439
[email protected]ad7bbbd62011-04-22 23:04:3740 DISALLOW_COPY_AND_ASSIGN(GLContextOSMesa);
[email protected]4bedba72010-04-20 22:08:5441};
42
[email protected]5a6db6c2010-04-22 18:32:0643} // namespace gfx
[email protected]4bedba72010-04-20 22:08:5444
[email protected]c9e2cbbb2012-05-12 21:17:2745#endif // UI_GL_GL_CONTEXT_OSMESA_H_