Flutter Engine
The Flutter Engine
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,...)
Definition: SkRecorder.cpp:128
static sk_sp< GrDirectContext > MakeMock(const GrMockOptions *, const GrContextOptions &)
virtual sk_sp< GrDirectContext > makeContext(const GrContextOptions &)
Definition: TestContext.cpp:24
virtual GrBackendApi backend()=0
virtual void teardown()
Definition: TestContext.cpp:70
virtual std::function< void()> onPlatformGetAutoContextRestore() const =0
virtual void onPlatformMakeNotCurrent() const =0
virtual void testAbandon()
Definition: TestContext.cpp:67
virtual void onPlatformMakeCurrent() const =0
Dart_NativeFunction function
Definition: fuchsia.cc:51
TestContext * CreateMockTestContext(TestContext *)