Lines Matching refs:dr

145     int dr = SkGetPackedR32(c0) - SkGetPackedR32(c1);
150 (SkAbs32(dr) <= threshold) &&
158 void compute_diff(DiffRecord* dr, DiffMetricProc diffFunction, const int colorThreshold) {
159 const int w = dr->fComparison.fBitmap.width();
160 const int h = dr->fComparison.fBitmap.height();
161 if (w != dr->fBase.fBitmap.width() || h != dr->fBase.fBitmap.height()) {
162 dr->fResult = DiffRecord::kDifferentSizes_Result;
174 dr->fWeightedFraction = 0;
177 SkPMColor c0 = *dr->fBase.fBitmap.getAddr32(x, y);
178 SkPMColor c1 = *dr->fComparison.fBitmap.getAddr32(x, y);
190 dr->fWeightedFraction += ((float) value) / 255;
191 if (thisA > dr->fMaxMismatchA) {
192 dr->fMaxMismatchA = thisA;
194 if (thisR > dr->fMaxMismatchR) {
195 dr->fMaxMismatchR = thisR;
197 if (thisG > dr->fMaxMismatchG) {
198 dr->fMaxMismatchG = thisG;
200 if (thisB > dr->fMaxMismatchB) {
201 dr->fMaxMismatchB = thisB;
205 *dr->fDifference.fBitmap.getAddr32(x, y) = outputDifference;
206 *dr->fWhite.fBitmap.getAddr32(x, y) = PMCOLOR_WHITE;
208 *dr->fDifference.fBitmap.getAddr32(x, y) = 0;
209 *dr->fWhite.fBitmap.getAddr32(x, y) = PMCOLOR_BLACK;
214 dr->fResult = DiffRecord::kEqualPixels_Result;
217 dr->fResult = DiffRecord::kDifferentPixels_Result;
219 dr->fFractionDifference = ((float) mismatchedPixels) / pixelCount;
220 dr->fWeightedFraction /= pixelCount;
221 dr->fTotalMismatchA = totalMismatchA;
222 dr->fAverageMismatchA = ((float) totalMismatchA) / pixelCount;
223 dr->fAverageMismatchR = ((float) totalMismatchR) / pixelCount;
224 dr->fAverageMismatchG = ((float) totalMismatchG) / pixelCount;
225 dr->fAverageMismatchB = ((float) totalMismatchB) / pixelCount;