OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2011 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 #ifndef SkMesaGLContext_DEFINED |
| 8 #define SkMesaGLContext_DEFINED |
| 9 |
| 10 #include "gl/SkGLContext.h" |
| 11 |
| 12 #if SK_MESA |
| 13 |
| 14 class SkMesaGLContext : public SkGLContext { |
| 15 private: |
| 16 typedef intptr_t Context; |
| 17 |
| 18 public: |
| 19 ~SkMesaGLContext() override; |
| 20 |
| 21 static SkMesaGLContext* Create() { |
| 22 SkMesaGLContext* ctx = new SkMesaGLContext; |
| 23 if (!ctx->isValid()) { |
| 24 delete ctx; |
| 25 return nullptr; |
| 26 } |
| 27 return ctx; |
| 28 } |
| 29 |
| 30 private: |
| 31 SkMesaGLContext(); |
| 32 void destroyGLContext(); |
| 33 |
| 34 void onPlatformMakeCurrent() const override; |
| 35 void onPlatformSwapBuffers() const override; |
| 36 GrGLFuncPtr onPlatformGetProcAddress(const char*) const override; |
| 37 |
| 38 Context fContext; |
| 39 GrGLubyte *fImage; |
| 40 }; |
| 41 |
| 42 #endif |
| 43 |
| 44 #endif |
OLD | NEW |