2017-07-06 20:40:18 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
#ifndef GLTestContext_DEFINED
|
|
|
|
#define GLTestContext_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "tools/gpu/mock/MockTestContext.h"
|
2017-07-06 20:40:18 +00:00
|
|
|
|
2020-07-13 20:13:31 +00:00
|
|
|
#include "include/gpu/GrDirectContext.h"
|
2017-07-25 14:05:01 +00:00
|
|
|
|
2017-07-06 20:40:18 +00:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
class MockTestContext : public sk_gpu_test::TestContext {
|
|
|
|
public:
|
|
|
|
MockTestContext() {}
|
|
|
|
~MockTestContext() override {}
|
|
|
|
|
2020-08-14 02:58:04 +00:00
|
|
|
GrBackendApi backend() override { return GrBackendApi::kMock; }
|
2018-03-23 20:10:36 +00:00
|
|
|
|
2017-07-06 20:40:18 +00:00
|
|
|
void testAbandon() override {}
|
|
|
|
void finish() override {}
|
|
|
|
|
2020-07-13 20:13:31 +00:00
|
|
|
sk_sp<GrDirectContext> makeContext(const GrContextOptions& options) override {
|
|
|
|
return GrDirectContext::MakeMock(nullptr, options);
|
2017-07-25 14:05:01 +00:00
|
|
|
}
|
|
|
|
|
2017-07-06 20:40:18 +00:00
|
|
|
protected:
|
|
|
|
void teardown() override {}
|
2020-02-13 17:59:19 +00:00
|
|
|
void onPlatformMakeNotCurrent() const override {}
|
2017-07-06 20:40:18 +00:00
|
|
|
void onPlatformMakeCurrent() const override {}
|
2017-11-17 14:25:23 +00:00
|
|
|
std::function<void()> onPlatformGetAutoContextRestore() const override { return nullptr; }
|
2017-07-06 20:40:18 +00:00
|
|
|
|
|
|
|
private:
|
2020-09-03 02:42:33 +00:00
|
|
|
using INHERITED = sk_gpu_test::TestContext;
|
2017-07-06 20:40:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // anonymous namespace
|
|
|
|
|
|
|
|
namespace sk_gpu_test {
|
|
|
|
|
|
|
|
TestContext* CreateMockTestContext(TestContext*) { return new MockTestContext(); }
|
|
|
|
|
|
|
|
} // namespace sk_gpu_test
|
|
|
|
#endif
|