Bug 1339256 - Don't assert on unrecognized context reset strategy - r=daoshengmu draft
authorJeff Gilbert <jgilbert@mozilla.com>
Thu, 09 Mar 2017 15:03:31 -0800
changeset 496213 f343a81a732f7cf04e0a3ea0416bd696b7cf384b
parent 496212 3b5877718f5b8e623bc166e1fe26f43771be1881
child 548577 a5dfbb4d27b812f13d5e22cf278174e76ca1236c
push id48558
push userbmo:jgilbert@mozilla.com
push dateFri, 10 Mar 2017 00:02:25 +0000
reviewersdaoshengmu
bugs1339256
milestone55.0a1
Bug 1339256 - Don't assert on unrecognized context reset strategy - r=daoshengmu MozReview-Commit-ID: CITo6W0FLQS
gfx/gl/GLContext.cpp
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -1148,18 +1148,23 @@ GLContext::LoadMoreSymbols(const char* p
         const bool useCore = this->IsFeatureProvidedByCoreSymbols(feature);
         const auto list = useCore ? coreList : extList;
         return fnLoadForFeature(list, feature);
     };
 
     if (IsSupported(GLFeature::robustness)) {
         const auto resetStrategy = GetIntAs<GLuint>(LOCAL_GL_RESET_NOTIFICATION_STRATEGY);
         if (resetStrategy != LOCAL_GL_LOSE_CONTEXT_ON_RESET) {
-            MOZ_ASSERT(resetStrategy == LOCAL_GL_NO_RESET_NOTIFICATION);
-            NS_WARNING("Robustness supported, but not active!");
+            NS_WARNING("Robustness supported, strategy is not LOSE_CONTEXT_ON_RESET!");
+            if (ShouldSpew()) {
+                const bool isDisabled = (resetStrategy == LOCAL_GL_NO_RESET_NOTIFICATION);
+                printf_stderr("Strategy: %s (0x%04x)",
+                              (isDisabled ? "disabled" : "unrecognized"),
+                              resetStrategy);
+            }
             MarkUnsupported(GLFeature::robustness);
         }
     }
     if (IsSupported(GLFeature::robustness)) {
         const SymLoadStruct symbols[] = {
             { (PRFuncPtr*) &mSymbols.fGetGraphicsResetStatus, { "GetGraphicsResetStatus",
                                                                 "GetGraphicsResetStatusARB",
                                                                 "GetGraphicsResetStatusKHR",