[graphite] Address nits from https://review.skia.org/453796
Bug: skia:12466 Change-Id: Ibe9f09c3801ca22a9b390b0e7a7623a6b73da162 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453944 Auto-Submit: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
9b428d1d3f
commit
b6b6ecf04e
@ -17,7 +17,7 @@ namespace skgpu::mtl {
|
||||
class Caps final : public skgpu::Caps {
|
||||
public:
|
||||
Caps(const id<MTLDevice>);
|
||||
~Caps() final {}
|
||||
~Caps() override {}
|
||||
|
||||
private:
|
||||
void initGPUFamily(const id<MTLDevice>);
|
||||
@ -32,9 +32,9 @@ private:
|
||||
};
|
||||
bool isMac() const { return fGPUFamily == GPUFamily::kMac; }
|
||||
bool isApple()const { return fGPUFamily == GPUFamily::kApple; }
|
||||
bool getGPUFamily(id<MTLDevice> device, GPUFamily* gpuFamily, int* group) const;
|
||||
bool getGPUFamilyFromFeatureSet(id<MTLDevice> device, GPUFamily* gpuFamily,
|
||||
int* group) const;
|
||||
static bool GetGPUFamily(id<MTLDevice> device, GPUFamily* gpuFamily, int* group);
|
||||
static bool GetGPUFamilyFromFeatureSet(id<MTLDevice> device, GPUFamily* gpuFamily,
|
||||
int* group);
|
||||
|
||||
GPUFamily fGPUFamily;
|
||||
int fFamilyGroup;
|
||||
|
@ -23,9 +23,7 @@ Caps::Caps(const id<MTLDevice> device)
|
||||
}
|
||||
|
||||
// translates from older MTLFeatureSet interface to MTLGPUFamily interface
|
||||
bool Caps::getGPUFamilyFromFeatureSet(id<MTLDevice> device,
|
||||
GPUFamily* gpuFamily,
|
||||
int* group) const {
|
||||
bool Caps::GetGPUFamilyFromFeatureSet(id<MTLDevice> device, GPUFamily* gpuFamily, int* group) {
|
||||
#if defined(SK_BUILD_FOR_MAC)
|
||||
// Apple Silicon is only available in later OSes
|
||||
*gpuFamily = GPUFamily::kMac;
|
||||
@ -128,7 +126,7 @@ bool Caps::getGPUFamilyFromFeatureSet(id<MTLDevice> device,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Caps::getGPUFamily(id<MTLDevice> device, GPUFamily* gpuFamily, int* group) const {
|
||||
bool Caps::GetGPUFamily(id<MTLDevice> device, GPUFamily* gpuFamily, int* group) {
|
||||
#if GR_METAL_SDK_VERSION >= 220
|
||||
if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) {
|
||||
// Apple Silicon
|
||||
@ -195,8 +193,8 @@ bool Caps::getGPUFamily(id<MTLDevice> device, GPUFamily* gpuFamily, int* group)
|
||||
}
|
||||
|
||||
void Caps::initGPUFamily(id<MTLDevice> device) {
|
||||
if (!this->getGPUFamily(device, &fGPUFamily, &fFamilyGroup) &&
|
||||
!this->getGPUFamilyFromFeatureSet(device, &fGPUFamily, &fFamilyGroup)) {
|
||||
if (!GetGPUFamily(device, &fGPUFamily, &fFamilyGroup) &&
|
||||
!GetGPUFamilyFromFeatureSet(device, &fGPUFamily, &fFamilyGroup)) {
|
||||
// We don't know what this is, fall back to minimum defaults
|
||||
#ifdef SK_BUILD_FOR_MAC
|
||||
fGPUFamily = GPUFamily::kMac;
|
||||
|
Loading…
Reference in New Issue
Block a user