Index: gm/gmmain.cpp |
=================================================================== |
--- gm/gmmain.cpp (revision 8534) |
+++ gm/gmmain.cpp (working copy) |
@@ -272,7 +272,8 @@ |
} |
// Things to do only if there is some error condition. |
- SkString fullName = make_name(name.c_str(), renderModeDescriptor); |
+ SkString fullName = name; |
+ fullName.append(renderModeDescriptor); |
for (int typeInt = 0; typeInt <= kLast_ErrorType; typeInt++) { |
ErrorType type = static_cast<ErrorType>(typeInt); |
if (errorCombination.includes(type)) { |
@@ -996,9 +997,8 @@ |
return kEmpty_ErrorCombination; |
} |
- ErrorCombination test_pipe_playback(GM* gm, |
- const ConfigData& gRec, |
- const SkBitmap& referenceBitmap) { |
+ ErrorCombination test_pipe_playback(GM* gm, const ConfigData& gRec, |
+ const SkBitmap& referenceBitmap, bool simulateFailure) { |
ErrorCombination errors; |
for (size_t i = 0; i < SK_ARRAY_COUNT(gPipeWritingFlagCombos); ++i) { |
SkBitmap bitmap; |
@@ -1010,7 +1010,9 @@ |
SkGPipeWriter writer; |
SkCanvas* pipeCanvas = writer.startRecording( |
&pipeController, gPipeWritingFlagCombos[i].flags); |
- invokeGM(gm, pipeCanvas, false, false); |
+ if (!simulateFailure) { |
+ invokeGM(gm, pipeCanvas, false, false); |
+ } |
complete_bitmap(&bitmap); |
writer.endRecording(); |
SkString string("-pipe"); |
@@ -1177,6 +1179,7 @@ |
DEFINE_string2(resourcePath, i, "", "Directory that stores image resources."); |
DEFINE_bool(rtree, true, "Exercise the R-Tree variant of SkPicture test pass."); |
DEFINE_bool(serialize, true, "Exercise the SkPicture serialization & deserialization test pass."); |
+DEFINE_bool(simulatePipePlaybackFailure, false, "Simulate a rendering failure in pipe mode only."); |
DEFINE_bool(tiledPipe, false, "Exercise tiled SkGPipe replay."); |
DEFINE_bool(tileGrid, true, "Exercise the tile grid variant of SkPicture."); |
DEFINE_string(tileGridReplayScales, "", "Space separated list of floating-point scale " |
@@ -1459,7 +1462,8 @@ |
ErrorCombination pipeErrors; |
if (FLAGS_pipe) { |
- pipeErrors.add(gmmain.test_pipe_playback(gm, compareConfig, comparisonBitmap)); |
+ pipeErrors.add(gmmain.test_pipe_playback(gm, compareConfig, comparisonBitmap, |
+ FLAGS_simulatePipePlaybackFailure)); |
} |
if ((pipeErrors.isEmpty()) && |