Don't sort extensions when there are none. Make an ANGLE context to validate the ANGLE GrGLInterface with.
R=robertphillips@google.com
git-svn-id: http://skia.googlecode.com/svn/trunk@8049 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLExtensions.cpp b/src/gpu/gl/GrGLExtensions.cpp
index a28636b..32bf963 100644
--- a/src/gpu/gl/GrGLExtensions.cpp
+++ b/src/gpu/gl/GrGLExtensions.cpp
@@ -48,7 +48,7 @@
}
} else {
const char* extensions = (const char*) getString(GR_GL_EXTENSIONS);
- if (NULL == extensions) {
+ if (NULL == extensions) {
return false;
}
while (true) {
@@ -66,8 +66,10 @@
extensions += length;
}
}
- SkTSearchCompareLTFunctor<SkString, extension_compare> cmp;
- SkTQSort(&fStrings.front(), &fStrings.back(), cmp);
+ if (0 != fStrings.count()) {
+ SkTSearchCompareLTFunctor<SkString, extension_compare> cmp;
+ SkTQSort(&fStrings.front(), &fStrings.back(), cmp);
+ }
return true;
}