OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "NullGLTestContext.h" | 9 #include "NullGLTestContext.h" |
10 #include "gl/GrGLTestInterface.h" | 10 #include "gl/GrGLTestInterface.h" |
11 #include "gl/GrGLDefines.h" | 11 #include "gl/GrGLDefines.h" |
12 #include "gl/GrGLInterface.h" | 12 #include "gl/GrGLInterface.h" |
13 #include "gl/GrGLTypes.h" | 13 #include "gl/GrGLTypes.h" |
14 #include "SkMutex.h" | 14 #include "SkMutex.h" |
15 #include "SkTDArray.h" | 15 #include "SkTDArray.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 class NullGLContext : public sk_gpu_test::GLTestContext { | 18 class NullGLContext : public sk_gpu_test::GLTestContext { |
19 public: | 19 public: |
20 NullGLContext() { this->init(GrGLCreateNullInterface()); } | 20 NullGLContext(bool enableNVPR) { this->init(GrGLCreateNullInterface(enableNV
PR)); } |
21 ~NullGLContext() override { this->teardown(); } | 21 ~NullGLContext() override { this->teardown(); } |
22 | 22 |
23 private: | 23 private: |
24 void onPlatformMakeCurrent() const override {}; | 24 void onPlatformMakeCurrent() const override {}; |
25 void onPlatformSwapBuffers() const override {} | 25 void onPlatformSwapBuffers() const override {} |
26 GrGLFuncPtr onPlatformGetProcAddress(const char*) const override { return nu
llptr; } | 26 GrGLFuncPtr onPlatformGetProcAddress(const char*) const override { return nu
llptr; } |
27 }; | 27 }; |
28 | 28 |
29 } // anonymous namespace | 29 } // anonymous namespace |
30 | 30 |
31 namespace sk_gpu_test { | 31 namespace sk_gpu_test { |
32 GLTestContext* CreateNullGLTestContext() { | 32 GLTestContext* CreateNullGLTestContext(bool enableNVPR) { |
33 GLTestContext* ctx = new NullGLContext(); | 33 GLTestContext* ctx = new NullGLContext(enableNVPR); |
34 if (ctx->isValid()) { | 34 if (ctx->isValid()) { |
35 return ctx; | 35 return ctx; |
36 } | 36 } |
37 delete ctx; | 37 delete ctx; |
38 return nullptr; | 38 return nullptr; |
39 } | 39 } |
40 } // namespace sk_gpu_test | 40 } // namespace sk_gpu_test |
41 | 41 |
OLD | NEW |