diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-05-11 16:26:50 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-11 20:44:14 +0000 |
commit | a5085d45e8288a7ed7af24fc9134d07cbc56e9dc (patch) | |
tree | c6594c39a762cc4d663c23424112b55d93abf521 /core/fxge | |
parent | e6324fa7137fa224daa397464293e0c74e1c68ce (diff) | |
download | pdfium-a5085d45e8288a7ed7af24fc9134d07cbc56e9dc.tar.xz |
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 <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge')
-rw-r--r-- | core/fxge/agg/fx_agg_driver.cpp | 24 | ||||
-rw-r--r-- | core/fxge/cfx_defaultrenderdevice.h (renamed from core/fxge/cfx_fxgedevice.h) | 12 | ||||
-rw-r--r-- | core/fxge/cfx_windowsrenderdevice.h (renamed from core/fxge/cfx_windowsdevice.h) | 12 | ||||
-rw-r--r-- | core/fxge/ge/cfx_renderdevice.cpp | 4 | ||||
-rw-r--r-- | core/fxge/skia/fx_skia_device.cpp | 35 | ||||
-rw-r--r-- | core/fxge/skia/fx_skia_device_unittest.cpp | 6 | ||||
-rw-r--r-- | core/fxge/win32/fx_win32_device.cpp | 8 | ||||
-rw-r--r-- | core/fxge/win32/fx_win32_print.cpp | 2 |
8 files changed, 54 insertions, 49 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 128d50c6e6..08a6e09324 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp @@ -10,7 +10,7 @@ #include <utility> #include "core/fxcodec/fx_codec.h" -#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_defaultrenderdevice.h" #include "core/fxge/cfx_gemodule.h" #include "core/fxge/cfx_graphstatedata.h" #include "core/fxge/cfx_pathdata.h" @@ -1561,14 +1561,15 @@ bool CFX_AggDeviceDriver::ContinueDIBits(CFX_ImageRenderer* pHandle, } #ifndef _SKIA_SUPPORT_ -CFX_FxgeDevice::CFX_FxgeDevice() {} +CFX_DefaultRenderDevice::CFX_DefaultRenderDevice() {} -CFX_FxgeDevice::~CFX_FxgeDevice() {} +CFX_DefaultRenderDevice::~CFX_DefaultRenderDevice() {} -bool CFX_FxgeDevice::Attach(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, - bool bRgbByteOrder, - const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice, - bool bGroupKnockout) { +bool CFX_DefaultRenderDevice::Attach( + const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, + bool bRgbByteOrder, + const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice, + bool bGroupKnockout) { if (!pBitmap) return false; @@ -1578,10 +1579,11 @@ bool CFX_FxgeDevice::Attach(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, return true; } -bool CFX_FxgeDevice::Create(int width, - int height, - FXDIB_Format format, - const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice) { +bool CFX_DefaultRenderDevice::Create( + int width, + int height, + FXDIB_Format format, + const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice) { auto pBitmap = pdfium::MakeRetain<CFX_DIBitmap>(); if (!pBitmap->Create(width, height, format)) return false; diff --git a/core/fxge/cfx_fxgedevice.h b/core/fxge/cfx_defaultrenderdevice.h index 4e8a7f4f55..e2dc1f3859 100644 --- a/core/fxge/cfx_fxgedevice.h +++ b/core/fxge/cfx_defaultrenderdevice.h @@ -4,18 +4,18 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#ifndef CORE_FXGE_CFX_FXGEDEVICE_H_ -#define CORE_FXGE_CFX_FXGEDEVICE_H_ +#ifndef CORE_FXGE_CFX_DEFAULTRENDERDEVICE_H_ +#define CORE_FXGE_CFX_DEFAULTRENDERDEVICE_H_ #include "core/fxge/cfx_renderdevice.h" #include "core/fxge/fx_dib.h" class SkPictureRecorder; -class CFX_FxgeDevice : public CFX_RenderDevice { +class CFX_DefaultRenderDevice : public CFX_RenderDevice { public: - CFX_FxgeDevice(); - ~CFX_FxgeDevice() override; + CFX_DefaultRenderDevice(); + ~CFX_DefaultRenderDevice() override; bool Attach(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, bool bRgbByteOrder, @@ -40,4 +40,4 @@ class CFX_FxgeDevice : public CFX_RenderDevice { #endif }; -#endif // CORE_FXGE_CFX_FXGEDEVICE_H_ +#endif // CORE_FXGE_CFX_DEFAULTRENDERDEVICE_H_ diff --git a/core/fxge/cfx_windowsdevice.h b/core/fxge/cfx_windowsrenderdevice.h index 2d17cb7dd8..7156dcdc4e 100644 --- a/core/fxge/cfx_windowsdevice.h +++ b/core/fxge/cfx_windowsrenderdevice.h @@ -4,8 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#ifndef CORE_FXGE_CFX_WINDOWSDEVICE_H_ -#define CORE_FXGE_CFX_WINDOWSDEVICE_H_ +#ifndef CORE_FXGE_CFX_WINDOWSRENDERDEVICE_H_ +#define CORE_FXGE_CFX_WINDOWSRENDERDEVICE_H_ #ifdef _WIN32 #ifndef _WINDOWS_ @@ -27,14 +27,14 @@ extern PDFiumEnsureTypefaceCharactersAccessible #endif extern int g_pdfium_print_postscript_level; -class CFX_WindowsDevice : public CFX_RenderDevice { +class CFX_WindowsRenderDevice : public CFX_RenderDevice { public: static IFX_RenderDeviceDriver* CreateDriver(HDC hDC); - explicit CFX_WindowsDevice(HDC hDC); - ~CFX_WindowsDevice() override; + explicit CFX_WindowsRenderDevice(HDC hDC); + ~CFX_WindowsRenderDevice() override; }; #endif // _WIN32 -#endif // CORE_FXGE_CFX_WINDOWSDEVICE_H_ +#endif // CORE_FXGE_CFX_WINDOWSRENDERDEVICE_H_ diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp index 6a3f9c7f1c..d2924bb13c 100644 --- a/core/fxge/ge/cfx_renderdevice.cpp +++ b/core/fxge/ge/cfx_renderdevice.cpp @@ -12,8 +12,8 @@ #include <vector> #include "core/fxcrt/fx_safe_types.h" +#include "core/fxge/cfx_defaultrenderdevice.h" #include "core/fxge/cfx_facecache.h" -#include "core/fxge/cfx_fxgedevice.h" #include "core/fxge/cfx_graphstatedata.h" #include "core/fxge/cfx_pathdata.h" #include "core/fxge/dib/cfx_imagerenderer.h" @@ -626,7 +626,7 @@ bool CFX_RenderDevice::DrawFillStrokePath(const CFX_PathData* pPathData, return false; Backdrop->Copy(bitmap); } - CFX_FxgeDevice bitmap_device; + CFX_DefaultRenderDevice bitmap_device; bitmap_device.Attach(bitmap, false, Backdrop, true); CFX_Matrix matrix; diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 3ca022b706..e4d580d089 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -14,7 +14,7 @@ #include "core/fpdfapi/parser/cpdf_stream_acc.h" #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/fx_memory.h" -#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/cfx_defaultrenderdevice.h" #include "core/fxge/cfx_gemodule.h" #include "core/fxge/cfx_graphstatedata.h" #include "core/fxge/cfx_pathdata.h" @@ -2331,26 +2331,28 @@ void CFX_SkiaDeviceDriver::DebugVerifyBitmapIsPreMultiplied() const { } #endif // _SKIA_SUPPORT_ -CFX_FxgeDevice::CFX_FxgeDevice() {} +CFX_DefaultRenderDevice::CFX_DefaultRenderDevice() {} #ifdef _SKIA_SUPPORT_ -void CFX_FxgeDevice::Clear(uint32_t color) { +void CFX_DefaultRenderDevice::Clear(uint32_t color) { CFX_SkiaDeviceDriver* skDriver = static_cast<CFX_SkiaDeviceDriver*>(GetDeviceDriver()); skDriver->Clear(color); } -SkPictureRecorder* CFX_FxgeDevice::CreateRecorder(int size_x, int size_y) { +SkPictureRecorder* CFX_DefaultRenderDevice::CreateRecorder(int size_x, + int size_y) { CFX_SkiaDeviceDriver* skDriver = new CFX_SkiaDeviceDriver(size_x, size_y); SetDeviceDriver(pdfium::WrapUnique(skDriver)); return skDriver->GetRecorder(); } #endif // _SKIA_SUPPORT_ -bool CFX_FxgeDevice::Attach(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, - bool bRgbByteOrder, - const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice, - bool bGroupKnockout) { +bool CFX_DefaultRenderDevice::Attach( + const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, + bool bRgbByteOrder, + const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice, + bool bGroupKnockout) { if (!pBitmap) return false; SetBitmap(pBitmap); @@ -2360,7 +2362,7 @@ bool CFX_FxgeDevice::Attach(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, } #ifdef _SKIA_SUPPORT_ -bool CFX_FxgeDevice::AttachRecorder(SkPictureRecorder* recorder) { +bool CFX_DefaultRenderDevice::AttachRecorder(SkPictureRecorder* recorder) { if (!recorder) return false; SetDeviceDriver(pdfium::MakeUnique<CFX_SkiaDeviceDriver>(recorder)); @@ -2368,10 +2370,11 @@ bool CFX_FxgeDevice::AttachRecorder(SkPictureRecorder* recorder) { } #endif // _SKIA_SUPPORT_ -bool CFX_FxgeDevice::Create(int width, - int height, - FXDIB_Format format, - const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice) { +bool CFX_DefaultRenderDevice::Create( + int width, + int height, + FXDIB_Format format, + const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice) { auto pBitmap = pdfium::MakeRetain<CFX_DIBitmap>(); if (!pBitmap->Create(width, height, format)) { return false; @@ -2382,12 +2385,12 @@ bool CFX_FxgeDevice::Create(int width, return true; } -CFX_FxgeDevice::~CFX_FxgeDevice() { +CFX_DefaultRenderDevice::~CFX_DefaultRenderDevice() { Flush(); } #ifdef _SKIA_SUPPORT_ -void CFX_FxgeDevice::DebugVerifyBitmapIsPreMultiplied() const { +void CFX_DefaultRenderDevice::DebugVerifyBitmapIsPreMultiplied() const { #ifdef SK_DEBUG CFX_SkiaDeviceDriver* skDriver = static_cast<CFX_SkiaDeviceDriver*>(GetDeviceDriver()); @@ -2396,7 +2399,7 @@ void CFX_FxgeDevice::DebugVerifyBitmapIsPreMultiplied() const { #endif // SK_DEBUG } -bool CFX_FxgeDevice::SetBitsWithMask( +bool CFX_DefaultRenderDevice::SetBitsWithMask( const CFX_RetainPtr<CFX_DIBSource>& pBitmap, const CFX_RetainPtr<CFX_DIBSource>& pMask, int left, diff --git a/core/fxge/skia/fx_skia_device_unittest.cpp b/core/fxge/skia/fx_skia_device_unittest.cpp index a47a50c836..99b76d2109 100644 --- a/core/fxge/skia/fx_skia_device_unittest.cpp +++ b/core/fxge/skia/fx_skia_device_unittest.cpp @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fxge/cfx_fxgedevice.h" +#include "core/fxge/skia/fx_skia_device.h" +#include "core/fxge/cfx_defaultrenderdevice.h" #include "core/fxge/cfx_graphstatedata.h" #include "core/fxge/cfx_pathdata.h" #include "core/fxge/cfx_renderdevice.h" -#include "core/fxge/skia/fx_skia_device.h" #include "fpdfsdk/fsdk_define.h" #include "public/fpdfview.h" #include "testing/fx_string_testhelpers.h" @@ -124,7 +124,7 @@ void Harness(void (*Test)(CFX_SkiaDeviceDriver*, const State&), if (!bitmap) return; FPDFBitmap_FillRect(bitmap, 0, 0, w, h, 0x00000000); - CFX_FxgeDevice geDevice; + CFX_DefaultRenderDevice geDevice; CFX_RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); geDevice.Attach(pBitmap, false, nullptr, false); CFX_SkiaDeviceDriver* driver = diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index 43d53e1bb0..2747339b1d 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -15,7 +15,7 @@ #include "core/fxcrt/fx_codepage.h" #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/cfx_windowsdevice.h" +#include "core/fxge/cfx_windowsrenderdevice.h" #include "core/fxge/dib/cfx_dibextractor.h" #include "core/fxge/dib/cfx_imagerenderer.h" #include "core/fxge/dib/cstretchengine.h" @@ -1358,14 +1358,14 @@ bool CGdiDisplayDriver::StartDIBits(const CFX_RetainPtr<CFX_DIBSource>& pBitmap, return false; } -CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC) { +CFX_WindowsRenderDevice::CFX_WindowsRenderDevice(HDC hDC) { SetDeviceDriver(pdfium::WrapUnique(CreateDriver(hDC))); } -CFX_WindowsDevice::~CFX_WindowsDevice() {} +CFX_WindowsRenderDevice::~CFX_WindowsRenderDevice() {} // static -IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC) { +IFX_RenderDeviceDriver* CFX_WindowsRenderDevice::CreateDriver(HDC hDC) { int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY); int obj_type = ::GetObjectType(hDC); bool use_printer = device_type == DT_RASPRINTER || diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp index f060c04127..e036a8c97d 100644 --- a/core/fxge/win32/fx_win32_print.cpp +++ b/core/fxge/win32/fx_win32_print.cpp @@ -11,7 +11,7 @@ #include <vector> #include "core/fxcrt/fx_system.h" -#include "core/fxge/cfx_windowsdevice.h" +#include "core/fxge/cfx_windowsrenderdevice.h" #include "core/fxge/dib/cfx_dibextractor.h" #include "core/fxge/dib/cfx_imagerenderer.h" #include "core/fxge/dib/cstretchengine.h" |