diff options
author | weili <weili@chromium.org> | 2016-06-14 17:21:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-14 17:21:14 -0700 |
commit | f4bb580add3824196dc49cd7de2f7d051019ede8 (patch) | |
tree | 15c1db6fb7000330d48c105c66acf1d468ba56bd /core/fxge/ge/fx_ge_device.cpp | |
parent | ee2abec93f22bd10522181dc0362f24d389fc66b (diff) | |
download | pdfium-f4bb580add3824196dc49cd7de2f7d051019ede8.tar.xz |
Make code compile with clang_use_chrome_plugin (part II)
This change contains files in core directory which were not covered
in part I. This is part of the efforts to make PDFium code compilable
by Clang chromium style plugins.
The changes are mainly the following:
-- move inline constructor/destructor of complex class/struct out-of-line;
-- add constructor/destructor of complex class/struct if not
explicitly defined;
-- add explicit out-of-line copy constructor when needed;
-- move inline virtual functions out-of-line;
-- Properly mark virtual functions with 'override';
-- some minor cleanups;
BUG=pdfium:469
Review-Url: https://codereview.chromium.org/2060913003
Diffstat (limited to 'core/fxge/ge/fx_ge_device.cpp')
-rw-r--r-- | core/fxge/ge/fx_ge_device.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/core/fxge/ge/fx_ge_device.cpp b/core/fxge/ge/fx_ge_device.cpp index f1f7dc021d..adf68a8749 100644 --- a/core/fxge/ge/fx_ge_device.cpp +++ b/core/fxge/ge/fx_ge_device.cpp @@ -6,18 +6,25 @@ #include "core/fxge/include/fx_ge.h" -CFX_RenderDevice::CFX_RenderDevice() { - m_pDeviceDriver = nullptr; - m_pBitmap = nullptr; -} +CFX_RenderDevice::CFX_RenderDevice() + : m_pBitmap(nullptr), + m_Width(0), + m_Height(0), + m_bpp(0), + m_RenderCaps(0), + m_DeviceClass(0), + m_pDeviceDriver(nullptr) {} + CFX_RenderDevice::~CFX_RenderDevice() { delete m_pDeviceDriver; } + void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver) { delete m_pDeviceDriver; m_pDeviceDriver = pDriver; InitDeviceInfo(); } + void CFX_RenderDevice::InitDeviceInfo() { m_Width = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_WIDTH); m_Height = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_HEIGHT); @@ -31,12 +38,15 @@ void CFX_RenderDevice::InitDeviceInfo() { m_ClipBox.bottom = m_Height; } } + FX_BOOL CFX_RenderDevice::StartRendering() { return m_pDeviceDriver->StartRendering(); } + void CFX_RenderDevice::EndRendering() { m_pDeviceDriver->EndRendering(); } + void CFX_RenderDevice::SaveState() { m_pDeviceDriver->SaveState(); } @@ -52,6 +62,7 @@ int CFX_RenderDevice::GetDeviceCaps(int caps_id) const { CFX_Matrix CFX_RenderDevice::GetCTM() const { return m_pDeviceDriver->GetCTM(); } + FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const { @@ -72,6 +83,7 @@ FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb); #endif } + FX_BOOL CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, int fill_mode) { @@ -82,6 +94,7 @@ FX_BOOL CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData, UpdateClipBox(); return TRUE; } + FX_BOOL CFX_RenderDevice::SetClip_PathStroke( const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, @@ -93,6 +106,7 @@ FX_BOOL CFX_RenderDevice::SetClip_PathStroke( UpdateClipBox(); return TRUE; } + FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT& rect) { CFX_PathData path; path.AppendRect(rect.left, rect.bottom, rect.right, rect.top); @@ -102,6 +116,7 @@ FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT& rect) { UpdateClipBox(); return TRUE; } + void CFX_RenderDevice::UpdateClipBox() { if (m_pDeviceDriver->GetClipBox(&m_ClipBox)) { return; @@ -421,6 +436,16 @@ FX_BOOL CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, FXDIB_BLEND_NORMAL); } +FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, + int left, + int top, + int dest_width, + int dest_height, + uint32_t color) { + return StretchBitMaskWithFlags(pBitmap, left, top, dest_width, dest_height, + color, 0); +} + FX_BOOL CFX_RenderDevice::StretchBitMaskWithFlags(const CFX_DIBSource* pBitmap, int left, int top, |