Index: chrome/browser/history/select_favicon_frames.h |
diff --git a/chrome/browser/history/select_favicon_frames.h b/chrome/browser/history/select_favicon_frames.h |
index 22a596832f2253c67587def56abcb3a6ea809c91..28416029fe5896807dcd6be15265065b4cbd0028 100644 |
--- a/chrome/browser/history/select_favicon_frames.h |
+++ b/chrome/browser/history/select_favicon_frames.h |
@@ -7,6 +7,7 @@ |
#include <vector> |
+#include "chrome/browser/history/history_types.h" |
#include "ui/base/layout.h" |
class SkBitmap; |
@@ -15,11 +16,15 @@ namespace gfx { |
class ImageSkia; |
} |
+// Score which is smaller than the minimum score returned by |
+// SelectFaviconFrames() or SelectFaviconBitmapIDs(). |
+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 pixels big. This |
+// ImageSkia that's |desired_size| x |desired_size| DIP big. This |
// function adds a representation at every desired scale factor. |
-// If desired_size is 0, the largest bitmap is returned unmodified. |
-// If score is non-NULL, it receive a score between 0 (bad) and 1 (good) |
+// If |desired_size| is 0, the largest bitmap is returned unmodified. |
+// 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|. |
// The score is arbitrary, but it's best for exact size matches, |
@@ -30,4 +35,22 @@ gfx::ImageSkia SelectFaviconFrames( |
int desired_size, |
float* score); |
+// Takes a list of all history::FaviconBitmapIDSize for a favicon and returns |
+// the FaviconBitmapIDs (in |filtered_favicon_bitmap_ids|) whose bitmap data |
+// should be fetched in order to create an ImageSkia that's |desired_size| x |
+// |desired_size| DIP big. |
+// If |desired_size| is 0, the FaviconBitmapID with the largest size is |
+// returned. If score is non-NULL, it receives a score between 0 (bad) and |
+// 1 (good) that describes how well |filtered_favicon_bitmap_ids| will |
+// produce an image at |desired_size| for |scale_factors|. The score is |
+// arbitrary, but it's best for exact size matches, and gets worse the |
+// more resampling needs to happen. |
+// TODO(pkotwicz): Remove need to pass in |scale_factors|. |
+void SelectFaviconBitmapIDs( |
+ const std::vector<history::FaviconBitmapIDSize>& bitmap_id_sizes, |
+ const std::vector<ui::ScaleFactor>& scale_factors, |
+ int desired_size, |
+ std::vector<history::FaviconBitmapID>* filtered_favicon_bitmap_ids, |
+ float* score); |
+ |
#endif // CHROME_BROWSER_HISTORY_SELECT_FAVICON_FRAMES_H_ |