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

Unified Diff: components/favicon_base/select_favicon_frames.h

Issue 2739173002: Always select best favicon bitmap (Closed)
Patch Set: Minor changes. Created 3 years, 9 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 573a38c79cddf839622488589b71b4d19fbdfba6..f0dbf3a0a879e2c6c16e287c66bd970b556d1e82 100644
--- a/components/favicon_base/select_favicon_frames.h
+++ b/components/favicon_base/select_favicon_frames.h
@@ -61,4 +61,13 @@ void SelectFaviconFrameIndices(const std::vector<gfx::Size>& frame_pixel_sizes,
std::vector<size_t>* best_indices,
float* score);
+// Returns an arbitrary, implementation specific score between [0..1] that is
+// higher for better matches, and 1.0f for exact matches. Order of preference:
+// 1) Non-huge bitmaps are preferred over huge ones (8x bigger than
+// desired_size).
+// 2) Bitmaps which need to be scaled down instead of up.
+// 3) Bitmaps which do not need to be scaled as much.
+float GetFaviconCandidateScore(const gfx::Size& candidate_size,
+ int desired_size);
+
#endif // COMPONENTS_FAVICON_BASE_SELECT_FAVICON_FRAMES_H_

Powered by Google App Engine
This is Rietveld 408576698