2019-07-18 15:43:45 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2019 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DawnTestContext_DEFINED
|
|
|
|
#define DawnTestContext_DEFINED
|
|
|
|
|
|
|
|
#include "tools/gpu/TestContext.h"
|
|
|
|
|
|
|
|
#ifdef SK_DAWN
|
|
|
|
|
|
|
|
namespace sk_gpu_test {
|
|
|
|
class DawnTestContext : public TestContext {
|
|
|
|
public:
|
|
|
|
virtual GrBackend backend() override { return GrBackendApi::kDawn; }
|
|
|
|
|
2019-10-30 13:56:23 +00:00
|
|
|
const wgpu::Device& getDevice() {
|
2019-07-18 15:43:45 +00:00
|
|
|
return fDevice;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2019-10-30 13:56:23 +00:00
|
|
|
DawnTestContext(const wgpu::Device& device) : fDevice(device) {}
|
2019-07-18 15:43:45 +00:00
|
|
|
|
2019-10-30 13:56:23 +00:00
|
|
|
wgpu::Device fDevice;
|
2019-07-18 15:43:45 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef TestContext INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates Dawn context object bound to the Dawn library.
|
|
|
|
*/
|
|
|
|
DawnTestContext* CreatePlatformDawnTestContext(DawnTestContext*);
|
|
|
|
|
|
|
|
} // namespace sk_gpu_test
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|