skia2/tools/gpu/mtl/MtlTestContext.h
Jim Van Verth 351c9b53d6 Switch to using GrMtlBackendContext for GrDirectContext creation.
Makes the Metal backend more consistent with the other backends,
and allows new init parameters to be added without significantly
changing API.

Added updated sk_cf_obj because I needed some of its functionality.

Bug: skia:10804
Change-Id: I6f1dd1c03ddc4c4b702ea75eff14bc0f98ab5ad2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334426
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-12 21:03:51 +00:00

46 lines
910 B
C++

/*
* 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
#include "tools/gpu/TestContext.h"
#ifdef SK_METAL
#include "include/gpu/mtl/GrMtlBackendContext.h"
namespace sk_gpu_test {
class MtlTestContext : public TestContext {
public:
GrBackendApi backend() override { return GrBackendApi::kMetal; }
const GrMtlBackendContext& getMtlBackendContext() const {
return fMtl;
}
protected:
MtlTestContext(const GrMtlBackendContext& mtl)
: fMtl(mtl) {}
GrMtlBackendContext fMtl;
private:
using INHERITED = TestContext;
};
/**
* Creates Metal context object bound to the native Metal library.
*/
MtlTestContext* CreatePlatformMtlTestContext(MtlTestContext*);
} // namespace sk_gpu_test
#endif
#endif /* MtlTestContext_h */