| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/thumbnails/content_based_thumbnailing_algorithm.h" | 5 #include "chrome/browser/thumbnails/content_based_thumbnailing_algorithm.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "chrome/browser/thumbnails/content_analysis.h" | 9 #include "chrome/browser/thumbnails/content_analysis.h" |
| 10 #include "chrome/browser/thumbnails/simple_thumbnail_crop.h" | 10 #include "chrome/browser/thumbnails/simple_thumbnail_crop.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
| 13 #include "ui/gfx/color_utils.h" | 13 #include "ui/gfx/color_utils.h" |
| 14 #include "ui/gfx/geometry/size_conversions.h" |
| 14 #include "ui/gfx/scrollbar_size.h" | 15 #include "ui/gfx/scrollbar_size.h" |
| 15 #include "ui/gfx/size_conversions.h" | |
| 16 #include "ui/gfx/skbitmap_operations.h" | 16 #include "ui/gfx/skbitmap_operations.h" |
| 17 #include "ui/gfx/skia_util.h" | 17 #include "ui/gfx/skia_util.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 const char kThumbnailHistogramName[] = "Thumbnail.RetargetMS"; | 21 const char kThumbnailHistogramName[] = "Thumbnail.RetargetMS"; |
| 22 const char kFailureHistogramName[] = "Thumbnail.FailedRetargetMS"; | 22 const char kFailureHistogramName[] = "Thumbnail.FailedRetargetMS"; |
| 23 const float kScoreBoostFromSuccessfulRetargeting = 1.1f; | 23 const float kScoreBoostFromSuccessfulRetargeting = 1.1f; |
| 24 | 24 |
| 25 void CallbackInvocationAdapter( | 25 void CallbackInvocationAdapter( |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } else { | 233 } else { |
| 234 clipping_rect = gfx::Rect(source_size); | 234 clipping_rect = gfx::Rect(source_size); |
| 235 target_size->SetSize(source_size.width() / 2, source_size.height() / 2); | 235 target_size->SetSize(source_size.width() / 2, source_size.height() / 2); |
| 236 *clip_result = CLIP_RESULT_NOT_CLIPPED; | 236 *clip_result = CLIP_RESULT_NOT_CLIPPED; |
| 237 } | 237 } |
| 238 | 238 |
| 239 return clipping_rect; | 239 return clipping_rect; |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace thumbnails | 242 } // namespace thumbnails |
| OLD | NEW |