1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/gpu/gl/SkMesaGLContext.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2011 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 SkMesaGLContext_DEFINED 1.12 +#define SkMesaGLContext_DEFINED 1.13 + 1.14 +#include "SkGLContextHelper.h" 1.15 + 1.16 +#if SK_MESA 1.17 + 1.18 +class SkMesaGLContext : public SkGLContextHelper { 1.19 +private: 1.20 + typedef intptr_t Context; 1.21 + 1.22 +public: 1.23 + SkMesaGLContext(); 1.24 + 1.25 + virtual ~SkMesaGLContext(); 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 + Context fOldContext; 1.37 + GrGLint fOldWidth; 1.38 + GrGLint fOldHeight; 1.39 + GrGLint fOldFormat; 1.40 + void* fOldImage; 1.41 + }; 1.42 + 1.43 +protected: 1.44 + virtual const GrGLInterface* createGLContext() SK_OVERRIDE; 1.45 + virtual void destroyGLContext() SK_OVERRIDE; 1.46 + 1.47 +private: 1.48 + Context fContext; 1.49 + GrGLubyte *fImage; 1.50 +}; 1.51 + 1.52 +#endif 1.53 + 1.54 +#endif