22 auto str =
gl.GetString(
name);
26 return reinterpret_cast<const char*
>(str);
32 auto str =
gl.GetStringi(
name, index);
36 return reinterpret_cast<const char*
>(str);
44 return version.find(
"ANGLE") != std::string::npos;
72 std::istringstream istream;
74 std::vector<size_t> version_components;
75 for (std::string version_component;
76 std::getline(istream, version_component,
'.');) {
77 version_components.push_back(std::stoul(version_component));
86 sl_version_string_(
GetGLString(
gl, GL_SHADING_LANGUAGE_VERSION)) {
91 if (!gl_version.has_value()) {
95 gl_version_ = gl_version.value();
99 int extension_count = 0;
100 gl.GetIntegerv(GL_NUM_EXTENSIONS, &extension_count);
101 for (
auto i = 0;
i < extension_count;
i++) {
106 std::stringstream extensions_stream(
extensions);
107 std::string extension;
108 while (std::getline(extensions_stream, extension,
' ')) {
109 extensions_.insert(extension);
114 if (!sl_version.has_value()) {
118 sl_version_ = sl_version.value();
131 return "Unknown Renderer.";
134 std::vector<std::pair<std::string, std::string>> items;
136 items.emplace_back(std::make_pair(
"Vendor", vendor_));
137 items.emplace_back(std::make_pair(
"Renderer", renderer_));
138 items.emplace_back(std::make_pair(
"GL Version", gl_version_string_));
140 std::make_pair(
"Shading Language Version", sl_version_string_));
142 std::make_pair(
"Extensions",
std::to_string(extensions_.size())));
144 size_t max_width = 0u;
145 for (
const auto& item : items) {
146 max_width =
std::max(max_width, item.first.size());
150 stream <<
"OpenGL Renderer:" << std::endl;
151 for (
const auto& item : items) {
152 stream << std::setw(max_width + 1) << item.first <<
": " << item.second
156 const auto pad = std::string(max_width + 3,
' ');
157 for (
const auto& extension : extensions_) {
158 stream << pad << extension << std::endl;
177 return extensions_.find(
ext) != extensions_.end();
Version GetGlVersion() const
DescriptionGLES(const ProcTableGLES &gl)
std::string GetString() const
bool HasExtension(const std::string &ext) const
bool HasDebugExtension() const
Returns whether GLES includes the debug extension.
static float max(float r, float g, float b)
DEF_SWITCHES_START aot vmservice shared library name
static std::string GetGLString(const ProcTableGLES &gl, GLenum name)
static bool DetermineIfES(const std::string &version)
static bool DetermineIfANGLE(const std::string &version)
bool HasPrefix(const std::string &string, const std::string &prefix)
static std::optional< Version > DetermineVersion(std::string version)
std::string StripPrefix(const std::string &string, const std::string &to_strip)
static std::string GetGLStringi(const ProcTableGLES &gl, GLenum name, int index)
static SkString to_string(int n)
static std::optional< Version > FromVector(const std::vector< size_t > &version)
constexpr bool IsAtLeast(const Version &other) const