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
|
|
|
|
|
|
|
|
#include "MockTestContext.h"
|
|
|
|
|
2017-07-25 14:05:01 +00:00
|
|
|
#include "GrContext.h"
|
|
|
|
|
2017-07-06 20:40:18 +00:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
class MockTestContext : public sk_gpu_test::TestContext {
|
|
|
|
public:
|
|
|
|
MockTestContext() {}
|
|
|
|
~MockTestContext() override {}
|
|
|
|
|
|
|
|
virtual GrBackend backend() override { return kMock_GrBackend; }
|
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
|