2 * Copyright 2022 Google LLC
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef skgpu_graphite_MtlSampler_DEFINED
9 #define skgpu_graphite_MtlSampler_DEFINED
11 #include "src/gpu/graphite/Sampler.h"
13 #include "include/core/SkRefCnt.h"
14 #include "include/core/SkTileMode.h"
15 #include "include/ports/SkCFObject.h"
17 #import <Metal/Metal.h>
19 struct SkSamplingOptions;
21 namespace skgpu::graphite {
25 class MtlSampler : public Sampler {
27 static sk_sp<MtlSampler> Make(const MtlGpu*,
28 const SkSamplingOptions& samplingOptions,
30 SkTileMode yTileMode);
32 ~MtlSampler() override {}
34 id<MTLSamplerState> mtlSamplerState() const { return fSamplerState.get(); }
37 MtlSampler(const MtlGpu* gpu,
38 sk_cfp<id<MTLSamplerState>>);
40 void freeGpuData() override;
42 sk_cfp<id<MTLSamplerState>> fSamplerState;
45 } // namepsace skgpu::graphite
47 #endif // skgpu_graphite_MtlSampler_DEFINED