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

Unified Diff: dm/DM.cpp

Issue 1446453003: Generate list of GPU contexts outside SurfaceTest tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove ImageTest modifications Created 5 years, 1 month 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 | tests/ImageTest.cpp » ('j') | tests/SurfaceTest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index fb9699c049478d1a052fb269dedcdd73a8af77bc..c191ac9c2ed895aa4b0364f3b0c7a7a0bd88e712 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1147,6 +1147,34 @@ int dm_main() {
return 0;
}
+void skiatest::RunWithGPUTestContexts(void(*test)(skiatest::Reporter*, GrContext*),
+ skiatest::GPUTestContexts testContexts,
+ skiatest::Reporter* reporter,
+ GrContextFactory* factory) {
+#if SK_SUPPORT_GPU
+ for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) {
+ GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContextType) i;
+ int contextSelector = skiatest::kNone_GPUTestContexts;
+ if (GrContextFactory::IsRenderingGLContext(glCtxType)) {
+ contextSelector |= kAllRendering_GPUTestContexts;
+ }
+ if (glCtxType == GrContextFactory::kNative_GLContextType) {
+ contextSelector |= kNative_GPUTestContexts;
+ }
+ if (glCtxType == GrContextFactory::kNull_GLContextType) {
+ contextSelector |= kNull_GPUTestContexts;
+ }
+ if ((testContexts & contextSelector) == 0) {
+ continue;
+ }
+ if (GrContext* context = factory->get(glCtxType)) {
+ test(reporter, context);
bsalomon 2015/11/17 14:49:36 I'm in the process of adding tests that would want
+ }
+ }
+#endif
+}
+
+
#if !defined(SK_BUILD_FOR_IOS)
int main(int argc, char** argv) {
SkCommandLineFlags::Parse(argc, argv);
« no previous file with comments | « no previous file | tests/ImageTest.cpp » ('j') | tests/SurfaceTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698