2017-07-13 19:07:54 +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 MtlTestContext_h
|
|
|
|
#define MtlTestContext_h
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "tools/gpu/TestContext.h"
|
2017-07-13 19:07:54 +00:00
|
|
|
|
|
|
|
#ifdef SK_METAL
|
|
|
|
|
2020-11-12 20:21:11 +00:00
|
|
|
#include "include/gpu/mtl/GrMtlBackendContext.h"
|
|
|
|
|
2017-07-13 19:07:54 +00:00
|
|
|
namespace sk_gpu_test {
|
2019-03-15 19:22:39 +00:00
|
|
|
class MtlTestContext : public TestContext {
|
|
|
|
public:
|
|
|
|
GrBackendApi backend() override { return GrBackendApi::kMetal; }
|
|
|
|
|
2020-11-12 20:21:11 +00:00
|
|
|
const GrMtlBackendContext& getMtlBackendContext() const {
|
|
|
|
return fMtl;
|
|
|
|
}
|
|
|
|
|
2019-03-15 19:22:39 +00:00
|
|
|
protected:
|
2020-11-12 20:21:11 +00:00
|
|
|
MtlTestContext(const GrMtlBackendContext& mtl)
|
|
|
|
: fMtl(mtl) {}
|
|
|
|
|
|
|
|
GrMtlBackendContext fMtl;
|
2019-03-15 19:22:39 +00:00
|
|
|
|
|
|
|
private:
|
2020-09-03 02:42:33 +00:00
|
|
|
using INHERITED = TestContext;
|
2019-03-15 19:22:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates Metal context object bound to the native Metal library.
|
|
|
|
*/
|
|
|
|
MtlTestContext* CreatePlatformMtlTestContext(MtlTestContext*);
|
|
|
|
|
2017-07-13 19:07:54 +00:00
|
|
|
} // namespace sk_gpu_test
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* MtlTestContext_h */
|