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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/ImageTest.cpp » ('j') | tests/SurfaceTest.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "DMJsonWriter.h" 9 #include "DMJsonWriter.h"
10 #include "DMSrcSink.h" 10 #include "DMSrcSink.h"
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 if (gPending > 0) { 1140 if (gPending > 0) {
1141 SkDebugf("Hrm, we didn't seem to run everything we intended to! Please file a bug.\n"); 1141 SkDebugf("Hrm, we didn't seem to run everything we intended to! Please file a bug.\n");
1142 return 1; 1142 return 1;
1143 } 1143 }
1144 #ifdef SK_PDF_IMAGE_STATS 1144 #ifdef SK_PDF_IMAGE_STATS
1145 SkPDFImageDumpStats(); 1145 SkPDFImageDumpStats();
1146 #endif // SK_PDF_IMAGE_STATS 1146 #endif // SK_PDF_IMAGE_STATS
1147 return 0; 1147 return 0;
1148 } 1148 }
1149 1149
1150 void skiatest::RunWithGPUTestContexts(void(*test)(skiatest::Reporter*, GrContext *),
1151 skiatest::GPUTestContexts testContexts,
1152 skiatest::Reporter* reporter,
1153 GrContextFactory* factory) {
1154 #if SK_SUPPORT_GPU
1155 for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) {
1156 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext Type) i;
1157 int contextSelector = skiatest::kNone_GPUTestContexts;
1158 if (GrContextFactory::IsRenderingGLContext(glCtxType)) {
1159 contextSelector |= kAllRendering_GPUTestContexts;
1160 }
1161 if (glCtxType == GrContextFactory::kNative_GLContextType) {
1162 contextSelector |= kNative_GPUTestContexts;
1163 }
1164 if (glCtxType == GrContextFactory::kNull_GLContextType) {
1165 contextSelector |= kNull_GPUTestContexts;
1166 }
1167 if ((testContexts & contextSelector) == 0) {
1168 continue;
1169 }
1170 if (GrContext* context = factory->get(glCtxType)) {
1171 test(reporter, context);
bsalomon 2015/11/17 14:49:36 I'm in the process of adding tests that would want
1172 }
1173 }
1174 #endif
1175 }
1176
1177
1150 #if !defined(SK_BUILD_FOR_IOS) 1178 #if !defined(SK_BUILD_FOR_IOS)
1151 int main(int argc, char** argv) { 1179 int main(int argc, char** argv) {
1152 SkCommandLineFlags::Parse(argc, argv); 1180 SkCommandLineFlags::Parse(argc, argv);
1153 return dm_main(); 1181 return dm_main();
1154 } 1182 }
1155 #endif 1183 #endif
OLDNEW
« 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