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: MockTestContext()17 MockTestContext() {} ~MockTestContext()18 ~MockTestContext() override {} 19 backend()20 virtual GrBackend backend() override { return kMock_GrBackend; } backendContext()21 virtual GrBackendContext backendContext() override { 22 return reinterpret_cast<GrBackendContext>(nullptr); 23 } testAbandon()24 void testAbandon() override {} submit()25 void submit() override {} finish()26 void finish() override {} 27 28 protected: teardown()29 void teardown() override {} onPlatformMakeCurrent() const30 void onPlatformMakeCurrent() const override {} onPlatformSwapBuffers() const31 void onPlatformSwapBuffers() const override {} 32 33 private: 34 typedef sk_gpu_test::TestContext INHERITED; 35 }; 36 37 } // anonymous namespace 38 39 namespace sk_gpu_test { 40 CreateMockTestContext(TestContext *)41TestContext* CreateMockTestContext(TestContext*) { return new MockTestContext(); } 42 43 } // namespace sk_gpu_test 44 #endif 45