Home | History | Annotate | Download | only in gfx

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.config() != SkBitmap::kARGB_8888_Config) ||
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.config() != SkBitmap::kARGB_8888_Config) ||
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());
187 memcpy(bits, bitmap.getPixels(), bitmap.width() * bitmap.height() * 4);
192 // mask bitmap has an alpha channel, the AND monochrome bitmap won't
194 // bitmap has an alpha channel, Windows might not agree when all alpha values
195 // are zero. So the monochrome bitmap is created with all pixels transparent
198 static_cast<const uint32*>(bitmap.getPixels()),
199 bitmap.width() * bitmap.height());
204 size_t bytes_per_line = (bitmap.width() + 0xF) / 16 * 2;
205 size_t mask_bits_size = bytes_per_line * bitmap.height();
214 HBITMAP mono_bitmap = ::CreateBitmap(bitmap.width(), bitmap.height(), 1, 1,
253 scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon_handle));
255 return bitmap.Pass();
305 BITMAP bitmap_info = { 0 };
373 // bitmap so we should set the configuration appropriately.
374 SkBitmap bitmap;
375 bitmap.setConfig(SkBitmap::kARGB_8888_Config, s.width(), s.height());
376 bitmap.allocPixels();
377 bitmap.eraseARGB(0, 0, 0, 0);
378 SkAutoLockPixels bitmap_lock(bitmap);
395 // represents the icon image and an AND mask which is a monochrome bitmap
398 // To make things more complex, the icon image itself can be an ARGB bitmap
401 // or not a bitmap has an alpha channel and therefore constructing the bitmap
406 // bitmap has an alpha channel is by looking through the pixels and checking
414 // Capture boolean opacity. We may not use it if we find out the bitmap has
423 memcpy(bitmap.getPixels(), static_cast<void*>(bits), num_pixels * 4);
425 // Finding out whether the bitmap has an alpha channel.
427 bitmap.getPixels()), num_pixels);
429 // If the bitmap does not have an alpha channel, we need to build it using
432 uint32* p = static_cast<uint32*>(bitmap.getPixels());
446 return bitmap;
454 // storing in the icon file. Each bitmap is created by resizing the most
481 // bitmap set and then we set the bitmap specific structures. In the latter
542 // Initializing the bitmap format to 32 bit ARGB.
560 void IconUtil::SetSingleIconImageInformation(const SkBitmap& bitmap,
570 DCHECK_LT(bitmap.width(), kLargeIconSize);
571 DCHECK_LT(bitmap.height(), kLargeIconSize);
575 ComputeBitmapSizeComponents(bitmap,
579 icon_dir->idEntries[index].bWidth = static_cast<BYTE>(bitmap.width());
580 icon_dir->idEntries[index].bHeight = static_cast<BYTE>(bitmap.height());
588 // of both the AND mask and the XOR mask so we need to multiply the bitmap's
590 icon_image->icHeader.biHeight = bitmap.height() * 2;
591 icon_image->icHeader.biWidth = bitmap.width();
598 // orientation (bottom-up vs. top-down) of a bitmap residing in a .ico file.
599 // Thus, if we just copy the bits, we'll end up with a bottom up bitmap in
612 CopySkBitmapBitsIntoIconBuffer(bitmap, xor_mask_addr, xor_mask_size);
616 void IconUtil::CopySkBitmapBitsIntoIconBuffer(const SkBitmap& bitmap,
619 SkAutoLockPixels bitmap_lock(bitmap);
620 unsigned char* bitmap_ptr = static_cast<unsigned char*>(bitmap.getPixels());
621 size_t bitmap_size = bitmap.height() * bitmap.width() * 4;
623 for (size_t i = 0; i < bitmap_size; i += bitmap.width() * 4) {
624 memcpy(buffer + bitmap_size - bitmap.width() * 4 - i,
626 bitmap.width() * 4);
643 // Add the bitmap specific structure sizes.
654 void IconUtil::ComputeBitmapSizeComponents(const SkBitmap& bitmap,
659 *xor_mask_size = bitmap.width() * bitmap.height() * 4;
662 // bitmap (regardless of the number of bits per pixels used in the XOR mask).
681 // for the monochrome bitmap representing the AND mask.
682 size_t and_line_length = (bitmap.width() + 7) >> 3;
684 size_t and_mask_size = and_line_length * bitmap.height();