Lines Matching refs:bitmap

117     SkBitmap bitmap = image.AsBitmap();
119 // Only 32 bit ARGB bitmaps are supported. We also make sure the bitmap has
121 SkAutoLockPixels bitmap_lock(bitmap);
122 if ((bitmap.colorType() != kN32_SkColorType) ||
123 (bitmap.getPixels() == NULL)) {
132 bitmaps->push_back(bitmap);
165 HICON IconUtil::CreateHICONFromSkBitmap(const SkBitmap& bitmap) {
167 // validations as we can on the bitmap.
168 SkAutoLockPixels bitmap_lock(bitmap);
169 if ((bitmap.colorType() != kN32_SkColorType) ||
170 (bitmap.width() <= 0) || (bitmap.height() <= 0) ||
171 (bitmap.getPixels() == NULL))
175 // the HICON. We use BITMAPV5HEADER since the bitmap we are about to convert
179 InitializeBitmapHeader(&bitmap_header, bitmap.width(), bitmap.height());
192 memcpy(bits, bitmap.getPixels(), bitmap.width() * bitmap.height() * 4);
197 // mask bitmap has an alpha channel, the AND monochrome bitmap won't
199 // bitmap has an alpha channel, Windows might not agree when all alpha values
200 // are zero. So the monochrome bitmap is created with all pixels transparent
203 static_cast<const uint32*>(bitmap.getPixels()),
204 bitmap.width() * bitmap.height());
209 size_t bytes_per_line = (bitmap.width() + 0xF) / 16 * 2;
210 size_t mask_bits_size = bytes_per_line * bitmap.height();
219 HBITMAP mono_bitmap = ::CreateBitmap(bitmap.width(), bitmap.height(), 1, 1,
258 scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon_handle));
260 return bitmap.Pass();
377 // bitmap so we should set the configuration appropriately.
378 SkBitmap bitmap;
379 bitmap.allocN32Pixels(s.width(), s.height());
380 bitmap.eraseARGB(0, 0, 0, 0);
381 SkAutoLockPixels bitmap_lock(bitmap);
398 // represents the icon image and an AND mask which is a monochrome bitmap
401 // To make things more complex, the icon image itself can be an ARGB bitmap
404 // or not a bitmap has an alpha channel and therefore constructing the bitmap
409 // bitmap has an alpha channel is by looking through the pixels and checking
417 // Capture boolean opacity. We may not use it if we find out the bitmap has
426 memcpy(bitmap.getPixels(), static_cast<void*>(bits), num_pixels * 4);
428 // Finding out whether the bitmap has an alpha channel.
430 static_cast<const uint32*>(bitmap.getPixels()), num_pixels);
432 // If the bitmap does not have an alpha channel, we need to build it using
435 uint32* p = static_cast<uint32*>(bitmap.getPixels());
449 return bitmap;
457 // storing in the icon file. Each bitmap is created by resizing the most
484 // bitmap set and then we set the bitmap specific structures. In the latter
545 // Initializing the bitmap format to 32 bit ARGB.
563 void IconUtil::SetSingleIconImageInformation(const SkBitmap& bitmap,
573 DCHECK_LT(bitmap.width(), kLargeIconSize);
574 DCHECK_LT(bitmap.height(), kLargeIconSize);
578 ComputeBitmapSizeComponents(bitmap,
582 icon_dir->idEntries[index].bWidth = static_cast<BYTE>(bitmap.width());
583 icon_dir->idEntries[index].bHeight = static_cast<BYTE>(bitmap.height());
591 // of both the AND mask and the XOR mask so we need to multiply the bitmap's
593 icon_image->icHeader.biHeight = bitmap.height() * 2;
594 icon_image->icHeader.biWidth = bitmap.width();
601 // orientation (bottom-up vs. top-down) of a bitmap residing in a .ico file.
602 // Thus, if we just copy the bits, we'll end up with a bottom up bitmap in
615 CopySkBitmapBitsIntoIconBuffer(bitmap, xor_mask_addr, xor_mask_size);
619 void IconUtil::CopySkBitmapBitsIntoIconBuffer(const SkBitmap& bitmap,
622 SkAutoLockPixels bitmap_lock(bitmap);
623 unsigned char* bitmap_ptr = static_cast<unsigned char*>(bitmap.getPixels());
624 size_t bitmap_size = bitmap.height() * bitmap.width() * 4;
626 for (size_t i = 0; i < bitmap_size; i += bitmap.width() * 4) {
627 memcpy(buffer + bitmap_size - bitmap.width() * 4 - i,
629 bitmap.width() * 4);
646 // Add the bitmap specific structure sizes.
657 void IconUtil::ComputeBitmapSizeComponents(const SkBitmap& bitmap,
662 *xor_mask_size = bitmap.width() * bitmap.height() * 4;
665 // bitmap (regardless of the number of bits per pixels used in the XOR mask).
684 // for the monochrome bitmap representing the AND mask.
685 size_t and_line_length = (bitmap.width() + 7) >> 3;
687 size_t and_mask_size = and_line_length * bitmap.height();