From a5085d45e8288a7ed7af24fc9134d07cbc56e9dc Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 11 May 2017 16:26:50 -0400 Subject: Rename render device classes This Cl renames the CFX_RenderDevice subclasses to make their usage clearer. Change-Id: Ie820b57df9a3743ce8c6893fb483b398a1f1bdbe Reviewed-on: https://pdfium-review.googlesource.com/5390 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/fpdf_progressive.cpp | 6 +++--- fpdfsdk/fpdfformfill.cpp | 4 ++-- fpdfsdk/fpdfview.cpp | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp index 927bcddd09..fc6ceab38e 100644 --- a/fpdfsdk/fpdf_progressive.cpp +++ b/fpdfsdk/fpdf_progressive.cpp @@ -12,7 +12,7 @@ #include "core/fpdfapi/page/cpdf_page.h" #include "core/fpdfapi/render/cpdf_progressiverenderer.h" #include "core/fxcrt/fx_memory.h" -#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_defaultrenderdevice.h" #include "core/fxge/cfx_renderdevice.h" #include "fpdfsdk/fsdk_define.h" #include "fpdfsdk/fsdk_pauseadapter.h" @@ -51,8 +51,8 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, pPage->SetRenderContext(std::move(pOwnedContext)); CFX_RetainPtr pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); - auto pOwnedDevice = pdfium::MakeUnique(); - CFX_FxgeDevice* pDevice = pOwnedDevice.get(); + auto pOwnedDevice = pdfium::MakeUnique(); + CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get(); pContext->m_pDevice = std::move(pOwnedDevice); pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false); diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index a050dc0161..de200cf7bb 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -16,7 +16,7 @@ #include "core/fpdfdoc/cpdf_formfield.h" #include "core/fpdfdoc/cpdf_interform.h" #include "core/fpdfdoc/cpdf_occontext.h" -#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_defaultrenderdevice.h" #include "fpdfsdk/cpdfsdk_formfillenvironment.h" #include "fpdfsdk/cpdfsdk_interform.h" #include "fpdfsdk/cpdfsdk_pageview.h" @@ -109,7 +109,7 @@ void FFLCommon(FPDF_FORMHANDLE hHandle, pPage->GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate); FX_RECT clip(start_x, start_y, start_x + size_x, start_y + size_y); - auto pDevice = pdfium::MakeUnique(); + auto pDevice = pdfium::MakeUnique(); #ifdef _SKIA_SUPPORT_ pDevice->AttachRecorder(static_cast(recorder)); #endif diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index bda9111b95..5fb963abd3 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -28,7 +28,7 @@ #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_safe_types.h" -#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_defaultrenderdevice.h" #include "core/fxge/cfx_gemodule.h" #include "fpdfsdk/cpdfsdk_formfillenvironment.h" #include "fpdfsdk/cpdfsdk_pageview.h" @@ -50,7 +50,7 @@ #endif // PDF_ENABLE_XFA #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ -#include "core/fxge/cfx_windowsdevice.h" +#include "core/fxge/cfx_windowsrenderdevice.h" #endif namespace { @@ -807,7 +807,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, pBitmap = pdfium::MakeRetain(); pBitmap->Create(size_x, size_y, FXDIB_Argb); pBitmap->Clear(0x00ffffff); - CFX_FxgeDevice* pDevice = new CFX_FxgeDevice; + CFX_DefaultRenderDevice* pDevice = new CFX_DefaultRenderDevice; pContext->m_pDevice = pdfium::WrapUnique(pDevice); pDevice->Attach(pBitmap, false, nullptr, false); if (bHasMask) { @@ -815,7 +815,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, pContext->m_pOptions->m_Flags |= RENDER_BREAKFORMASKS; } } else { - pContext->m_pDevice = pdfium::MakeUnique(dc); + pContext->m_pDevice = pdfium::MakeUnique(dc); } FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y, @@ -842,7 +842,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, // pause after each image mask. pPage->SetRenderContext(pdfium::MakeUnique()); pContext = pPage->GetRenderContext(); - pContext->m_pDevice = pdfium::MakeUnique(dc); + pContext->m_pDevice = pdfium::MakeUnique(dc); pContext->m_pOptions = pdfium::MakeUnique(); pContext->m_pOptions->m_Flags |= RENDER_BREAKFORMASKS; FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y, @@ -858,7 +858,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, pContext->m_pRenderer->Continue(nullptr); } } else if (bNewBitmap) { - CFX_WindowsDevice WinDC(dc); + CFX_WindowsRenderDevice WinDC(dc); if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) { auto pDst = pdfium::MakeRetain(); int pitch = pBitmap->GetPitch(); @@ -894,7 +894,7 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, CPDF_PageRenderContext* pContext = new CPDF_PageRenderContext; pPage->SetRenderContext(pdfium::WrapUnique(pContext)); - CFX_FxgeDevice* pDevice = new CFX_FxgeDevice; + CFX_DefaultRenderDevice* pDevice = new CFX_DefaultRenderDevice; pContext->m_pDevice.reset(pDevice); CFX_RetainPtr pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); @@ -924,7 +924,7 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, CPDF_PageRenderContext* pContext = new CPDF_PageRenderContext; pPage->SetRenderContext(pdfium::WrapUnique(pContext)); - CFX_FxgeDevice* pDevice = new CFX_FxgeDevice; + CFX_DefaultRenderDevice* pDevice = new CFX_DefaultRenderDevice; pContext->m_pDevice.reset(pDevice); CFX_RetainPtr pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); @@ -959,7 +959,7 @@ DLLEXPORT FPDF_RECORDER STDCALL FPDF_RenderPageSkp(FPDF_PAGE page, CPDF_PageRenderContext* pContext = new CPDF_PageRenderContext; pPage->SetRenderContext(pdfium::WrapUnique(pContext)); - CFX_FxgeDevice* skDevice = new CFX_FxgeDevice; + CFX_DefaultRenderDevice* skDevice = new CFX_DefaultRenderDevice; FPDF_RECORDER recorder = skDevice->CreateRecorder(size_x, size_y); pContext->m_pDevice.reset(skDevice); FPDF_RenderPage_Retail(pContext, page, 0, 0, size_x, size_y, 0, 0, true, @@ -1114,7 +1114,7 @@ DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, if (!bitmap) return; - CFX_FxgeDevice device; + CFX_DefaultRenderDevice device; CFX_RetainPtr pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); device.Attach(pBitmap, false, nullptr, false); if (!pBitmap->HasAlpha()) -- cgit v1.2.3