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

Unified Diff: ui/gfx/icon_util.h

Issue 11742007: Add support for adding 256x256 pngs to Windows .ico files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « chrome/browser/web_applications/web_app_win.cc ('k') | ui/gfx/icon_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/icon_util.h
===================================================================
--- ui/gfx/icon_util.h (revision 175367)
+++ ui/gfx/icon_util.h (working copy)
@@ -10,6 +10,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/gtest_prod_util.h"
#include "ui/base/ui_export.h"
#include "ui/gfx/point.h"
#include "ui/gfx/size.h"
@@ -81,16 +82,19 @@
// it when it is no longer needed.
static SkBitmap* CreateSkBitmapFromHICON(HICON icon);
- // Given an initialized SkBitmap object and a file name, this function
- // creates a .ico file with the given name using the provided bitmap. The
- // icon file is created with multiple icon images of varying predefined
- // dimensions because Windows uses different image sizes when loading icons,
+ // Creates Windows .ico file at |icon_path|. The icon file is created with
+ // multiple BMP representations at varying predefined dimensions (by resizing
+ // |bitmap|) because Windows uses different image sizes when loading icons,
// depending on where the icon is drawn (ALT+TAB window, desktop shortcut,
- // Quick Launch, etc.). |icon_file_name| needs to specify the full path for
- // the desired .ico file.
+ // Quick Launch, etc.).
//
+ // To create an icon file containing a 256x256 PNG entry, which is used by
+ // Vista+ for high res icons, specify a non-empty 256x256 SkBitmap for the
+ // |large_bitmap| parameter.
+ //
// The function returns true on success and false otherwise.
static bool CreateIconFileFromSkBitmap(const SkBitmap& bitmap,
+ const SkBitmap& large_bitmap,
const FilePath& icon_path);
// Creates a cursor of the specified size from the DIB passed in.
@@ -139,6 +143,8 @@
};
#pragma pack(pop)
+ FRIEND_TEST_ALL_PREFIXES(IconUtilTest, TestCreateIconFileWithLargeBitmap);
+
// Used for indicating that the .ico contains an icon (rather than a cursor)
// image. This value is set in the |idType| field of the ICONDIR structure.
static const int kResourceTypeIcon = 1;
« no previous file with comments | « chrome/browser/web_applications/web_app_win.cc ('k') | ui/gfx/icon_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698