Commit 510c81be authored by Robert Sesek's avatar Robert Sesek Committed by Chromium LUCI CQ

mac: Remove code to support OS X 10.10 in //components/metal_util

Bug: 1153883
Change-Id: Ieb2ee69ba93e0469cbe307dfb1f12687a0a1a702
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2572379
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833778}
parent 79872ef1
......@@ -12,28 +12,23 @@
namespace metal {
MTLDevicePtr CreateDefaultDevice() {
if (@available(macOS 10.11, *)) {
// First attempt to find a low power device to use.
base::scoped_nsprotocol<id<MTLDevice>> device_to_use;
base::scoped_nsobject<NSArray<id<MTLDevice>>> devices(MTLCopyAllDevices());
for (id<MTLDevice> device in devices.get()) {
if ([device isLowPower]) {
device_to_use.reset(device, base::scoped_policy::RETAIN);
break;
}
// First attempt to find a low power device to use.
base::scoped_nsprotocol<id<MTLDevice>> device_to_use;
base::scoped_nsobject<NSArray<id<MTLDevice>>> devices(MTLCopyAllDevices());
for (id<MTLDevice> device in devices.get()) {
if ([device isLowPower]) {
device_to_use.reset(device, base::scoped_policy::RETAIN);
break;
}
// Failing that, use the system default device.
if (!device_to_use)
device_to_use.reset(MTLCreateSystemDefaultDevice());
if (!device_to_use) {
DLOG(ERROR) << "Failed to find MTLDevice.";
return nullptr;
}
return device_to_use.release();
}
// If no device was found, or if the macOS version is too old for Metal,
// return no context provider.
return nullptr;
// Failing that, use the system default device.
if (!device_to_use)
device_to_use.reset(MTLCreateSystemDefaultDevice());
if (!device_to_use) {
DLOG(ERROR) << "Failed to find MTLDevice.";
return nullptr;
}
return device_to_use.release();
}
} // namespace metal
......@@ -697,8 +697,7 @@ base::ScopedDispatchObject<dispatch_data_t> GetLibraryData() {
}
// State shared between the compiler callback and the caller.
class API_AVAILABLE(macos(10.11)) TestShaderState
: public base::RefCountedThreadSafe<TestShaderState> {
class TestShaderState : public base::RefCountedThreadSafe<TestShaderState> {
public:
TestShaderState(TestShaderCallback callback,
TestShaderComponent component,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment