blob: c47fff5de35e44d083b6b9898e039040c3f3a87a [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 }
24 bool isValid() const override { return true; }
25 void testAbandon() override {}
26 void submit() override {}
27 void finish() override {}
28
29protected:
30 void teardown() override {}
31 void onPlatformMakeCurrent() const override {}
32 void onPlatformSwapBuffers() const override {}
33
34private:
35 typedef sk_gpu_test::TestContext INHERITED;
36};
37
38} // anonymous namespace
39
40namespace sk_gpu_test {
41
42TestContext* CreateMockTestContext(TestContext*) { return new MockTestContext(); }
43
44} // namespace sk_gpu_test
45#endif