In DM, do quick test to reject context by type first
authorBrian Osman <brianosman@google.com>
Mon, 5 Dec 2016 15:12:17 +0000 (10:12 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Mon, 5 Dec 2016 15:44:43 +0000 (15:44 +0000)
BUG=skia:

Change-Id: Id66a68e47f671cafd7c6128787fbd149faf16c7a
Reviewed-on: https://skia-review.googlesource.com/5576
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

dm/DM.cpp

index c3e3af4..0d39867 100644 (file)
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1423,11 +1423,7 @@ void RunWithGPUTestContexts(GrContextTestFn* test, GrContextTypeFilterFn* contex
 
     for (int typeInt = 0; typeInt < GrContextFactory::kContextTypeCnt; ++typeInt) {
         GrContextFactory::ContextType contextType = (GrContextFactory::ContextType) typeInt;
-        ContextInfo ctxInfo = factory->getContextInfo(contextType);
-        if (contextTypeFilter && !(*contextTypeFilter)(contextType)) {
-            continue;
-        }
-        // Use "native" instead of explicitly trying OpenGL and OpenGL ES. Do not use GLES on,
+        // Use "native" instead of explicitly trying OpenGL and OpenGL ES. Do not use GLES on
         // desktop since tests do not account for not fixing http://skbug.com/2809
         if (contextType == GrContextFactory::kGL_ContextType ||
             contextType == GrContextFactory::kGLES_ContextType) {
@@ -1435,6 +1431,10 @@ void RunWithGPUTestContexts(GrContextTestFn* test, GrContextTypeFilterFn* contex
                 continue;
             }
         }
+        ContextInfo ctxInfo = factory->getContextInfo(contextType);
+        if (contextTypeFilter && !(*contextTypeFilter)(contextType)) {
+            continue;
+        }
         if (ctxInfo.grContext()) {
             (*test)(reporter, ctxInfo);
         }