summaryrefslogtreecommitdiff
path: root/core/fxge/win32
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-15 14:59:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-15 14:59:47 +0000
commit0202adeb5a042ca43f29439ef59e7bc3d4f8268f (patch)
treed612d7c7be4cfd8dabb654f593a807fc1b545390 /core/fxge/win32
parentd1ffda2acaee90a7b8a6dd36e0605dce826058e9 (diff)
downloadpdfium-0202adeb5a042ca43f29439ef59e7bc3d4f8268f.tar.xz
Fix a red-blue channel flip when rendering masks to EMF.
Use BGR instead of RGB in CGdiDeviceDriver::GDI_StretchBitMask(). Many win32 GDI APIs take COLORREF as input, and COLORREF is BGR. In this case, a win32 API was being called with RGB data. BUG=chromium:821672 Change-Id: Ia530c7ef5582eed13ac7119935851cfe0ad57323 Reviewed-on: https://pdfium-review.googlesource.com/28573 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxge/win32')
-rw-r--r--core/fxge/win32/fx_win32_device.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index e20c765535..ec0ed3561d 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -882,7 +882,7 @@ bool CGdiDeviceDriver::GDI_StretchBitMask(
bmi.bmiColors[0] = 0xffffff;
bmi.bmiColors[1] = 0;
- HBRUSH hPattern = CreateSolidBrush(bitmap_color & 0xffffff);
+ HBRUSH hPattern = CreateBrush(bitmap_color);
HBRUSH hOld = (HBRUSH)SelectObject(m_hDC, hPattern);
// In PDF, when image mask is 1, use device bitmap; when mask is 0, use brush