summaryrefslogtreecommitdiffstats
path: root/chrome/browser/thumbnails/simple_thumbnail_crop.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/thumbnails/simple_thumbnail_crop.cc')
-rw-r--r--chrome/browser/thumbnails/simple_thumbnail_crop.cc13
1 files changed, 1 insertions, 12 deletions
diff --git a/chrome/browser/thumbnails/simple_thumbnail_crop.cc b/chrome/browser/thumbnails/simple_thumbnail_crop.cc
index 26a89f4..b438536 100644
--- a/chrome/browser/thumbnails/simple_thumbnail_crop.cc
+++ b/chrome/browser/thumbnails/simple_thumbnail_crop.cc
@@ -50,7 +50,7 @@ void SimpleThumbnailCrop::ProcessBitmap(
ComputeTargetSizeAtMaximumScale(target_size_),
&context->clip_result);
- context->score.boring_score = CalculateBoringScore(thumbnail);
+ context->score.boring_score = color_utils::CalculateBoringScore(thumbnail);
context->score.good_clipping =
(context->clip_result == CLIP_RESULT_WIDER_THAN_TALL ||
context->clip_result == CLIP_RESULT_TALLER_THAN_WIDE ||
@@ -59,17 +59,6 @@ void SimpleThumbnailCrop::ProcessBitmap(
callback.Run(*context.get(), thumbnail);
}
-double SimpleThumbnailCrop::CalculateBoringScore(const SkBitmap& bitmap) {
- if (bitmap.isNull() || bitmap.empty())
- return 1.0;
- int histogram[256] = {0};
- color_utils::BuildLumaHistogram(bitmap, histogram);
-
- int color_count = *std::max_element(histogram, histogram + 256);
- int pixel_count = bitmap.width() * bitmap.height();
- return static_cast<double>(color_count) / pixel_count;
-}
-
SkBitmap SimpleThumbnailCrop::GetClippedBitmap(const SkBitmap& bitmap,
int desired_width,
int desired_height,