/src/skia/tools/gpu/mock/MockTestContext.cpp
Line | Count | Source (jump to first uncovered line) |
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 "tools/gpu/mock/MockTestContext.h" |
12 | | |
13 | | #include "include/gpu/GrDirectContext.h" |
14 | | |
15 | | namespace { |
16 | | |
17 | | class MockTestContext : public sk_gpu_test::TestContext { |
18 | | public: |
19 | 1.32k | MockTestContext() {} |
20 | 0 | ~MockTestContext() override {} |
21 | | |
22 | 0 | GrBackendApi backend() override { return GrBackendApi::kMock; } |
23 | | |
24 | 0 | void testAbandon() override {} |
25 | 0 | void finish() override {} |
26 | | |
27 | 1.32k | sk_sp<GrDirectContext> makeContext(const GrContextOptions& options) override { |
28 | 1.32k | return GrDirectContext::MakeMock(nullptr, options); |
29 | 1.32k | } |
30 | | |
31 | | protected: |
32 | 0 | void teardown() override {} |
33 | 0 | void onPlatformMakeNotCurrent() const override {} |
34 | 3.97k | void onPlatformMakeCurrent() const override {} |
35 | 2.65k | std::function<void()> onPlatformGetAutoContextRestore() const override { return nullptr; } |
36 | | |
37 | | private: |
38 | | using INHERITED = sk_gpu_test::TestContext; |
39 | | }; |
40 | | |
41 | | } // anonymous namespace |
42 | | |
43 | | namespace sk_gpu_test { |
44 | | |
45 | 1.32k | TestContext* CreateMockTestContext(TestContext*) { return new MockTestContext(); } |
46 | | |
47 | | } // namespace sk_gpu_test |
48 | | #endif |