Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: components/favicon_base/select_favicon_frames.h

Issue 336423006: Pass in a set of requested favicon pixel sizes to the HistoryService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/favicon_base/select_favicon_frames.h
diff --git a/components/favicon_base/select_favicon_frames.h b/components/favicon_base/select_favicon_frames.h
index 597a8f195e5bfbf46f9549a434a56e89889af689..34ffef3bf8ee5611449c936dcccc0e4aeeb81af6 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);
« no previous file with comments | « chrome/browser/web_applications/update_shortcut_worker_win.cc ('k') | components/favicon_base/select_favicon_frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698