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/skia | |
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/skia')
-rw-r--r-- | core/fxge/skia/fx_skia_device.cpp | 35 | ||||
-rw-r--r-- | core/fxge/skia/fx_skia_device_unittest.cpp | 6 |
2 files changed, 22 insertions, 19 deletions
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 = |