Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
MockTestContext.cpp
Go to the documentation of this file.
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
12
14
15namespace {
16
17class MockTestContext : public sk_gpu_test::TestContext {
18public:
19 MockTestContext() {}
20 ~MockTestContext() override {}
21
22 GrBackendApi backend() override { return GrBackendApi::kMock; }
23
24 void testAbandon() override {}
25
27 return GrDirectContext::MakeMock(nullptr, options);
28 }
29
30protected:
31 void teardown() override {}
32 void onPlatformMakeNotCurrent() const override {}
33 void onPlatformMakeCurrent() const override {}
34 std::function<void()> onPlatformGetAutoContextRestore() const override { return nullptr; }
35
36private:
38};
39
40} // anonymous namespace
41
42namespace sk_gpu_test {
43
44TestContext* CreateMockTestContext(TestContext*) { return new MockTestContext(); }
45
46} // namespace sk_gpu_test
47#endif
const char * options
GrBackendApi
Definition GrTypes.h:95
#define INHERITED(method,...)
static sk_sp< GrDirectContext > MakeMock(const GrMockOptions *, const GrContextOptions &)
virtual sk_sp< GrDirectContext > makeContext(const GrContextOptions &)
virtual GrBackendApi backend()=0
virtual std::function< void()> onPlatformGetAutoContextRestore() const =0
virtual void onPlatformMakeNotCurrent() const =0
virtual void testAbandon()
virtual void onPlatformMakeCurrent() const =0