| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "app/gfx/icon_util.h" | 5 #include "app/gfx/icon_util.h" |
| 6 | 6 |
| 7 #include "app/win_util.h" |
| 7 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 8 #include "base/gfx/size.h" | 9 #include "base/gfx/size.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "chrome/common/win_util.h" | |
| 11 #include "skia/ext/image_operations.h" | 11 #include "skia/ext/image_operations.h" |
| 12 #include "skia/include/SkBitmap.h" | 12 #include "skia/include/SkBitmap.h" |
| 13 | 13 |
| 14 // Defining the dimensions for the icon images. We store only one value because | 14 // Defining the dimensions for the icon images. We store only one value because |
| 15 // we always resize to a square image; that is, the value 48 means that we are | 15 // we always resize to a square image; that is, the value 48 means that we are |
| 16 // going to resize the given bitmap to a 48 by 48 pixels bitmap. | 16 // going to resize the given bitmap to a 48 by 48 pixels bitmap. |
| 17 // | 17 // |
| 18 // The icon images appear in the icon file in same order in which their | 18 // The icon images appear in the icon file in same order in which their |
| 19 // corresponding dimensions appear in the |icon_dimensions_| array, so it is | 19 // corresponding dimensions appear in the |icon_dimensions_| array, so it is |
| 20 // important to keep this array sorted. Also note that the maximum icon image | 20 // important to keep this array sorted. Also note that the maximum icon image |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 // Once we compute the size for a singe AND mask scan line, we multiply that | 468 // Once we compute the size for a singe AND mask scan line, we multiply that |
| 469 // number by the image height in order to get the total number of bytes for | 469 // number by the image height in order to get the total number of bytes for |
| 470 // the AND mask. Thus, for a 15X15 image, we need 15 * 4 which is 60 bytes | 470 // the AND mask. Thus, for a 15X15 image, we need 15 * 4 which is 60 bytes |
| 471 // for the monochrome bitmap representing the AND mask. | 471 // for the monochrome bitmap representing the AND mask. |
| 472 int and_line_length = (bitmap.width() + 7) >> 3; | 472 int and_line_length = (bitmap.width() + 7) >> 3; |
| 473 and_line_length = (and_line_length + 3) & ~3; | 473 and_line_length = (and_line_length + 3) & ~3; |
| 474 *and_mask_size = and_line_length * bitmap.height(); | 474 *and_mask_size = and_line_length * bitmap.height(); |
| 475 int masks_size = *xor_mask_size + *and_mask_size; | 475 int masks_size = *xor_mask_size + *and_mask_size; |
| 476 *bytes_in_resource = masks_size + sizeof(BITMAPINFOHEADER); | 476 *bytes_in_resource = masks_size + sizeof(BITMAPINFOHEADER); |
| 477 } | 477 } |
| OLD | NEW |