Hide use of TargetConditionals.h behind platform def

It's possible to enable SK_METAL on non-Apple platforms which will lead
to compile issues. This will prevent that. Also includes a minor change
to keep the decl of GrMtlTextureInfo consistent with other uses.

Change-Id: I48ae89b53c3ea8b50ee78383c5a81fdd09e9e3e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388038
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
Jim Van Verth 2021-03-22 16:08:31 -04:00 committed by Skia Commit-Bot
parent 1b843bdcb7
commit 45564260d4

View File

@ -19,7 +19,7 @@ typedef const void* GrMTLHandle;
///////////////////////////////////////////////////////////////////////////////
#ifdef SK_METAL
#ifdef __APPLE__
#include <TargetConditionals.h>
@ -59,7 +59,7 @@ struct GrMtlTextureInfo {
public:
GrMtlTextureInfo() {}
sk_cfp<const void*> fTexture;
sk_cfp<GrMTLHandle> fTexture;
bool operator==(const GrMtlTextureInfo& that) const {
return fTexture == that.fTexture;