| OLD | NEW |
| (Empty) |
| 1 | |
| 2 /* | |
| 3 * Copyright 2015 Google Inc. | |
| 4 * | |
| 5 * Use of this source code is governed by a BSD-style license that can be | |
| 6 * found in the LICENSE file. | |
| 7 */ | |
| 8 | |
| 9 #ifndef GLTestContext_command_buffer_DEFINED | |
| 10 #define GLTestContext_command_buffer_DEFINED | |
| 11 | |
| 12 #include "gl/GLTestContext.h" | |
| 13 | |
| 14 namespace sk_gpu_test { | |
| 15 class CommandBufferGLTestContext : public GLTestContext { | |
| 16 public: | |
| 17 ~CommandBufferGLTestContext() override; | |
| 18 | |
| 19 static CommandBufferGLTestContext *Create() { | |
| 20 CommandBufferGLTestContext *ctx = new CommandBufferGLTestContext; | |
| 21 if (!ctx->isValid()) { | |
| 22 delete ctx; | |
| 23 return nullptr; | |
| 24 } | |
| 25 return ctx; | |
| 26 } | |
| 27 | |
| 28 static CommandBufferGLTestContext *Create(void *nativeWindow, int msaaSample
Count) { | |
| 29 CommandBufferGLTestContext *ctx = new CommandBufferGLTestContext(nativeW
indow, msaaSampleCount); | |
| 30 if (!ctx->isValid()) { | |
| 31 delete ctx; | |
| 32 return nullptr; | |
| 33 } | |
| 34 return ctx; | |
| 35 } | |
| 36 | |
| 37 void presentCommandBuffer(); | |
| 38 | |
| 39 bool makeCurrent(); | |
| 40 | |
| 41 int getStencilBits(); | |
| 42 | |
| 43 int getSampleCount(); | |
| 44 | |
| 45 private: | |
| 46 CommandBufferGLTestContext(); | |
| 47 | |
| 48 CommandBufferGLTestContext(void *nativeWindow, int msaaSampleCount); | |
| 49 | |
| 50 void initializeGLContext(void *nativeWindow, const int *configAttribs, | |
| 51 const int *surfaceAttribs); | |
| 52 | |
| 53 void destroyGLContext(); | |
| 54 | |
| 55 void onPlatformMakeCurrent() const override; | |
| 56 | |
| 57 void onPlatformSwapBuffers() const override; | |
| 58 | |
| 59 GrGLFuncPtr onPlatformGetProcAddress(const char *name) const override; | |
| 60 | |
| 61 void *fContext; | |
| 62 void *fDisplay; | |
| 63 void *fSurface; | |
| 64 void *fConfig; | |
| 65 }; | |
| 66 } // namespace sk_gpu_test | |
| 67 | |
| 68 #endif | |
| OLD | NEW |