33 SkDebugf(
"nullptr GL version string.");
40 int n = sscanf(versionString,
"%d.%d", &major, &minor);
47 n = sscanf(versionString,
"OpenGL ES %d.%d (WebGL %d.%d", &esMajor, &esMinor, &major, &minor);
54 n = sscanf(versionString,
"OpenGL ES-%c%c %d.%d",
profile,
profile+1, &major, &minor);
61 n = sscanf(versionString,
"OpenGL ES %d.%d", &major, &minor);
70 SkDebugf(
"nullptr GL version string.");
77 int mesaMajor, mesaMinor;
78 int n = sscanf(versionString,
"%d.%d Mesa %d.%d", &major, &minor, &mesaMajor, &mesaMinor);
83 n = sscanf(versionString,
"%d.%d", &major, &minor);
90 n = sscanf(versionString,
"OpenGL ES %d.%d (WebGL %d.%d", &esMajor, &esMinor, &major, &minor);
96 n = sscanf(versionString,
"OpenGL ES-%c%c %d.%d",
profile,
profile + 1, &major, &minor);
101 n = sscanf(versionString,
"OpenGL ES %d.%d", &major, &minor);
120 int n = sscanf(versionString,
"%d.%d", &major, &minor);
125 n = sscanf(versionString,
"OpenGL ES GLSL ES %d.%d", &major, &minor);
130#ifdef SK_BUILD_FOR_ANDROID
132 n = sscanf(versionString,
"OpenGL ES GLSL %d.%d", &major, &minor);
143 if (0 == strcmp(vendorString,
"ARM")) {
146 if (0 == strcmp(vendorString,
"Google Inc.")) {
149 if (0 == strcmp(vendorString,
"Imagination Technologies")) {
152 if (0 == strncmp(vendorString,
"Intel ", 6) || 0 == strcmp(vendorString,
"Intel")) {
155 if (0 == strcmp(vendorString,
"Qualcomm") || 0 == strcmp(vendorString,
"freedreno")) {
158 if (0 == strcmp(vendorString,
"NVIDIA Corporation")) {
161 if (0 == strcmp(vendorString,
"ATI Technologies Inc.")) {
164 if (0 == strcmp(vendorString,
"Apple")) {
172 static const char kTegraStr[] =
"NVIDIA Tegra";
173 if (0 == strncmp(rendererString, kTegraStr,
std::size(kTegraStr) - 1)) {
180 int n = sscanf(rendererString,
"PowerVR SGX 54%d", &lastDigit);
181 if (1 == n && lastDigit >= 0 && lastDigit <= 9) {
184 if (strstr(rendererString,
"PowerVR B-Series")) {
188 static const char kAppleA4Str[] =
"Apple A4";
189 static const char kAppleA5Str[] =
"Apple A5";
190 static const char kAppleA6Str[] =
"Apple A6";
191 if (0 == strncmp(rendererString, kAppleA4Str,
std::size(kAppleA4Str) - 1) ||
192 0 == strncmp(rendererString, kAppleA5Str,
std::size(kAppleA5Str) - 1) ||
193 0 == strncmp(rendererString, kAppleA6Str,
std::size(kAppleA6Str) - 1)) {
196 static const char kPowerVRRogueStr[] =
"PowerVR Rogue";
197 static const char kAppleA7Str[] =
"Apple A7";
198 static const char kAppleA8Str[] =
"Apple A8";
199 if (0 == strncmp(rendererString, kPowerVRRogueStr,
std::size(kPowerVRRogueStr) - 1) ||
200 0 == strncmp(rendererString, kAppleA7Str,
std::size(kAppleA7Str) - 1) ||
201 0 == strncmp(rendererString, kAppleA8Str,
std::size(kAppleA8Str) - 1)) {
205 n = sscanf(rendererString,
"Adreno (TM) %d", &adrenoNumber);
208 n = sscanf(rendererString,
"FD%d", &adrenoNumber);
211 if (adrenoNumber >= 300) {
212 if (adrenoNumber < 400) {
215 if (adrenoNumber < 500) {
219 if (adrenoNumber < 600) {
223 if (adrenoNumber < 700) {
224 if (adrenoNumber == 615) {
227 if (adrenoNumber == 620) {
230 if (adrenoNumber == 630) {
233 if (adrenoNumber == 640) {
241 if (
const char* intelString = strstr(rendererString,
"Intel")) {
243 if (0 == strcmp(
"Intel Iris OpenGL Engine", intelString) ||
244 0 == strcmp(
"Intel Iris Pro OpenGL Engine", intelString)) {
247 if (strstr(intelString,
"Sandybridge")) {
250 if (strstr(intelString,
"Bay Trail")) {
256 if (strstr(intelString,
"RKL")) {
259 if (strstr(intelString,
"TGL")) {
263 if (strstr(intelString,
"ADL") || strstr(intelString,
"AlderLake")) {
269 if (strstr(intelString,
"Xe")) {
280 if (
const char* intelGfxString = strstr(intelString,
"Graphics")) {
282 if (sscanf(intelGfxString,
"Graphics %d", &intelNumber) ||
283 sscanf(intelGfxString,
"Graphics P%d", &intelNumber)) {
284 if (intelNumber == 2000 || intelNumber == 3000) {
287 if (intelNumber == 2500 || intelNumber == 4000) {
290 if (intelNumber >= 4200 && intelNumber <= 5200) {
293 if (intelNumber >= 400 && intelNumber <= 405) {
296 if (intelNumber >= 5300 && intelNumber <= 6300) {
299 if (intelNumber >= 500 && intelNumber <= 505) {
302 if (intelNumber >= 510 && intelNumber <= 580) {
305 if (intelNumber >= 600 && intelNumber <= 605) {
310 if (intelNumber == 610 || intelNumber == 630) {
314 if (intelNumber >= 610 && intelNumber <= 650) {
317 if (intelNumber == 655) {
322 if (intelNumber >= 710 && intelNumber <= 770) {
325 if (intelNumber >= 910 && intelNumber <= 950) {
333 static constexpr char kRadeonStr[] =
"Radeon ";
334 if (
const char* amdString = strstr(rendererString, kRadeonStr)) {
335 amdString += strlen(kRadeonStr);
337 static constexpr char kTMStr[] =
"(TM) ";
338 if (!strncmp(amdString, kTMStr, strlen(kTMStr))) {
339 amdString += strlen(kTMStr);
342 char amd0, amd1, amd2;
344 n = sscanf(amdString,
"R9 M3%c%c", &amd0, &amd1);
345 if (2 == n && isdigit(amd0) && isdigit(amd1)) {
349 n = sscanf(amdString,
"R9 M4%c%c", &amd0, &amd1);
350 if (2 == n && isdigit(amd0) && isdigit(amd1)) {
354 n = sscanf(amdString,
"HD 7%c%c%c Series", &amd0, &amd1, &amd2);
355 if (3 == n && isdigit(amd0) && isdigit(amd1) && isdigit(amd2)) {
359 n = sscanf(amdString,
"Pro 5%c%c%c", &amd0, &amd1, &amd2);
360 if (3 == n && isdigit(amd0) && isdigit(amd1) && isdigit(amd2)) {
364 n = sscanf(amdString,
"Pro Vega %i", &amdModel);
370 if (strstr(rendererString,
"llvmpipe")) {
373 static const char kMaliGStr[] =
"Mali-G";
374 if (0 == strncmp(rendererString, kMaliGStr,
std::size(kMaliGStr) - 1)) {
377 static const char kMaliTStr[] =
"Mali-T";
378 if (0 == strncmp(rendererString, kMaliTStr,
std::size(kMaliTStr) - 1)) {
382 if (1 == sscanf(rendererString,
"Mali-%d", &mali400Num) && mali400Num >= 400 &&
387 static const char kAppleStr[] =
"Apple";
388 if (0 == strncmp(rendererString, kAppleStr,
std::size(kAppleStr) - 1)) {
392 if (strstr(rendererString,
"WebGL")) {
404 static const char kChromium[] =
"Chromium";
406 return (0 == strcmp(rendererString, kChromium) ||
407 (3 == sscanf(versionString,
"OpenGL ES %d.%d %8s", &major, &minor,
suffix) &&
408 0 == strcmp(kChromium,
suffix)));
412 return !!strstr(rendererString,
"virgl");
417 const char* vendorString,
418 const char* rendererString,
419 const char* versionString) {
426 int major, minor, rev, driverMajor, driverMinor, driverPoint;
428 if (!strcmp(vendorString,
"freedreno")) {
433 int n = sscanf(versionString,
434 "%d.%d.%d NVIDIA %d.%d",
445 int n = sscanf(versionString,
452 n = sscanf(versionString,
453 "%d.%d (Core Profile) Mesa %d.%d",
467 int n = sscanf(versionString,
468 "OpenGL ES %d.%d NVIDIA %d.%d",
479 int n = sscanf(versionString,
480 "OpenGL ES %d.%d build %d.%d@%d",
491 int n = sscanf(versionString,
492 "OpenGL ES %d.%d Mesa %d.%d",
512 int n = sscanf(versionString,
513 "%d.%d INTEL-%d.%d.%d",
524 int n = sscanf(versionString,
525 "OpenGL ES %d.%d V@%d.%d",
535 int n = sscanf(versionString,
536 "OpenGL ES %d.%d build %d.%d@%d",
554 int n = sscanf(versionString,
555 "OpenGL ES %d.%d v%d.r%dp%d-%drel",
568 int n = sscanf(versionString,
578 static constexpr char kEmulatorPrefix[] =
"Android Emulator OpenGL ES Translator";
579 if (0 == strncmp(kEmulatorPrefix, rendererString, strlen(kEmulatorPrefix))) {
584 return {driver, driverVersion};
592 static constexpr char kHeader[] =
"ANGLE (";
593 static constexpr size_t kHeaderLength =
std::size(kHeader) - 1;
594 int rendererLength = strlen(rendererString);
595 if (!strncmp(rendererString, kHeader, kHeaderLength) &&
596 rendererString[rendererLength - 1] ==
')') {
598 innerString.
set(rendererString + kHeaderLength, rendererLength - kHeaderLength - 1);
599 if (strstr(rendererString,
"Direct3D11")) {
601 }
else if (strstr(rendererString,
"Direct3D9")) {
603 }
else if (strstr(rendererString,
"Metal")) {
605 }
else if (strstr(rendererString,
"OpenGL")) {
612static std::tuple<GrGLVendor, GrGLRenderer, GrGLDriver, GrGLDriverVersion>
614 const char* innerString,
619 if (
parts.size() != 3) {
626 const char* angleVendorString =
parts[0].c_str();
627 const char* angleRendererString =
parts[1].c_str() + 1;
628 const char* angleVersionString =
parts[2].c_str() + 1;
640 return {angleVendor, angleRenderer, angleDriver, angleDriverVersion};
643static std::tuple<GrGLVendor, GrGLRenderer, GrGLDriver, GrGLDriverVersion>
648 if (strstr(innerString,
"Intel")) {
651 const char* modelStr;
653 if ((modelStr = strstr(innerString,
"HD Graphics")) &&
654 (1 == sscanf(modelStr,
"HD Graphics %i", &modelNumber) ||
655 1 == sscanf(modelStr,
"HD Graphics P%i", &modelNumber))) {
656 switch (modelNumber) {
672 }
else if ((modelStr = strstr(innerString,
"Iris")) &&
673 (1 == sscanf(modelStr,
"Iris(TM) Graphics %i", &modelNumber) ||
674 1 == sscanf(modelStr,
"Iris(TM) Pro Graphics %i", &modelNumber) ||
675 1 == sscanf(modelStr,
"Iris(TM) Pro Graphics P%i", &modelNumber))) {
676 switch (modelNumber) {
685 }
else if (strstr(innerString,
"NVIDIA")) {
687 }
else if (strstr(innerString,
"Radeon")) {
694static std::tuple<GrGLVendor, GrGLRenderer>
707 return reinterpret_cast<const char*
>(bytes);
720 return {webglVendor, webglRenderer};
736 return reinterpret_cast<const char*
>(bytes);
760 std::tie(
info.fANGLEVendor,
763 info.fANGLEDriverVersion) =
766 std::tie(
info.fANGLEVendor,
769 info.fANGLEDriverVersion) =
775 std::tie(
info.fWebGLVendor,
776 info.fWebGLRenderer) =
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
#define GR_GL_CHECK_ERROR_START
#define GR_GL_LOG_CALLS_START
#define GR_UNMASKED_RENDERER_WEBGL
#define GR_UNMASKED_VENDOR_WEBGL
#define GR_GL_SHADING_LANGUAGE_VERSION
#define GR_IS_GR_GL(standard)
GrGLVersion GrGLGetVersion(const GrGLInterface *gl)
static std::tuple< GrGLDriver, GrGLDriverVersion > get_driver_and_version(GrGLStandard standard, GrGLVendor vendor, const char *vendorString, const char *rendererString, const char *versionString)
bool GrGLFormatIsCompressed(GrGLFormat format)
GrGLVersion GrGLGetVersionFromString(const char *versionString)
static std::tuple< GrGLVendor, GrGLRenderer, GrGLDriver, GrGLDriverVersion > get_angle_gl_vendor_and_renderer(const char *innerString, const GrGLExtensions &extensions)
GrGLenum GrToGLStencilFunc(GrStencilTest test)
static std::tuple< GrGLVendor, GrGLRenderer > get_webgl_vendor_and_renderer(const GrGLInterface *interface)
static std::tuple< GrGLANGLEBackend, SkString > get_angle_backend(const char *rendererString)
static bool is_virgl(const char *rendererString)
GrGLStandard GrGLGetStandardInUseFromString(const char *versionString)
static GrGLRenderer get_renderer(const char *rendererString, const GrGLExtensions &extensions)
static bool is_commamd_buffer(const char *rendererString, const char *versionString)
static std::tuple< GrGLVendor, GrGLRenderer, GrGLDriver, GrGLDriverVersion > get_angle_d3d_vendor_and_renderer(const char *innerString)
static GrGLSLVersion get_glsl_version(const char *versionString)
static GrGLVendor get_vendor(const char *vendorString)
GrGLDriverInfo GrGLGetDriverInfo(const GrGLInterface *interface)
#define GR_GL_DRIVER_UNKNOWN_VER
#define GR_GL_INVALID_VER
#define GR_GL_VER(major, minor)
#define GR_GLSL_INVALID_VER
uint64_t GrGLDriverVersion
#define GR_GLSL_VER(major, minor)
#define GR_GL_DRIVER_VER(major, minor, point)
#define GR_GL_CALL_RET(IFACE, RET, X)
static constexpr int kGrStencilTestCount
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
void SkStrSplit(const char *str, const char *delimiters, SkStrSplitMode splitMode, TArray< SkString > *out)
bool has(const char[]) const
void set(const SkString &src)
const char * c_str() const
uint32_t uint32_t * format
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
GrGLFunction< GrGLGetStringFn > fGetString
struct GrGLInterface::Functions fFunctions
GrGLExtensions fExtensions