michael@0: michael@0: /* michael@0: * Copyright 2011 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 SkMesaGLContext_DEFINED michael@0: #define SkMesaGLContext_DEFINED michael@0: michael@0: #include "SkGLContextHelper.h" michael@0: michael@0: #if SK_MESA michael@0: michael@0: class SkMesaGLContext : public SkGLContextHelper { michael@0: private: michael@0: typedef intptr_t Context; michael@0: michael@0: public: michael@0: SkMesaGLContext(); michael@0: michael@0: virtual ~SkMesaGLContext(); 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: Context fOldContext; michael@0: GrGLint fOldWidth; michael@0: GrGLint fOldHeight; michael@0: GrGLint fOldFormat; michael@0: void* fOldImage; 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: Context fContext; michael@0: GrGLubyte *fImage; michael@0: }; michael@0: michael@0: #endif michael@0: michael@0: #endif