Call GdiAlphaBlend directly instead of the AlphaBlend wrapper in msimg32.dll. The wrapper does a few additional santity checks, which I presume GdiAlphaBlend will have to handle anyway. This means we don't depend on msimg32.dll anymore.
Review URL: http://codereview.chromium.org/7813 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3656 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@ -317,8 +317,8 @@ void Clipboard::WriteBitmapFromHandle(HBITMAP source_hbitmap,
|
||||
|
||||
// Now we need to blend it into an HBITMAP we can place on the clipboard
|
||||
BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
|
||||
::AlphaBlend(compatible_dc, 0, 0, size.width(), size.height(),
|
||||
source_dc, 0, 0, size.width(), size.height(), bf);
|
||||
::GdiAlphaBlend(compatible_dc, 0, 0, size.width(), size.height(),
|
||||
source_dc, 0, 0, size.width(), size.height(), bf);
|
||||
|
||||
// Clean up all the handles we just opened
|
||||
::SelectObject(compatible_dc, old_hbitmap);
|
||||
|
@ -376,18 +376,19 @@ void BitmapPlatformDeviceWin::drawToHDC(HDC dc, int x, int y,
|
||||
src_rect->top,
|
||||
SRCCOPY);
|
||||
} else {
|
||||
DCHECK(copy_width != 0 && copy_height != 0);
|
||||
BLENDFUNCTION blend_function = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
|
||||
AlphaBlend(dc,
|
||||
x,
|
||||
y,
|
||||
copy_width,
|
||||
copy_height,
|
||||
source_dc,
|
||||
src_rect->left,
|
||||
src_rect->top,
|
||||
copy_width,
|
||||
copy_height,
|
||||
blend_function);
|
||||
GdiAlphaBlend(dc,
|
||||
x,
|
||||
y,
|
||||
copy_width,
|
||||
copy_height,
|
||||
source_dc,
|
||||
src_rect->left,
|
||||
src_rect->top,
|
||||
copy_width,
|
||||
copy_height,
|
||||
blend_function);
|
||||
}
|
||||
LoadTransformToDC(source_dc, data_->transform());
|
||||
|
||||
|
@ -583,13 +583,13 @@ void VectorDevice::InternalDrawBitmap(const SkBitmap& bitmap, int x, int y,
|
||||
DCHECK(result);
|
||||
// Note that this function expect premultiplied colors (!)
|
||||
BLENDFUNCTION blend_function = {AC_SRC_OVER, 0, alpha, AC_SRC_ALPHA};
|
||||
result = AlphaBlend(dc,
|
||||
x, y, // Destination origin.
|
||||
src_size_x, src_size_y, // Destination size.
|
||||
bitmap_dc,
|
||||
0, 0, // Source origin.
|
||||
src_size_x, src_size_y, // Source size.
|
||||
blend_function);
|
||||
result = GdiAlphaBlend(dc,
|
||||
x, y, // Destination origin.
|
||||
src_size_x, src_size_y, // Destination size.
|
||||
bitmap_dc,
|
||||
0, 0, // Source origin.
|
||||
src_size_x, src_size_y, // Source size.
|
||||
blend_function);
|
||||
DCHECK(result);
|
||||
result = SetStretchBltMode(dc, previous_mode);
|
||||
DCHECK(result);
|
||||
|
@ -4,7 +4,6 @@ dependents = [
|
||||
'KERNEL32.dll',
|
||||
'USER32.dll',
|
||||
'ADVAPI32.dll',
|
||||
'MSIMG32.dll',
|
||||
'WINMM.dll',
|
||||
'COMCTL32.dll',
|
||||
'SHLWAPI.dll',
|
||||
@ -31,4 +30,3 @@ delay_loaded = [
|
||||
'COMDLG32.dll',
|
||||
'urlmon.dll',
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user