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

Unified Diff: ui/gfx/color_analysis.cc

Issue 2823003002: SkBitmap and SkPixelRef no longer need lock/unlock (Closed)
Patch Set: win fix after rebase Created 3 years, 8 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/codec/png_codec.cc ('k') | ui/gfx/color_analysis_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_analysis.cc
diff --git a/ui/gfx/color_analysis.cc b/ui/gfx/color_analysis.cc
index d3e8998266dc654e5162ba1d4cef7031861becfa..6a2e87850f69ddbdfc9b2656616dcf5409b0310a 100644
--- a/ui/gfx/color_analysis.cc
+++ b/ui/gfx/color_analysis.cc
@@ -140,7 +140,6 @@ class KMeanCluster {
// Un-premultiplies each pixel in |bitmap| into an output |buffer|. Requires
// approximately 10 microseconds for a 16x16 icon on an Intel Core i5.
void UnPreMultiply(const SkBitmap& bitmap, uint32_t* buffer, int buffer_size) {
- SkAutoLockPixels auto_lock(bitmap);
uint32_t* in = static_cast<uint32_t*>(bitmap.getPixels());
uint32_t* out = buffer;
int pixel_count = std::min(bitmap.width() * bitmap.height(), buffer_size);
@@ -364,7 +363,6 @@ SkColor CalculateProminentColor(const SkBitmap& bitmap,
DCHECK(!bitmap.empty());
DCHECK(!bitmap.isNull());
- SkAutoLockPixels auto_lock(bitmap);
const uint32_t* pixels = static_cast<uint32_t*>(bitmap.getPixels());
const int pixel_count = bitmap.width() * bitmap.height();
@@ -778,7 +776,6 @@ SkColor CalculateProminentColorOfBitmap(const SkBitmap& bitmap,
gfx::Matrix3F ComputeColorCovariance(const SkBitmap& bitmap) {
// First need basic stats to normalize each channel separately.
- SkAutoLockPixels bitmap_lock(bitmap);
gfx::Matrix3F covariance = gfx::Matrix3F::Zeros();
if (!bitmap.getPixels())
return covariance;
@@ -857,9 +854,6 @@ bool ApplyColorReduction(const SkBitmap& source_bitmap,
bool fit_to_range,
SkBitmap* target_bitmap) {
DCHECK(target_bitmap);
- SkAutoLockPixels source_lock(source_bitmap);
- SkAutoLockPixels target_lock(*target_bitmap);
-
DCHECK(source_bitmap.getPixels());
DCHECK(target_bitmap->getPixels());
DCHECK_EQ(kN32_SkColorType, source_bitmap.colorType());
« no previous file with comments | « ui/gfx/codec/png_codec.cc ('k') | ui/gfx/color_analysis_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698