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

Unified Diff: ui/gfx/color_utils.cc

Issue 15915005: BuildLumaHistogram() attempts to access Skia pixel data directly. This isn't (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | « no previous file | 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
===================================================================
--- ui/gfx/color_utils.cc (revision 201894)
+++ ui/gfx/color_utils.cc (working copy)
@@ -197,15 +197,12 @@
DCHECK_EQ(SkBitmap::kARGB_8888_Config, bitmap.config());
SkAutoLockPixels bitmap_lock(bitmap);
- if (!bitmap.getPixels())
- return;
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));
- for (int x = 0; x < pixel_width; ++x, ++current_color)
- histogram[GetLuminanceForColor(*current_color)]++;
+ for (int x = 0; x < pixel_width; ++x)
+ ++histogram[GetLuminanceForColor(bitmap.getColor(x, y))];
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698