Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: gm/gmmain.cpp

Issue 12554012: Add config msaa4 to gm (not run by default) and make MSAA configs not run unless (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gmmain.cpp
===================================================================
--- gm/gmmain.cpp (revision 8217)
+++ gm/gmmain.cpp (working copy)
@@ -163,6 +163,7 @@
int fSampleCnt; // GPU backend only
ConfigFlags fFlags;
const char* fName;
+ bool fRunByDefault;
};
class BWTextDrawFilter : public SkDrawFilter {
@@ -984,33 +985,31 @@
kWrite_ConfigFlag;
static const ConfigData gRec[] = {
- { SkBitmap::kARGB_8888_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "8888" },
+ { SkBitmap::kARGB_8888_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "8888", true },
#if 0 // stop testing this (for now at least) since we want to remove support for it (soon please!!!)
- { SkBitmap::kARGB_4444_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "4444" },
+ { SkBitmap::kARGB_4444_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "4444", true },
#endif
- { SkBitmap::kRGB_565_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "565" },
-#if defined(SK_SCALAR_IS_FLOAT) && SK_SUPPORT_GPU
- { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GLContextType, 0, kRW_ConfigFlag, "gpu" },
-#ifndef SK_BUILD_FOR_ANDROID
- // currently we don't want to run MSAA tests on Android
- { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GLContextType, 16, kRW_ConfigFlag, "msaa16" },
-#endif
+ { SkBitmap::kRGB_565_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "565", true },
+#if SK_SUPPORT_GPU
+ { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GLContextType, 0, kRW_ConfigFlag, "gpu", true },
+ { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GLContextType, 16, kRW_ConfigFlag, "msaa16", true },
+ { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GLContextType, 4, kRW_ConfigFlag, "msaa4", false},
/* The debug context does not generate images */
- { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kDebug_GLContextType, 0, kNone_ConfigFlag, "debug" },
+ { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kDebug_GLContextType, 0, kNone_ConfigFlag, "debug", true },
#if SK_ANGLE
- { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kANGLE_GLContextType, 0, kRW_ConfigFlag, "angle" },
- { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kANGLE_GLContextType, 16, kRW_ConfigFlag, "anglemsaa16" },
+ { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kANGLE_GLContextType, 0, kRW_ConfigFlag, "angle" true },
+ { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kANGLE_GLContextType, 16, kRW_ConfigFlag, "anglemsaa16", true },
#endif // SK_ANGLE
#ifdef SK_MESA
- { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kMESA_GLContextType, 0, kRW_ConfigFlag, "mesa" },
+ { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kMESA_GLContextType, 0, kRW_ConfigFlag, "mesa", true },
#endif // SK_MESA
-#endif // defined(SK_SCALAR_IS_FLOAT) && SK_SUPPORT_GPU
+#endif // SK_SUPPORT_GPU
#ifdef SK_SUPPORT_XPS
/* At present we have no way of comparing XPS files (either natively or by converting to PNG). */
- { SkBitmap::kARGB_8888_Config, kXPS_Backend, kDontCare_GLContextType, 0, kWrite_ConfigFlag, "xps" },
+ { SkBitmap::kARGB_8888_Config, kXPS_Backend, kDontCare_GLContextType, 0, kWrite_ConfigFlag, "xps", true },
#endif // SK_SUPPORT_XPS
#ifdef SK_SUPPORT_PDF
- { SkBitmap::kARGB_8888_Config, kPDF_Backend, kDontCare_GLContextType, 0, kPDFConfigFlags, "pdf" },
+ { SkBitmap::kARGB_8888_Config, kPDF_Backend, kDontCare_GLContextType, 0, kPDFConfigFlags, "pdf", true },
#endif // SK_SUPPORT_PDF
};
@@ -1354,9 +1353,11 @@
}
if (!userConfig) {
- // if no config is specified by user, we add them all.
+ // if no config is specified by user, add the defaults
for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) {
- *configs.append() = i;
+ if (gRec[i].fRunByDefault) {
+ *configs.append() = i;
+ }
}
}
// now remove any explicitly excluded configs
@@ -1369,6 +1370,28 @@
}
}
+#if SK_SUPPORT_GPU
+ GrContextFactory* grFactory = new GrContextFactory;
+ for (int i = 0; i < configs.count(); ++i) {
+ int index = configs[i];
+ if (kGPU_Backend == gRec[index].fBackend) {
+ GrContext* ctx = grFactory->get(gRec[index].fGLContextType);
+ if (NULL == ctx) {
+ SkDebugf("GrContext could not be created for config %s. Config will be skipped.",
+ gRec[index].fName);
+ configs.remove(i);
+ --i;
+ }
+ if (gRec[index].fSampleCnt > ctx->getMaxSampleCount()) {
+ SkDebugf("Sample count (%d) of config %s is not supported. Config will be skipped.",
+ gRec[index].fSampleCnt, gRec[index].fName);
+ configs.remove(i);
+ --i;
+ }
+ }
+ }
+#endif
+
if (doVerbose) {
SkString str;
str.printf("%d configs:", configs.count());
@@ -1419,10 +1442,6 @@
int testsFailed = 0;
int testsMissingReferenceImages = 0;
-#if SK_SUPPORT_GPU
- GrContextFactory* grFactory = new GrContextFactory;
-#endif
-
int gmIndex = -1;
SkString moduloStr;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698