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

Side by Side Diff: tools/skpdiff/SkPMetric.cpp

Issue 325413003: rebaseline_server: use just skpdiff, not Python Image Library (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: attempt to fix "'abs' : ambiguous call to overloaded function" on Windows Created 6 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 unified diff | Download patch
« no previous file with comments | « tools/skpdiff/SkPMetric.h ('k') | tools/skpdiff/skpdiff_main.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <cmath> 1 #include <cmath>
2 #include <math.h> 2 #include <math.h>
3 3
4 #include "SkBitmap.h" 4 #include "SkBitmap.h"
5 #include "skpdiff_util.h" 5 #include "skpdiff_util.h"
6 #include "SkPMetric.h" 6 #include "SkPMetric.h"
7 #include "SkPMetricUtil_generated.h" 7 #include "SkPMetricUtil_generated.h"
8 8
9 struct RGB { 9 struct RGB {
10 float r, g, b; 10 float r, g, b;
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 435 }
436 } 436 }
437 437
438 SkDELETE_ARRAY(cyclesPerDegree); 438 SkDELETE_ARRAY(cyclesPerDegree);
439 SkDELETE_ARRAY(contrast); 439 SkDELETE_ARRAY(contrast);
440 SkDELETE_ARRAY(thresholdFactorFrequency); 440 SkDELETE_ARRAY(thresholdFactorFrequency);
441 SkDELETE_ARRAY(contrastSensitivityTable); 441 SkDELETE_ARRAY(contrastSensitivityTable);
442 return 1.0 - (double)(*poiCount) / (width * height); 442 return 1.0 - (double)(*poiCount) / (width * height);
443 } 443 }
444 444
445 bool SkPMetric::diff(SkBitmap* baseline, SkBitmap* test, bool computeMask, Resul t* result) const { 445 bool SkPMetric::diff(SkBitmap* baseline, SkBitmap* test, const BitmapsToCreate& bitmapsToCreate,
446 Result* result) const {
446 double startTime = get_seconds(); 447 double startTime = get_seconds();
447 448
448 // Ensure the images are comparable 449 // Ensure the images are comparable
449 if (baseline->width() != test->width() || baseline->height() != test->height () || 450 if (baseline->width() != test->width() || baseline->height() != test->height () ||
450 baseline->width() <= 0 || baseline->height() <= 0) { 451 baseline->width() <= 0 || baseline->height() <= 0) {
451 return false; 452 return false;
452 } 453 }
453 454
454 ImageLAB baselineLAB(baseline->width(), baseline->height()); 455 ImageLAB baselineLAB(baseline->width(), baseline->height());
455 ImageLAB testLAB(baseline->width(), baseline->height()); 456 ImageLAB testLAB(baseline->width(), baseline->height());
456 457
457 if (!bitmap_to_cielab(baseline, &baselineLAB) || !bitmap_to_cielab(test, &te stLAB)) { 458 if (!bitmap_to_cielab(baseline, &baselineLAB) || !bitmap_to_cielab(test, &te stLAB)) {
458 return true; 459 return true;
459 } 460 }
460 461
461 result->poiCount = 0; 462 result->poiCount = 0;
462 result->result = pmetric(&baselineLAB, &testLAB, &result->poiCount); 463 result->result = pmetric(&baselineLAB, &testLAB, &result->poiCount);
463 result->timeElapsed = get_seconds() - startTime; 464 result->timeElapsed = get_seconds() - startTime;
464 465
465 return true; 466 return true;
466 } 467 }
OLDNEW
« no previous file with comments | « tools/skpdiff/SkPMetric.h ('k') | tools/skpdiff/skpdiff_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698