blob: ef0017180c699d33dee464c62de35763f1a8433c [file] [log] [blame]
bsalomon@google.com373a6632011-10-19 20:43:20 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8#ifndef SkMesaGLContext_DEFINED
9#define SkMesaGLContext_DEFINED
10
kkinnunen9e61bb72014-10-09 05:24:15 -070011#include "SkGLContext.h"
bsalomon@google.com373a6632011-10-19 20:43:20 +000012
13#if SK_MESA
14
kkinnunen9e61bb72014-10-09 05:24:15 -070015class SkMesaGLContext : public SkGLContext {
bsalomon@google.com57f5d982011-10-24 21:17:53 +000016private:
17 typedef intptr_t Context;
18
bsalomon@google.com373a6632011-10-19 20:43:20 +000019public:
20 SkMesaGLContext();
21
22 virtual ~SkMesaGLContext();
23
24 virtual void makeCurrent() const SK_OVERRIDE;
djsollen@google.comc9542ca2013-10-09 18:25:38 +000025 virtual void swapBuffers() const SK_OVERRIDE;
bsalomon@google.com373a6632011-10-19 20:43:20 +000026
27protected:
kkinnunen80549fc2014-06-30 06:36:31 -070028 virtual const GrGLInterface* createGLContext(GrGLStandard forcedGpuAPI) SK_OVERRIDE;
bsalomon@google.com74913722011-10-27 20:44:19 +000029 virtual void destroyGLContext() SK_OVERRIDE;
bsalomon@google.com373a6632011-10-19 20:43:20 +000030
31private:
bsalomon@google.com373a6632011-10-19 20:43:20 +000032 Context fContext;
33 GrGLubyte *fImage;
34};
35
36#endif
37
bsalomon@google.com57f5d982011-10-24 21:17:53 +000038#endif