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

Unified Diff: tools/skpdiff/SkDiffContext.cpp

Issue 19601006: put max on outputted poi in skpdiff (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: document Created 7 years, 5 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpdiff/SkDiffContext.cpp
diff --git a/tools/skpdiff/SkDiffContext.cpp b/tools/skpdiff/SkDiffContext.cpp
index a75450b65b23fb1e02ac70ac1bb8070bc86bd949..7a28fe13c95a3f6f47c5c8a10c961f2678f32e22 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());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698