Remove loop unrolling code in load_gamut

This patch removes the loop unrolling code in load_gamut()
for improving the code readability.

Bug: skia: None
Change-Id: I749a3351a9f570347946a419d31efffa85818267
Reviewed-on: https://skia-review.googlesource.com/22001
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
This commit is contained in:
nagarajan.n 2017-07-10 15:02:00 +05:30 committed by Skia Commit-Bot
parent b1854fad3a
commit 6e17b6f20f

View File

@ -25,15 +25,11 @@ static void load_gamut(SkPoint rgb[], const SkMatrix44& xyz) {
// rx = rX / (rX + rY + rZ)
// ry = rY / (rX + rY + rZ)
// gx, gy, bx, and gy are calulcated similarly.
float rSum = xyz.get(0, 0) + xyz.get(1, 0) + xyz.get(2, 0);
float gSum = xyz.get(0, 1) + xyz.get(1, 1) + xyz.get(2, 1);
float bSum = xyz.get(0, 2) + xyz.get(1, 2) + xyz.get(2, 2);
rgb[0].fX = xyz.get(0, 0) / rSum;
rgb[0].fY = xyz.get(1, 0) / rSum;
rgb[1].fX = xyz.get(0, 1) / gSum;
rgb[1].fY = xyz.get(1, 1) / gSum;
rgb[2].fX = xyz.get(0, 2) / bSum;
rgb[2].fY = xyz.get(1, 2) / bSum;
for (int rgbIdx = 0; rgbIdx < 3; rgbIdx++) {
float sum = xyz.get(0, rgbIdx) + xyz.get(1, rgbIdx) + xyz.get(2, rgbIdx);
rgb[rgbIdx].fX = xyz.get(0, rgbIdx) / sum;
rgb[rgbIdx].fY = xyz.get(1, rgbIdx) / sum;
}
}
/**