| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/favicon/favicon_handler.h" | 5 #include "chrome/browser/favicon/favicon_handler.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 return download_id; | 443 return download_id; |
| 444 } | 444 } |
| 445 | 445 |
| 446 gfx::Image FaviconHandler::ResizeFaviconIfNeeded(const gfx::Image& image) { | 446 gfx::Image FaviconHandler::ResizeFaviconIfNeeded(const gfx::Image& image) { |
| 447 // Get an SkBitmap from the gfx::Image. | 447 // Get an SkBitmap from the gfx::Image. |
| 448 const SkBitmap& bitmap = image; | 448 const SkBitmap& bitmap = image; |
| 449 int width = bitmap.width(); | 449 int width = bitmap.width(); |
| 450 int height = bitmap.height(); | 450 int height = bitmap.height(); |
| 451 if (width > 0 && height > 0) { | 451 if (width > 0 && height > 0) { |
| 452 gfx::CalculateFaviconTargetSize(&width, &height); | 452 gfx::CalculateFaviconTargetSize(&width, &height); |
| 453 return gfx::Image(new SkBitmap( | 453 return gfx::Image(skia::ImageOperations::Resize( |
| 454 skia::ImageOperations::Resize( | 454 bitmap, skia::ImageOperations::RESIZE_LANCZOS3, |
| 455 bitmap, skia::ImageOperations::RESIZE_LANCZOS3, | 455 width, height)); |
| 456 width, height))); | |
| 457 } | 456 } |
| 458 | 457 |
| 459 return image; | 458 return image; |
| 460 } | 459 } |
| OLD | NEW |