blob: 56cd68cb59a89c05336725858193ad9e4d5480bc [file] [log] [blame]
Brian Salomoncfe910d2017-07-06 16:40:18 -04001
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
13namespace {
14
15class MockTestContext : public sk_gpu_test::TestContext {
16public:
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 }
Brian Salomoncfe910d2017-07-06 16:40:18 -040024 void testAbandon() override {}
25 void submit() override {}
26 void finish() override {}
27
28protected:
29 void teardown() override {}
30 void onPlatformMakeCurrent() const override {}
31 void onPlatformSwapBuffers() const override {}
32
33private:
34 typedef sk_gpu_test::TestContext INHERITED;
35};
36
37} // anonymous namespace
38
39namespace sk_gpu_test {
40
41TestContext* CreateMockTestContext(TestContext*) { return new MockTestContext(); }
42
43} // namespace sk_gpu_test
44#endif