aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/gmmain.cpp
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-04 14:57:00 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-04 14:57:00 +0000
commitac8f3a4f133d059c74ea20c106b963235ee6e48e (patch)
treeb14167058d5f3316085a2dd4563c3178cb9c6272 /gm/gmmain.cpp
parent2dcf36e25186bb0396eaa692bda402993252b88a (diff)
Add GM option to allow the GPU context to be reset prior to each GM being run
BUG=skia:1434 R=bsalomon@google.com Review URL: https://codereview.chromium.org/26010002 git-svn-id: http://skia.googlecode.com/svn/trunk@11605 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/gmmain.cpp')
-rw-r--r--gm/gmmain.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index defd691b52..a06138a005 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -1404,6 +1404,9 @@ DEFINE_bool(pipe, false, "Exercise the SkGPipe replay test pass.");
DEFINE_string2(readPath, r, "", "Read reference images from this dir, and report "
"any differences between those and the newly generated ones.");
DEFINE_bool(replay, false, "Exercise the SkPicture replay test pass.");
+#if SK_SUPPORT_GPU
+DEFINE_bool(resetGpuContext, false, "Reset the GrContext prior to running each GM.");
+#endif
DEFINE_string2(resourcePath, i, "", "Directory that stores image resources.");
DEFINE_bool(rtree, false, "Exercise the R-Tree variant of SkPicture test pass.");
DEFINE_bool(serialize, false, "Exercise the SkPicture serialization & deserialization test pass.");
@@ -1545,6 +1548,9 @@ ErrorCombination run_multiple_configs(GMMain &gmmain, GM *gm,
#if SK_SUPPORT_GPU
SkAutoTUnref<GrSurface> auGpuTarget;
if ((errorsForThisConfig.isEmpty()) && (kGPU_Backend == config.fBackend)) {
+ if (FLAGS_resetGpuContext) {
+ grFactory->destroyContexts();
+ }
GrContext* gr = grFactory->get(config.fGLContextType);
bool grSuccess = false;
if (gr) {