summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2014-07-08 16:42:00 -0700
committerLei Zhang <thestig@chromium.org>2014-07-08 16:42:00 -0700
commit95c018e2d15ecc3a5bd2a9aab18638316a6d3d46 (patch)
tree747432f08c77119a2600038a4368f2d3dcdf22c9 /fpdfsdk/src/fpdfview.cpp
parent3522876d5291922ddc62bf1b70d02743b0850673 (diff)
downloadpdfium-95c018e2d15ecc3a5bd2a9aab18638316a6d3d46.tar.xz
Fixes for re-enabling more MSVC level 4 warnings: pdfium/ edition
This contains fixes for the following sorts of issues: * Nonstandard extension: unnamed struct/union This also changes the signature of FPDF_FillRect() to enable the cleanest possible changes in https://codereview.chromium.org/372273005 . BUG=81439 TEST=none Original patch by Peter Kasting <pkasting@chromium.org> Original code review: https://codereview.chromium.org/376003003/ R=pkasting@chromium.org Review URL: https://codereview.chromium.org/372383004
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r--fpdfsdk/src/fpdfview.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 10eaf5d980..a9aa9a8ff2 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -725,8 +725,7 @@ DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, int height, int for
return pBitmap;
}
-DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top, int width, int height,
- int red, int green, int blue, int alpha)
+DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top, int width, int height, FPDF_DWORD color)
{
if (bitmap == NULL) return;
#ifdef _SKIA_SUPPORT_
@@ -735,9 +734,9 @@ DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top
CFX_FxgeDevice device;
#endif
device.Attach((CFX_DIBitmap*)bitmap);
- if (!((CFX_DIBitmap*)bitmap)->HasAlpha()) alpha = 255;
+ if (!((CFX_DIBitmap*)bitmap)->HasAlpha()) color |= 0xFF000000;
FX_RECT rect(left, top, left+width, top+height);
- device.FillRect(&rect, FXARGB_MAKE(alpha, red, green, blue));
+ device.FillRect(&rect, color);
}
DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap)