summaryrefslogtreecommitdiffstats
path: root/components/favicon_base/select_favicon_frames.h
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-24 21:57:46 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-24 21:57:46 +0000
commite40d04ad09472f40837011cf9746f71af8a3924a (patch)
tree3a9e1202c0058f32396d334ee15f642a7779ee32 /components/favicon_base/select_favicon_frames.h
parent3c1759548dece0cc6cac2e359920d55c801163ce (diff)
downloadchromium_src-e40d04ad09472f40837011cf9746f71af8a3924a.zip
chromium_src-e40d04ad09472f40837011cf9746f71af8a3924a.tar.gz
chromium_src-e40d04ad09472f40837011cf9746f71af8a3924a.tar.bz2
Create ImageSkia for favicons that can be scaled to one that is not in resource scales.
Replaces SelectFaviconFrames with new function because new ImageSkia instance should be able to handle all cases. This depends on https://codereview.chromium.org/335233003/. BUG=376367,381601 TEST=WIP Review URL: https://codereview.chromium.org/346013002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/favicon_base/select_favicon_frames.h')
-rw-r--r--components/favicon_base/select_favicon_frames.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/components/favicon_base/select_favicon_frames.h b/components/favicon_base/select_favicon_frames.h
index 9c1b80e..81d39d85 100644
--- a/components/favicon_base/select_favicon_frames.h
+++ b/components/favicon_base/select_favicon_frames.h
@@ -21,8 +21,9 @@ class Size;
extern const float kSelectFaviconFramesInvalidScore;
// Takes a list of all bitmaps found in a .ico file, and creates an
-// ImageSkia that's |desired_size_in_dip| x |desired_size_in_dip| big. This
-// function adds a representation at every entry in |favicon_scales|.
+// ImageSkia that's |desired_size_in_dip| x |desired_size_in_dip| big.
+// Bitmaps are selected by using |SelectFaviconFrameIndices| and the
+// platform's supported favicon scales (favicon_base::GetFaviconScales()).
// If |desired_size_in_dip| is 0, the largest bitmap is returned unmodified.
// |original_sizes| are the original sizes of the bitmaps. (For instance,
// WebContents::DownloadImage() does resampling if it is passed a max size.)
@@ -34,11 +35,13 @@ extern const float kSelectFaviconFramesInvalidScore;
// If the resampling algorithm is modified, the resampling done in
// FaviconUtil::SelectFaviconFramesFromPNGs() should probably be modified too as
// it inspired by this method.
-gfx::ImageSkia SelectFaviconFrames(const std::vector<SkBitmap>& bitmaps,
- const std::vector<gfx::Size>& original_sizes,
- const std::vector<float>& favicon_scales,
- int desired_size_in_dip,
- float* score);
+// If an unsupported scale (not in the favicon_base::GetFaviconScales())
+// is requested, the ImageSkia will automatically scales using lancoz3.
+gfx::ImageSkia CreateFaviconImageSkia(
+ const std::vector<SkBitmap>& bitmaps,
+ const std::vector<gfx::Size>& original_sizes,
+ int desired_size_in_dip,
+ float* score);
// Takes a list of the pixel sizes of a favicon's favicon bitmaps and returns
// the indices of the best sizes to use to create an ImageSkia with