1055 {
1056 using namespace skgpu;
1057
1058 auto dContext = ctxInfo.directContext();
1059 size_t maxResourceBytes = dContext->getResourceCacheLimit();
1060 auto proxy = dContext->threadSafeProxy().get();
1061
1062 Protected isProtected =
Protected(dContext->priv().caps()->supportsProtectedContent());
1063
1064 auto check_create_fails = [proxy,
reporter, maxResourceBytes](
1069 bool willUseGLFBO0,
1070 bool isTextureable,
1072 bool vkRTSupportsInputAttachment,
1073 bool forVulkanSecondaryCommandBuffer) {
1075
1078
1080 proxy->createCharacterization(maxResourceBytes,
1081 ii,
1082 backendFormat,
1083 1,
1085 surfaceProps,
1086 Mipmapped::kNo,
1087 willUseGLFBO0,
1088 isTextureable,
1089 prot,
1090 vkRTSupportsInputAttachment,
1091 forVulkanSecondaryCommandBuffer);
1093 };
1094
1096 GrRenderable::kYes);
1098
1101
1104
1105 static const bool kIsTextureable = true;
1106 static const bool kIsNotTextureable = false;
1107
1108 static const bool kGoodUseFBO0 = false;
1109 static const bool kBadUseFBO0 = true;
1110
1111 static const bool kGoodVkInputAttachment = false;
1112 static const bool kBadVkInputAttachment = true;
1113
1114 static const bool kGoodForVkSCB = false;
1115 static const bool kBadForVkSCB = true;
1116
1117 int goodWidth = 64;
1118 int goodHeight = 64;
1119 int badWidths[] = { 0, 1048576 };
1120 int badHeights[] = { 0, 1048576 };
1121
1122
1123
1124
1125 check_create_fails(goodBackendFormat, goodWidth, badHeights[0], kGoodCT, kGoodUseFBO0,
1126 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1127 check_create_fails(goodBackendFormat, goodWidth, badHeights[1], kGoodCT, kGoodUseFBO0,
1128 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1129 check_create_fails(goodBackendFormat, badWidths[0], goodHeight, kGoodCT, kGoodUseFBO0,
1130 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1131 check_create_fails(goodBackendFormat, badWidths[1], goodHeight, kGoodCT, kGoodUseFBO0,
1132 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1133 check_create_fails(badBackendFormat, goodWidth, goodHeight, kGoodCT, kGoodUseFBO0,
1134 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1135 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kBadCT, kGoodUseFBO0,
1136 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1137
1138
1139 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kBadUseFBO0,
1140 kIsTextureable, isProtected, kGoodVkInputAttachment, kGoodForVkSCB);
1142
1143
1144 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kGoodUseFBO0,
1145 kIsTextureable, isProtected, kGoodVkInputAttachment, kBadForVkSCB);
1146
1147
1148 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kGoodUseFBO0,
1149 kIsNotTextureable, isProtected, kBadVkInputAttachment,
1150 kBadForVkSCB);
1151
1152
1153 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kBadUseFBO0,
1154 kIsNotTextureable, isProtected, kGoodVkInputAttachment,
1155 kBadForVkSCB);
1156 } else {
1157
1158 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kGoodUseFBO0,
1159 kIsTextureable, isProtected, kBadVkInputAttachment, kGoodForVkSCB);
1160 check_create_fails(goodBackendFormat, goodWidth, goodHeight, kGoodCT, kGoodUseFBO0,
1161 kIsNotTextureable, isProtected, kGoodVkInputAttachment,
1162 kBadForVkSCB);
1163 }
1164}
@ kBottomLeft_GrSurfaceOrigin
skgpu::Protected Protected
@ kUnknown_SkColorType
uninitialized