diff options
author | zachr@google.com <zachr@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-23 12:57:52 +0000 |
---|---|---|
committer | zachr@google.com <zachr@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-23 12:57:52 +0000 |
commit | ee0f46d87fbb69a616e6e89392483b2f133fdf2e (patch) | |
tree | b8c579fe3e9f29231816795f77f30f6169f8c695 /tools | |
parent | 2e767c35ca082b41f76e9de811a093f196485b6d (diff) |
put max on outputted poi in skpdiff
R=djsollen@google.com
Review URL: https://codereview.chromium.org/19601006
git-svn-id: http://skia.googlecode.com/svn/trunk@10262 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rw-r--r-- | tools/skpdiff/SkDiffContext.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/skpdiff/SkDiffContext.cpp b/tools/skpdiff/SkDiffContext.cpp index a75450b65b..7a28fe13c9 100644 --- a/tools/skpdiff/SkDiffContext.cpp +++ b/tools/skpdiff/SkDiffContext.cpp @@ -15,6 +15,9 @@ #include "SkImageDiffer.h" #include "skpdiff_util.h" +// Truncates the number of points of interests in JSON output to not freeze the parser +static const int kMaxPOI = 100; + SkDiffContext::SkDiffContext() { fRecords = NULL; fDiffers = NULL; @@ -185,7 +188,8 @@ void SkDiffContext::outputRecords(SkWStream& stream, bool useJSONP) { stream.writeText(",\n"); stream.writeText(" \"pointsOfInterest\": [\n"); - for (int poiIndex = 0; poiIndex < data.fPointsOfInterest.count(); poiIndex++) { + for (int poiIndex = 0; poiIndex < data.fPointsOfInterest.count() && + poiIndex < kMaxPOI; poiIndex++) { SkIPoint poi = data.fPointsOfInterest[poiIndex]; stream.writeText(" ["); stream.writeDecAsText(poi.x()); |