Coverity: Pass parameters by reference.
CID=8976,8977,8978,8979,8980,8981,8982,17240
BUG=none
TEST=none
[email protected]
Review URL: http://codereview.chromium.org/7227002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89962 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/gfx/skbitmap_operations.cc b/ui/gfx/skbitmap_operations.cc
index 7cd7122..15c1d9d 100644
--- a/ui/gfx/skbitmap_operations.cc
+++ b/ui/gfx/skbitmap_operations.cc
@@ -252,7 +252,7 @@
// Routine used to process a line; typically specialized for specific kinds of
// HSL shifts (to optimize).
-typedef void (*LineProcessor)(color_utils::HSL,
+typedef void (*LineProcessor)(const color_utils::HSL&,
const SkPMColor*,
SkPMColor*,
int width);
@@ -267,8 +267,10 @@
const double epsilon = 0.0005;
// Line processor: default/universal (i.e., old-school).
-void LineProcDefault(color_utils::HSL hsl_shift, const SkPMColor* in,
- SkPMColor* out, int width) {
+void LineProcDefault(const color_utils::HSL& hsl_shift,
+ const SkPMColor* in,
+ SkPMColor* out,
+ int width) {
for (int x = 0; x < width; x++) {
out[x] = SkPreMultiplyColor(color_utils::HSLShift(
SkUnPreMultiply::PMColorToColor(in[x]), hsl_shift));
@@ -276,8 +278,10 @@
}
// Line processor: no-op (i.e., copy).
-void LineProcCopy(color_utils::HSL hsl_shift, const SkPMColor* in,
- SkPMColor* out, int width) {
+void LineProcCopy(const color_utils::HSL& hsl_shift,
+ const SkPMColor* in,
+ SkPMColor* out,
+ int width) {
DCHECK(hsl_shift.h < 0);
DCHECK(hsl_shift.s < 0 || fabs(hsl_shift.s - 0.5) < HSLShift::epsilon);
DCHECK(hsl_shift.l < 0 || fabs(hsl_shift.l - 0.5) < HSLShift::epsilon);
@@ -285,8 +289,10 @@
}
// Line processor: H no-op, S no-op, L decrease.
-void LineProcHnopSnopLdec(color_utils::HSL hsl_shift, const SkPMColor* in,
- SkPMColor* out, int width) {
+void LineProcHnopSnopLdec(const color_utils::HSL& hsl_shift,
+ const SkPMColor* in,
+ SkPMColor* out,
+ int width) {
const uint32_t den = 65536;
DCHECK(hsl_shift.h < 0);
@@ -307,8 +313,10 @@
}
// Line processor: H no-op, S no-op, L increase.
-void LineProcHnopSnopLinc(color_utils::HSL hsl_shift, const SkPMColor* in,
- SkPMColor* out, int width) {
+void LineProcHnopSnopLinc(const color_utils::HSL& hsl_shift,
+ const SkPMColor* in,
+ SkPMColor* out,
+ int width) {
const uint32_t den = 65536;
DCHECK(hsl_shift.h < 0);
@@ -352,8 +360,10 @@
// (Med-Min)/(Max-Min)).
// Line processor: H no-op, S decrease, L no-op.
-void LineProcHnopSdecLnop(color_utils::HSL hsl_shift, const SkPMColor* in,
- SkPMColor* out, int width) {
+void LineProcHnopSdecLnop(const color_utils::HSL& hsl_shift,
+ const SkPMColor* in,
+ SkPMColor* out,
+ int width) {
DCHECK(hsl_shift.h < 0);
DCHECK(hsl_shift.s >= 0 && hsl_shift.s <= 0.5 - HSLShift::epsilon);
DCHECK(hsl_shift.l < 0 || fabs(hsl_shift.l - 0.5) < HSLShift::epsilon);
@@ -387,8 +397,10 @@
}
// Line processor: H no-op, S decrease, L decrease.
-void LineProcHnopSdecLdec(color_utils::HSL hsl_shift, const SkPMColor* in,
- SkPMColor* out, int width) {
+void LineProcHnopSdecLdec(const color_utils::HSL& hsl_shift,
+ const SkPMColor* in,
+ SkPMColor* out,
+ int width) {
DCHECK(hsl_shift.h < 0);
DCHECK(hsl_shift.s >= 0 && hsl_shift.s <= 0.5 - HSLShift::epsilon);
DCHECK(hsl_shift.l >= 0 && hsl_shift.l <= 0.5 - HSLShift::epsilon);
@@ -424,8 +436,10 @@
}
// Line processor: H no-op, S decrease, L increase.
-void LineProcHnopSdecLinc(color_utils::HSL hsl_shift, const SkPMColor* in,
- SkPMColor* out, int width) {
+void LineProcHnopSdecLinc(const color_utils::HSL& hsl_shift,
+ const SkPMColor* in,
+ SkPMColor* out,
+ int width) {
DCHECK(hsl_shift.h < 0);
DCHECK(hsl_shift.s >= 0 && hsl_shift.s <= 0.5 - HSLShift::epsilon);
DCHECK(hsl_shift.l >= 0.5 + HSLShift::epsilon && hsl_shift.l <= 1);