351c9b53d6
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>
46 lines
910 B
C++
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 */
|