Lines Matching full:dr
145 int dr = SkGetPackedR32(c0) - SkGetPackedR32(c1); in colors_match_thresholded() local
150 (SkAbs32(dr) <= threshold) && in colors_match_thresholded()
158 void compute_diff(DiffRecord* dr, DiffMetricProc diffFunction, const int colorThreshold) { in compute_diff() argument
159 const int w = dr->fComparison.fBitmap.width(); in compute_diff()
160 const int h = dr->fComparison.fBitmap.height(); in compute_diff()
161 if (w != dr->fBase.fBitmap.width() || h != dr->fBase.fBitmap.height()) { in compute_diff()
162 dr->fResult = DiffRecord::kDifferentSizes_Result; in compute_diff()
166 SkAutoLockPixels alpDiff(dr->fDifference.fBitmap); in compute_diff()
167 SkAutoLockPixels alpWhite(dr->fWhite.fBitmap); in compute_diff()
176 dr->fWeightedFraction = 0; in compute_diff()
179 SkPMColor c0 = *dr->fBase.fBitmap.getAddr32(x, y); in compute_diff()
180 SkPMColor c1 = *dr->fComparison.fBitmap.getAddr32(x, y); in compute_diff()
192 dr->fWeightedFraction += ((float) value) / 255; in compute_diff()
193 if (thisA > dr->fMaxMismatchA) { in compute_diff()
194 dr->fMaxMismatchA = thisA; in compute_diff()
196 if (thisR > dr->fMaxMismatchR) { in compute_diff()
197 dr->fMaxMismatchR = thisR; in compute_diff()
199 if (thisG > dr->fMaxMismatchG) { in compute_diff()
200 dr->fMaxMismatchG = thisG; in compute_diff()
202 if (thisB > dr->fMaxMismatchB) { in compute_diff()
203 dr->fMaxMismatchB = thisB; in compute_diff()
207 *dr->fDifference.fBitmap.getAddr32(x, y) = outputDifference; in compute_diff()
208 *dr->fWhite.fBitmap.getAddr32(x, y) = PMCOLOR_WHITE; in compute_diff()
210 *dr->fDifference.fBitmap.getAddr32(x, y) = 0; in compute_diff()
211 *dr->fWhite.fBitmap.getAddr32(x, y) = PMCOLOR_BLACK; in compute_diff()
216 dr->fResult = DiffRecord::kEqualPixels_Result; in compute_diff()
219 dr->fResult = DiffRecord::kDifferentPixels_Result; in compute_diff()
221 dr->fFractionDifference = ((float) mismatchedPixels) / pixelCount; in compute_diff()
222 dr->fWeightedFraction /= pixelCount; in compute_diff()
223 dr->fTotalMismatchA = totalMismatchA; in compute_diff()
224 dr->fAverageMismatchA = ((float) totalMismatchA) / pixelCount; in compute_diff()
225 dr->fAverageMismatchR = ((float) totalMismatchR) / pixelCount; in compute_diff()
226 dr->fAverageMismatchG = ((float) totalMismatchG) / pixelCount; in compute_diff()
227 dr->fAverageMismatchB = ((float) totalMismatchB) / pixelCount; in compute_diff()