Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
GrMtlSampler.mm File Reference
#include "src/gpu/ganesh/mtl/GrMtlSampler.h"
#include "src/gpu/ganesh/mtl/GrMtlGpu.h"

Go to the source code of this file.

Functions

static GR_NORETAIN_BEGIN MTLSamplerAddressMode wrap_mode_to_mtl_sampler_address (GrSamplerState::WrapMode wrapMode, const GrCaps &caps)
 

Function Documentation

◆ wrap_mode_to_mtl_sampler_address()

static GR_NORETAIN_BEGIN MTLSamplerAddressMode wrap_mode_to_mtl_sampler_address ( GrSamplerState::WrapMode  wrapMode,
const GrCaps caps 
)
inlinestatic

Definition at line 18 of file GrMtlSampler.mm.

19 {
20 switch (wrapMode) {
22 return MTLSamplerAddressModeClampToEdge;
24 return MTLSamplerAddressModeRepeat;
26 return MTLSamplerAddressModeMirrorRepeat;
28 // Must guard the reference to the clamp to border address mode by macro since iOS or
29 // older MacOS builds will fail if it's referenced, even if other code makes sure it's
30 // never used.
31#ifdef SK_BUILD_FOR_MAC
32 if (@available(macOS 10.12, *)) {
34 return MTLSamplerAddressModeClampToBorderColor;
35 } else
36#endif
37 {
38 SkASSERT(false);
39 return MTLSamplerAddressModeClampToEdge;
40 }
41 }
42 SK_ABORT("Unknown wrap mode.");
43}
#define SK_ABORT(message,...)
Definition SkAssert.h:70
#define SkASSERT(cond)
Definition SkAssert.h:116
bool clampToBorderSupport() const
Definition GrCaps.h:484