gfx/skia/trunk/include/gpu/gl/SkANGLEGLContext.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/include/gpu/gl/SkANGLEGLContext.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2012 Google Inc.
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +#ifndef SkANGLEGLContext_DEFINED
    1.12 +#define SkANGLEGLContext_DEFINED
    1.13 +
    1.14 +#if SK_ANGLE
    1.15 +
    1.16 +#include "SkGLContextHelper.h"
    1.17 +
    1.18 +#include <GLES2/gl2.h>
    1.19 +#include <EGL/egl.h>
    1.20 +
    1.21 +class SkANGLEGLContext : public SkGLContextHelper {
    1.22 +public:
    1.23 +    SkANGLEGLContext();
    1.24 +
    1.25 +    virtual ~SkANGLEGLContext();
    1.26 +
    1.27 +    virtual void makeCurrent() const SK_OVERRIDE;
    1.28 +    virtual void swapBuffers() const SK_OVERRIDE;
    1.29 +
    1.30 +    class AutoContextRestore {
    1.31 +    public:
    1.32 +        AutoContextRestore();
    1.33 +        ~AutoContextRestore();
    1.34 +
    1.35 +    private:
    1.36 +        EGLContext fOldEGLContext;
    1.37 +        EGLDisplay fOldDisplay;
    1.38 +        EGLSurface fOldSurface;
    1.39 +    };
    1.40 +
    1.41 +protected:
    1.42 +    virtual const GrGLInterface* createGLContext() SK_OVERRIDE;
    1.43 +    virtual void destroyGLContext() SK_OVERRIDE;
    1.44 +
    1.45 +private:
    1.46 +    EGLContext fContext;
    1.47 +    EGLDisplay fDisplay;
    1.48 +    EGLSurface fSurface;
    1.49 +};
    1.50 +
    1.51 +#endif
    1.52 +
    1.53 +#endif

mercurial