• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2019 Google LLC
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 #include "src/gpu/mock/GrMockCaps.h"
9 
10 #if GR_TEST_UTILS
getTestingCombinations() const11 std::vector<GrCaps::TestFormatColorTypeCombination> GrMockCaps::getTestingCombinations() const {
12     // TODO: need to add compressed formats to this list
13     std::vector<GrCaps::TestFormatColorTypeCombination> combos = {
14         { GrColorType::kAlpha_8,         GrBackendFormat::MakeMock(GrColorType::kAlpha_8)        },
15         { GrColorType::kBGR_565,         GrBackendFormat::MakeMock(GrColorType::kBGR_565)        },
16         { GrColorType::kABGR_4444,       GrBackendFormat::MakeMock(GrColorType::kABGR_4444)      },
17         { GrColorType::kRGBA_8888,       GrBackendFormat::MakeMock(GrColorType::kRGBA_8888)      },
18         { GrColorType::kRGBA_8888_SRGB,  GrBackendFormat::MakeMock(GrColorType::kRGBA_8888_SRGB) },
19         { GrColorType::kRGB_888x,        GrBackendFormat::MakeMock(GrColorType::kRGB_888x)       },
20         { GrColorType::kRG_88,           GrBackendFormat::MakeMock(GrColorType::kRG_88)          },
21         { GrColorType::kBGRA_8888,       GrBackendFormat::MakeMock(GrColorType::kBGRA_8888)      },
22         { GrColorType::kRGBA_1010102,    GrBackendFormat::MakeMock(GrColorType::kRGBA_1010102)   },
23         { GrColorType::kGray_8,          GrBackendFormat::MakeMock(GrColorType::kGray_8)         },
24         { GrColorType::kAlpha_F16,       GrBackendFormat::MakeMock(GrColorType::kAlpha_F16)      },
25         { GrColorType::kRGBA_F16,        GrBackendFormat::MakeMock(GrColorType::kRGBA_F16)       },
26         { GrColorType::kRGBA_F16_Clamped,GrBackendFormat::MakeMock(GrColorType::kRGBA_F16_Clamped)},
27         { GrColorType::kRGBA_F32,        GrBackendFormat::MakeMock(GrColorType::kRGBA_F32)       },
28         { GrColorType::kR_16,            GrBackendFormat::MakeMock(GrColorType::kR_16)           },
29         { GrColorType::kRG_1616,         GrBackendFormat::MakeMock(GrColorType::kRG_1616)        },
30         { GrColorType::kRGBA_16161616,   GrBackendFormat::MakeMock(GrColorType::kRGBA_16161616)  },
31         { GrColorType::kRG_F16,          GrBackendFormat::MakeMock(GrColorType::kRG_F16)         },
32     };
33 
34 #ifdef SK_DEBUG
35     for (auto combo : combos) {
36         SkASSERT(this->onAreColorTypeAndFormatCompatible(combo.fColorType, combo.fFormat));
37     }
38 #endif
39 
40     return combos;
41 }
42 #endif
43