1051 {
1052 using namespace skgpu;
1053
1054 auto dContext = ctxInfo.directContext();
1055 size_t maxResourceBytes = dContext->getResourceCacheLimit();
1056 auto proxy = dContext->threadSafeProxy().get();
1057
1058 Protected isProtected =
Protected(dContext->priv().caps()->supportsProtectedContent());
1059
1060 auto check_create_fails = [proxy,
reporter, maxResourceBytes](
1065 bool willUseGLFBO0,
1066 bool isTextureable,
1068 bool vkRTSupportsInputAttachment,
1069 bool forVulkanSecondaryCommandBuffer) {
1071
1074
1076 proxy->createCharacterization(maxResourceBytes,
1077 ii,
1078 backendFormat,
1079 1,
1081 surfaceProps,
1083 willUseGLFBO0,
1084 isTextureable,
1085 prot,
1086 vkRTSupportsInputAttachment,
1087 forVulkanSecondaryCommandBuffer);
1089 };
1090
1094
1097
1100
1101 static const bool kIsTextureable = true;
1102 static const bool kIsNotTextureable = false;
1103
1104 static const bool kGoodUseFBO0 = false;
1105 static const bool kBadUseFBO0 = true;
1106
1107 static const bool kGoodVkInputAttachment = false;
1108 static const bool kBadVkInputAttachment = true;
1109
1110 static const bool kGoodForVkSCB = false;
1111 static const bool kBadForVkSCB = true;
1112
1113 int goodWidth = 64;
1114 int goodHeight = 64;
1115 int badWidths[] = { 0, 1048576 };
1116 int badHeights[] = { 0, 1048576 };
1117
1118
1119
1120
1121 check_create_fails(goodBackendFormat, goodWidth, badHeights[0], kGoodCT, kGoodUseFBO0,
1122 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1123 check_create_fails(goodBackendFormat, goodWidth, badHeights[1], kGoodCT, kGoodUseFBO0,
1124 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1125 check_create_fails(goodBackendFormat, badWidths[0], goodHeight, kGoodCT, kGoodUseFBO0,
1126 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1127 check_create_fails(goodBackendFormat, badWidths[1], goodHeight, kGoodCT, kGoodUseFBO0,
1128 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1129 check_create_fails(badBackendFormat, goodWidth, goodHeight, kGoodCT, kGoodUseFBO0,
1130 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1131 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kBadCT, kGoodUseFBO0,
1132 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1133
1134
1135 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kBadUseFBO0,
1136 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1138
1139
1140 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kGoodUseFBO0,
1141 kIsTextureable, isProtected, kGoodVkInputAttachment, kBadForVkSCB);
1142
1143
1144 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kGoodUseFBO0,
1145 kIsNotTextureable, isProtected, kBadVkInputAttachment,
1146 kBadForVkSCB);
1147
1148
1149 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kBadUseFBO0,
1150 kIsNotTextureable, isProtected, kGoodVkInputAttachment,
1151 kBadForVkSCB);
1152 } else {
1153
1154 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kGoodUseFBO0,
1155 kIsTextureable, isProtected, kBadVkInputAttachment, kGoodForVkSCB);
1156 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kGoodUseFBO0,
1157 kIsNotTextureable, isProtected, kGoodVkInputAttachment,
1158 kBadForVkSCB);
1159 }
1160}
@ kBottomLeft_GrSurfaceOrigin
skgpu::Protected Protected
@ kUnknown_SkColorType
uninitialized