michael@0: michael@0: /* michael@0: * Copyright 2012 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: #ifndef SkANGLEGLContext_DEFINED michael@0: #define SkANGLEGLContext_DEFINED michael@0: michael@0: #if SK_ANGLE michael@0: michael@0: #include "SkGLContextHelper.h" michael@0: michael@0: #include michael@0: #include michael@0: michael@0: class SkANGLEGLContext : public SkGLContextHelper { michael@0: public: michael@0: SkANGLEGLContext(); michael@0: michael@0: virtual ~SkANGLEGLContext(); michael@0: michael@0: virtual void makeCurrent() const SK_OVERRIDE; michael@0: virtual void swapBuffers() const SK_OVERRIDE; michael@0: michael@0: class AutoContextRestore { michael@0: public: michael@0: AutoContextRestore(); michael@0: ~AutoContextRestore(); michael@0: michael@0: private: michael@0: EGLContext fOldEGLContext; michael@0: EGLDisplay fOldDisplay; michael@0: EGLSurface fOldSurface; michael@0: }; michael@0: michael@0: protected: michael@0: virtual const GrGLInterface* createGLContext() SK_OVERRIDE; michael@0: virtual void destroyGLContext() SK_OVERRIDE; michael@0: michael@0: private: michael@0: EGLContext fContext; michael@0: EGLDisplay fDisplay; michael@0: EGLSurface fSurface; michael@0: }; michael@0: michael@0: #endif michael@0: michael@0: #endif