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

Side by Side Diff: gfx/icon_util.cc

Issue 915002: Create a toplevel gfx/ dir and seed it with icon_util.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gfx/icon_util.h ('k') | gfx/icon_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "gfx/icon_util.h"
6 6
7 #include "app/win_util.h" 7 #include "app/win_util.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/gfx/size.h" 9 #include "base/gfx/size.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
12 #include "skia/ext/image_operations.h" 12 #include "skia/ext/image_operations.h"
13 #include "third_party/skia/include/core/SkBitmap.h" 13 #include "third_party/skia/include/core/SkBitmap.h"
14 14
15 // Defining the dimensions for the icon images. We store only one value because 15 // Defining the dimensions for the icon images. We store only one value because
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 // Once we compute the size for a singe AND mask scan line, we multiply that 480 // Once we compute the size for a singe AND mask scan line, we multiply that
481 // number by the image height in order to get the total number of bytes for 481 // number by the image height in order to get the total number of bytes for
482 // the AND mask. Thus, for a 15X15 image, we need 15 * 4 which is 60 bytes 482 // the AND mask. Thus, for a 15X15 image, we need 15 * 4 which is 60 bytes
483 // for the monochrome bitmap representing the AND mask. 483 // for the monochrome bitmap representing the AND mask.
484 int and_line_length = (bitmap.width() + 7) >> 3; 484 int and_line_length = (bitmap.width() + 7) >> 3;
485 and_line_length = (and_line_length + 3) & ~3; 485 and_line_length = (and_line_length + 3) & ~3;
486 *and_mask_size = and_line_length * bitmap.height(); 486 *and_mask_size = and_line_length * bitmap.height();
487 int masks_size = *xor_mask_size + *and_mask_size; 487 int masks_size = *xor_mask_size + *and_mask_size;
488 *bytes_in_resource = masks_size + sizeof(BITMAPINFOHEADER); 488 *bytes_in_resource = masks_size + sizeof(BITMAPINFOHEADER);
489 } 489 }
OLDNEW
« no previous file with comments | « gfx/icon_util.h ('k') | gfx/icon_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698