From e47e0c96009b8633294eebbb9eb0e84caf525c57 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 26 Apr 2017 10:55:54 -0700 Subject: Avoid unordered_set and maps for the time being. See discussion at https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/rdxOHKzQmRY Change-Id: I1803ae97c39b592001835814e2f6674b2c7cb3ea Reviewed-on: https://pdfium-review.googlesource.com/4531 Reviewed-by: dsinclair Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- samples/image_diff.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'samples/image_diff.cc') diff --git a/samples/image_diff.cc b/samples/image_diff.cc index 3aa626be65..70c74c951c 100644 --- a/samples/image_diff.cc +++ b/samples/image_diff.cc @@ -166,9 +166,6 @@ float PercentageDifferent(const Image& baseline, const Image& actual) { return CalculateDifferencePercentage(actual, pixels_different); } -// FIXME: Replace with unordered_map when available. -typedef std::map RgbaToCountMap; - float HistogramPercentageDifferent(const Image& baseline, const Image& actual) { // TODO(johnme): Consider using a joint histogram instead, as described in // "Comparing Images Using Joint Histograms" by Pass & Zabih @@ -178,7 +175,7 @@ float HistogramPercentageDifferent(const Image& baseline, const Image& actual) { int h = std::min(baseline.h(), actual.h()); // Count occurences of each RGBA pixel value of baseline in the overlap. - RgbaToCountMap baseline_histogram; + std::map baseline_histogram; for (int y = 0; y < h; ++y) { for (int x = 0; x < w; ++x) { // hash_map operator[] inserts a 0 (default constructor) if key not found. @@ -191,7 +188,7 @@ float HistogramPercentageDifferent(const Image& baseline, const Image& actual) { for (int y = 0; y < h; ++y) { for (int x = 0; x < w; ++x) { uint32_t actual_rgba = actual.pixel_at(x, y); - RgbaToCountMap::iterator it = baseline_histogram.find(actual_rgba); + auto it = baseline_histogram.find(actual_rgba); if (it != baseline_histogram.end() && it->second > 0) --it->second; else -- cgit v1.2.3