| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/gfx/icon_util.h" | 5 #include "ui/gfx/icon_util.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/files/important_file_writer.h" | 8 #include "base/files/important_file_writer.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/win/resource_util.h" | 11 #include "base/win/resource_util.h" |
| 12 #include "base/win/scoped_gdi_object.h" | 12 #include "base/win/scoped_gdi_object.h" |
| 13 #include "base/win/scoped_handle.h" | 13 #include "base/win/scoped_handle.h" |
| 14 #include "base/win/scoped_hdc.h" | 14 #include "base/win/scoped_hdc.h" |
| 15 #include "skia/ext/image_operations.h" | 15 #include "skia/ext/image_operations.h" |
| 16 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
| 17 #include "ui/gfx/gdi_util.h" | 17 #include "ui/gfx/gdi_util.h" |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 // Once we compute the size for a singe AND mask scan line, we multiply that | 681 // Once we compute the size for a singe AND mask scan line, we multiply that |
| 682 // number by the image height in order to get the total number of bytes for | 682 // number by the image height in order to get the total number of bytes for |
| 683 // the AND mask. Thus, for a 15X15 image, we need 15 * 4 which is 60 bytes | 683 // the AND mask. Thus, for a 15X15 image, we need 15 * 4 which is 60 bytes |
| 684 // for the monochrome bitmap representing the AND mask. | 684 // for the monochrome bitmap representing the AND mask. |
| 685 size_t and_line_length = (bitmap.width() + 7) >> 3; | 685 size_t and_line_length = (bitmap.width() + 7) >> 3; |
| 686 and_line_length = (and_line_length + 3) & ~3; | 686 and_line_length = (and_line_length + 3) & ~3; |
| 687 size_t and_mask_size = and_line_length * bitmap.height(); | 687 size_t and_mask_size = and_line_length * bitmap.height(); |
| 688 size_t masks_size = *xor_mask_size + and_mask_size; | 688 size_t masks_size = *xor_mask_size + and_mask_size; |
| 689 *bytes_in_resource = masks_size + sizeof(BITMAPINFOHEADER); | 689 *bytes_in_resource = masks_size + sizeof(BITMAPINFOHEADER); |
| 690 } | 690 } |
| OLD | NEW |