1 | /* |
2 | * Copyright 2017 Google Inc. |
3 | * |
4 | * Use of this source code is governed by a BSD-style license that can be |
5 | * found in the LICENSE file. |
6 | */ |
7 | |
8 | #ifndef GrMtlTypes_DEFINED |
9 | #define GrMtlTypes_DEFINED |
10 | |
11 | #include "include/gpu/GrTypes.h" |
12 | #include "include/ports/SkCFObject.h" |
13 | |
14 | /** |
15 | * Declares typedefs for Metal types used in Ganesh cpp code |
16 | */ |
17 | typedef unsigned int GrMTLPixelFormat; |
18 | typedef const void* GrMTLHandle; |
19 | |
20 | /////////////////////////////////////////////////////////////////////////////// |
21 | |
22 | #ifdef SK_METAL |
23 | /** |
24 | * Types for interacting with Metal resources created externally to Skia. |
25 | * This is used by GrBackendObjects. |
26 | */ |
27 | struct GrMtlTextureInfo { |
28 | public: |
29 | GrMtlTextureInfo() {} |
30 | |
31 | sk_cf_obj<const void*> fTexture; |
32 | |
33 | bool operator==(const GrMtlTextureInfo& that) const { |
34 | return fTexture == that.fTexture; |
35 | } |
36 | }; |
37 | #endif |
38 | |
39 | #endif |
40 | |