Coverage Report

Created: 2024-05-20 07:14

/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
2.58k
    MockTestContext() {}
20
0
    ~MockTestContext() override {}
21
22
0
    GrBackendApi backend() override { return GrBackendApi::kMock; }
23
24
0
    void testAbandon() override {}
25
26
2.58k
    sk_sp<GrDirectContext> makeContext(const GrContextOptions& options) override {
27
2.58k
        return GrDirectContext::MakeMock(nullptr, options);
28
2.58k
    }
29
30
protected:
31
0
    void teardown() override {}
32
0
    void onPlatformMakeNotCurrent() const override {}
33
7.74k
    void onPlatformMakeCurrent() const override {}
34
5.16k
    std::function<void()> onPlatformGetAutoContextRestore() const override { return nullptr; }
35
36
private:
37
    using INHERITED = sk_gpu_test::TestContext;
38
};
39
40
} // anonymous namespace
41
42
namespace sk_gpu_test {
43
44
2.58k
TestContext* CreateMockTestContext(TestContext*) { return new MockTestContext(); }
45
46
}  // namespace sk_gpu_test
47
#endif