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

Unified Diff: ui/gfx/color_utils.cc

Issue 9662021: Fixed pass-by-value to pass-by-reference (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed unit test compile errors Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/color_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_utils.cc
diff --git a/ui/gfx/color_utils.cc b/ui/gfx/color_utils.cc
index dfcf19603b8c4dc32c7c55fd588095f4aaeaf70b..8854119b2520bfd906c129872bf8db3737b2a347 100644
--- a/ui/gfx/color_utils.cc
+++ b/ui/gfx/color_utils.cc
@@ -242,18 +242,18 @@ SkColor GetAverageColorOfFavicon(SkBitmap* favicon, SkAlpha alpha) {
SkColorSetARGB(alpha, 0, 0, 0);
}
-void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]) {
- SkAutoLockPixels bitmap_lock(*bitmap);
- if (!bitmap->getPixels())
+void BuildLumaHistogram(const SkBitmap& bitmap, int histogram[256]) {
+ SkAutoLockPixels bitmap_lock(bitmap);
+ if (!bitmap.getPixels())
return;
// Assume ARGB_8888 format.
- DCHECK(bitmap->getConfig() == SkBitmap::kARGB_8888_Config);
+ DCHECK(bitmap.getConfig() == SkBitmap::kARGB_8888_Config);
- int pixel_width = bitmap->width();
- int pixel_height = bitmap->height();
+ int pixel_width = bitmap.width();
+ int pixel_height = bitmap.height();
for (int y = 0; y < pixel_height; ++y) {
- SkColor* current_color = static_cast<uint32_t*>(bitmap->getAddr32(0, y));
+ SkColor* current_color = static_cast<uint32_t*>(bitmap.getAddr32(0, y));
for (int x = 0; x < pixel_width; ++x, ++current_color)
histogram[GetLuminanceForColor(*current_color)]++;
}
« no previous file with comments | « ui/gfx/color_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698