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
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/gpu/GrContext.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 {}
|
|
|
|
|
2018-10-12 13:31:11 +00:00
|
|
|
virtual 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 submit() override {}
|
|
|
|
void finish() override {}
|
|
|
|
|
2017-07-25 14:05:01 +00:00
|
|
|
sk_sp<GrContext> makeGrContext(const GrContextOptions& options) override {
|
|
|
|
return GrContext::MakeMock(nullptr, options);
|
|
|
|
}
|
|
|
|
|
2017-07-06 20:40:18 +00:00
|
|
|
protected:
|
|
|
|
void teardown() override {}
|
|
|
|
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
|
|
|
void onPlatformSwapBuffers() const override {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
typedef sk_gpu_test::TestContext INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // anonymous namespace
|
|
|
|
|
|
|
|
namespace sk_gpu_test {
|
|
|
|
|
|
|
|
TestContext* CreateMockTestContext(TestContext*) { return new MockTestContext(); }
|
|
|
|
|
|
|
|
} // namespace sk_gpu_test
|
|
|
|
#endif
|