Loading opengl/libs/EGL/egl_display.cpp +12 −16 Original line number Original line Diff line number Diff line Loading @@ -178,25 +178,21 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) { mExtensionString.setTo(gBuiltinExtensionString); mExtensionString.setTo(gBuiltinExtensionString); char const* start = gExtensionString; char const* start = gExtensionString; char const* end; do { do { // find the space separating this extension for the next one // length of the extension name end = strchr(start, ' '); size_t len = strcspn(start, " "); if (end) { // length of the extension string const size_t len = end - start; if (len) { if (len) { // NOTE: we could avoid the copy if we had strnstr. // NOTE: we could avoid the copy if we had strnstr. const String8 ext(start, len); const String8 ext(start, len); if (findExtension(disp.queryString.extensions, ext.string(), if (findExtension(disp.queryString.extensions, ext.string(), len)) { len)) { mExtensionString.append(start, len+1); mExtensionString.append(ext + " "); } } // advance to the next extension name, skipping the space. start += len; start += (*start == ' ') ? 1 : 0; } } // process the next extension string, and skip the space. } while (*start != '\0'); start = end + 1; } } while (end); egl_cache_t::get()->initialize(this); egl_cache_t::get()->initialize(this); Loading Loading
opengl/libs/EGL/egl_display.cpp +12 −16 Original line number Original line Diff line number Diff line Loading @@ -178,25 +178,21 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) { mExtensionString.setTo(gBuiltinExtensionString); mExtensionString.setTo(gBuiltinExtensionString); char const* start = gExtensionString; char const* start = gExtensionString; char const* end; do { do { // find the space separating this extension for the next one // length of the extension name end = strchr(start, ' '); size_t len = strcspn(start, " "); if (end) { // length of the extension string const size_t len = end - start; if (len) { if (len) { // NOTE: we could avoid the copy if we had strnstr. // NOTE: we could avoid the copy if we had strnstr. const String8 ext(start, len); const String8 ext(start, len); if (findExtension(disp.queryString.extensions, ext.string(), if (findExtension(disp.queryString.extensions, ext.string(), len)) { len)) { mExtensionString.append(start, len+1); mExtensionString.append(ext + " "); } } // advance to the next extension name, skipping the space. start += len; start += (*start == ' ') ? 1 : 0; } } // process the next extension string, and skip the space. } while (*start != '\0'); start = end + 1; } } while (end); egl_cache_t::get()->initialize(this); egl_cache_t::get()->initialize(this); Loading