1 /* 2 * Copyright 2022 Google LLC 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef skgpu_graphite_DawnSampler_DEFINED 9 #define skgpu_graphite_DawnSampler_DEFINED 10 11 #include "src/gpu/graphite/Sampler.h" 12 13 #include "include/core/SkTileMode.h" 14 #include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE 15 16 struct SkSamplingOptions; 17 18 namespace skgpu::graphite { 19 20 class DawnSharedContext; 21 22 class DawnSampler : public Sampler { 23 public: 24 static sk_sp<DawnSampler> Make(const DawnSharedContext*, const SamplerDesc&); 25 ~DawnSampler()26 ~DawnSampler() override {} 27 dawnSampler()28 const wgpu::Sampler& dawnSampler() const { return fSampler; } 29 30 private: 31 DawnSampler(const DawnSharedContext* sharedContext, wgpu::Sampler sampler); 32 33 void freeGpuData() override; 34 35 wgpu::Sampler fSampler; 36 }; 37 38 } // namepsace skgpu::graphite 39 40 #endif // skgpu_graphite_DawnSampler_DEFINED 41