summaryrefslogtreecommitdiffstats
path: root/components/favicon_base/select_favicon_frames.h
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-20 07:07:56 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-20 07:07:56 +0000
commit19e97d586d64c128344d81743b197b0434f42870 (patch)
treefd7becbda1443402c6b8fe41ab97539e544ebe9a /components/favicon_base/select_favicon_frames.h
parent3a2a6ac0dd1e72cac9c7a3cd7b122fa1f070f8bc (diff)
downloadchromium_src-19e97d586d64c128344d81743b197b0434f42870.zip
chromium_src-19e97d586d64c128344d81743b197b0434f42870.tar.gz
chromium_src-19e97d586d64c128344d81743b197b0434f42870.tar.bz2
Pass in a set of requested favicon pixel sizes to the HistoryService instead of a desired size in DIP and a set of desired scale factors.
BUG=None TEST=None Review URL: https://codereview.chromium.org/336423006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/favicon_base/select_favicon_frames.h')
-rw-r--r--components/favicon_base/select_favicon_frames.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/components/favicon_base/select_favicon_frames.h b/components/favicon_base/select_favicon_frames.h
index 597a8f1..34ffef3 100644
--- a/components/favicon_base/select_favicon_frames.h
+++ b/components/favicon_base/select_favicon_frames.h
@@ -21,14 +21,14 @@ 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| x |desired_size| DIP big. This
+// ImageSkia that's |desired_size_in_dip| x |desired_size_in_dip| big. This
// function adds a representation at every desired scale factor.
-// If |desired_size| is 0, the largest bitmap is returned unmodified.
+// 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.)
// If score is non-NULL, it receives a score between 0 (bad) and 1 (good)
// that describes how well |bitmaps| were able to produce an image at
-// |desired_size| for |scale_factors|.
+// |desired_size_in_dip| for |scale_factors|.
// The score is arbitrary, but it's best for exact size matches,
// and gets worse the more resampling needs to happen.
// If the resampling algorithm is modified, the resampling done in
@@ -38,24 +38,24 @@ gfx::ImageSkia SelectFaviconFrames(
const std::vector<SkBitmap>& bitmaps,
const std::vector<gfx::Size>& original_sizes,
const std::vector<ui::ScaleFactor>& scale_factors,
- int desired_size,
+ 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 that's
-// |desired_size| x |desired_size| DIP big. If |desired_size| is 0, the index
-// of the largest size is returned. If score is non-NULL, it receives a score
-// between 0 (bad) and 1 (good) that describes how well the bitmap data with
-// the sizes at |best_indices| will produce an image of |desired_size| DIP for
-// |scale_factors|. The score is arbitrary, but it's best for exact size
+// the indices of the best sizes to use to create an ImageSkia with
+// ImageSkiaReps with edge sizes |desired_sizes|. If '0' is one of
+// |desired_sizes|, the index of the largest size is returned. If |score| is
+// non-NULL, |score| is set to a value between 0 (bad) and 1 (good) that
+// describes how well the bitmap data with the sizes at |best_indices| will
+// produce the ImageSkia. The score is arbitrary, but it's best for exact
// matches, and gets worse the more resampling needs to happen.
-// TODO(pkotwicz): Remove need to pass in |scale_factors|.
+// TODO(pkotwicz): Change API so that |desired_sizes| being empty indicates
+// that the index of the largest size is requested.
// TODO(pkotwicz): Remove callers of this method for which |frame_pixel_sizes|
// are the sizes of the favicon bitmaps after they were resized.
void SelectFaviconFrameIndices(
const std::vector<gfx::Size>& frame_pixel_sizes,
- const std::vector<ui::ScaleFactor>& scale_factors,
- int desired_size,
+ const std::vector<int>& desired_sizes,
std::vector<size_t>* best_indices,
float* score);