Brian Salomon | cfe910d | 2017-07-06 16:40:18 -0400 | [diff] [blame^] | 1 | |
| 2 | /* |
| 3 | * Copyright 2017 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 | #ifndef GLTestContext_DEFINED |
| 9 | #define GLTestContext_DEFINED |
| 10 | |
| 11 | #include "MockTestContext.h" |
| 12 | |
| 13 | namespace { |
| 14 | |
| 15 | class MockTestContext : public sk_gpu_test::TestContext { |
| 16 | public: |
| 17 | MockTestContext() {} |
| 18 | ~MockTestContext() override {} |
| 19 | |
| 20 | virtual GrBackend backend() override { return kMock_GrBackend; } |
| 21 | virtual GrBackendContext backendContext() override { |
| 22 | return reinterpret_cast<GrBackendContext>(nullptr); |
| 23 | } |
| 24 | bool isValid() const override { return true; } |
| 25 | void testAbandon() override {} |
| 26 | void submit() override {} |
| 27 | void finish() override {} |
| 28 | |
| 29 | protected: |
| 30 | void teardown() override {} |
| 31 | void onPlatformMakeCurrent() const override {} |
| 32 | void onPlatformSwapBuffers() const override {} |
| 33 | |
| 34 | private: |
| 35 | typedef sk_gpu_test::TestContext INHERITED; |
| 36 | }; |
| 37 | |
| 38 | } // anonymous namespace |
| 39 | |
| 40 | namespace sk_gpu_test { |
| 41 | |
| 42 | TestContext* CreateMockTestContext(TestContext*) { return new MockTestContext(); } |
| 43 | |
| 44 | } // namespace sk_gpu_test |
| 45 | #endif |