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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include "skia/ext/vector_platform_device_emf_win.h" | 7 #include "skia/ext/vector_platform_device_emf_win.h" |
8 | 8 |
9 #include "skia/ext/bitmap_platform_device.h" | 9 #include "skia/ext/bitmap_platform_device.h" |
10 #include "skia/ext/skia_utils_win.h" | 10 #include "skia/ext/skia_utils_win.h" |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 memset(&bitmap_header, 0, sizeof(BITMAPV4HEADER)); | 771 memset(&bitmap_header, 0, sizeof(BITMAPV4HEADER)); |
772 FillBitmapInfoHeader(src_size_x, src_size_y, | 772 FillBitmapInfoHeader(src_size_x, src_size_y, |
773 reinterpret_cast<BITMAPINFOHEADER*>(&bitmap_header)); | 773 reinterpret_cast<BITMAPINFOHEADER*>(&bitmap_header)); |
774 bitmap_header.bV4Size = sizeof(BITMAPV4HEADER); | 774 bitmap_header.bV4Size = sizeof(BITMAPV4HEADER); |
775 bitmap_header.bV4RedMask = 0x00ff0000; | 775 bitmap_header.bV4RedMask = 0x00ff0000; |
776 bitmap_header.bV4GreenMask = 0x0000ff00; | 776 bitmap_header.bV4GreenMask = 0x0000ff00; |
777 bitmap_header.bV4BlueMask = 0x000000ff; | 777 bitmap_header.bV4BlueMask = 0x000000ff; |
778 bitmap_header.bV4AlphaMask = 0xff000000; | 778 bitmap_header.bV4AlphaMask = 0xff000000; |
779 | 779 |
780 SkAutoLockPixels lock(bitmap); | 780 SkAutoLockPixels lock(bitmap); |
781 SkASSERT(bitmap.getConfig() == SkBitmap::kARGB_8888_Config); | 781 SkASSERT(bitmap.config() == SkBitmap::kARGB_8888_Config); |
782 const uint32_t* pixels = static_cast<const uint32_t*>(bitmap.getPixels()); | 782 const uint32_t* pixels = static_cast<const uint32_t*>(bitmap.getPixels()); |
783 if (pixels == NULL) { | 783 if (pixels == NULL) { |
784 SkASSERT(false); | 784 SkASSERT(false); |
785 return; | 785 return; |
786 } | 786 } |
787 | 787 |
788 if (!is_translucent) { | 788 if (!is_translucent) { |
789 int row_length = bitmap.rowBytesAsPixels(); | 789 int row_length = bitmap.rowBytesAsPixels(); |
790 // There is no quick way to determine if an image is opaque. | 790 // There is no quick way to determine if an image is opaque. |
791 for (int y2 = 0; y2 < src_size_y; ++y2) { | 791 for (int y2 = 0; y2 < src_size_y; ++y2) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 pixels, | 862 pixels, |
863 reinterpret_cast<const BITMAPINFO*>(&hdr), | 863 reinterpret_cast<const BITMAPINFO*>(&hdr), |
864 DIB_RGB_COLORS, | 864 DIB_RGB_COLORS, |
865 SRCCOPY); | 865 SRCCOPY); |
866 } | 866 } |
867 EndPlatformPaint(); | 867 EndPlatformPaint(); |
868 Cleanup(); | 868 Cleanup(); |
869 } | 869 } |
870 | 870 |
871 } // namespace skia | 871 } // namespace skia |
OLD | NEW |