diff options
author | thestig <thestig@chromium.org> | 2016-05-26 20:15:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-26 20:15:19 -0700 |
commit | befa4506dc9d2a679c526aff96c09bcb0e9daecb (patch) | |
tree | 3c1d3e11d9802b2db95e35f4ab81ff449492ee10 /core/fpdfapi/fpdf_render/fpdf_render_image.cpp | |
parent | 7aed76f53137a71491040c776ab2f8931e91061b (diff) | |
download | pdfium-befa4506dc9d2a679c526aff96c09bcb0e9daecb.tar.xz |
Remove default arguments from CFX_FxgeDevice.
Remove unused dithering code.
Review-Url: https://codereview.chromium.org/2010813003
Diffstat (limited to 'core/fpdfapi/fpdf_render/fpdf_render_image.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render_image.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp index f7e57c0fa6..d3fbb7990c 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -523,9 +523,9 @@ FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) { int width = rect.Width(); int height = rect.Height(); CFX_FxgeDevice bitmap_device1; - if (!bitmap_device1.Create(rect.Width(), rect.Height(), FXDIB_Rgb32)) { + if (!bitmap_device1.Create(rect.Width(), rect.Height(), FXDIB_Rgb32, nullptr)) return TRUE; - } + bitmap_device1.GetBitmap()->Clear(0xffffff); { CPDF_RenderStatus bitmap_render; @@ -545,7 +545,8 @@ FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) { } { CFX_FxgeDevice bitmap_device2; - if (!bitmap_device2.Create(rect.Width(), rect.Height(), FXDIB_8bppRgb)) { + if (!bitmap_device2.Create(rect.Width(), rect.Height(), FXDIB_8bppRgb, + nullptr)) { return TRUE; } bitmap_device2.GetBitmap()->Clear(0); @@ -621,9 +622,9 @@ FX_BOOL CPDF_ImageRenderer::DrawMaskedImage() { int width = rect.Width(); int height = rect.Height(); CFX_FxgeDevice bitmap_device1; - if (!bitmap_device1.Create(width, height, FXDIB_Rgb32)) { + if (!bitmap_device1.Create(width, height, FXDIB_Rgb32, nullptr)) return TRUE; - } + bitmap_device1.GetBitmap()->Clear(0xffffff); { CPDF_RenderStatus bitmap_render; @@ -638,9 +639,9 @@ FX_BOOL CPDF_ImageRenderer::DrawMaskedImage() { } { CFX_FxgeDevice bitmap_device2; - if (!bitmap_device2.Create(width, height, FXDIB_8bppRgb)) { + if (!bitmap_device2.Create(width, height, FXDIB_8bppRgb, nullptr)) return TRUE; - } + bitmap_device2.GetBitmap()->Clear(0); CPDF_RenderStatus bitmap_render; bitmap_render.Initialize(m_pRenderStatus->m_pContext, &bitmap_device2, NULL, @@ -900,17 +901,15 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict, FX_BOOL bLuminosity = pSMaskDict->GetStringBy("S") != "Alpha"; int width = pClipRect->right - pClipRect->left; int height = pClipRect->bottom - pClipRect->top; + FXDIB_Format format; #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - if (!bitmap_device.Create(width, height, - bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask)) { - return NULL; - } + format = bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask; #else - if (!bitmap_device.Create(width, height, - bLuminosity ? FXDIB_Rgb : FXDIB_8bppMask)) { - return NULL; - } + format = bLuminosity ? FXDIB_Rgb : FXDIB_8bppMask; #endif + if (!bitmap_device.Create(width, height, format, nullptr)) + return nullptr; + CFX_DIBitmap& bitmap = *bitmap_device.GetBitmap(); CPDF_Object* pCSObj = NULL; CPDF_ColorSpace* pCS = NULL; |