summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_progressive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdf_progressive.cpp')
-rw-r--r--fpdfsdk/fpdf_progressive.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp
index c66807cc91..efde1eb029 100644
--- a/fpdfsdk/fpdf_progressive.cpp
+++ b/fpdfsdk/fpdf_progressive.cpp
@@ -42,13 +42,10 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap,
CRenderContext* pContext = new CRenderContext;
pPage->SetRenderContext(std::unique_ptr<CFX_Deletable>(pContext));
- pContext->m_pDevice = new CFX_FxgeDevice;
- if (flags & FPDF_REVERSE_BYTE_ORDER) {
- ((CFX_FxgeDevice*)pContext->m_pDevice)
- ->Attach((CFX_DIBitmap*)bitmap, 0, TRUE);
- } else {
- ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
- }
+ CFX_FxgeDevice* pDevice = new CFX_FxgeDevice;
+ pContext->m_pDevice = pDevice;
+ CFX_DIBitmap* pBitmap = CFXBitmapFromFPDFBitmap(bitmap);
+ pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
IFSDK_PAUSE_Adapter IPauseAdapter(pause);
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,