From 095d346ff71ebe0385dfe7fa77baad6a1ce91fcb Mon Sep 17 00:00:00 2001 From: weili Date: Tue, 21 Jun 2016 11:24:24 -0700 Subject: Move ifx_renderdevicedriver to a separate file to share Move ifx_renderdevicedriver class to its own file to share with multiple devices to reduce code duplication. Review-Url: https://codereview.chromium.org/2078783002 --- core/fxge/win32/fx_win32_device.cpp | 2 +- core/fxge/win32/fx_win32_print.cpp | 2 +- core/fxge/win32/win32_int.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'core/fxge/win32') diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index 2df5c1c4ce..9087478837 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -755,7 +755,7 @@ CGdiDeviceDriver::CGdiDeviceDriver(HDC hDC, int device_class) { CGdiDeviceDriver::~CGdiDeviceDriver() {} -int CGdiDeviceDriver::GetDeviceCaps(int caps_id) { +int CGdiDeviceDriver::GetDeviceCaps(int caps_id) const { switch (caps_id) { case FXDC_DEVICE_CLASS: return m_DeviceClass; diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp index 0e89e71889..02569edc38 100644 --- a/core/fxge/win32/fx_win32_print.cpp +++ b/core/fxge/win32/fx_win32_print.cpp @@ -23,7 +23,7 @@ CGdiPrinterDriver::CGdiPrinterDriver(HDC hDC) CGdiPrinterDriver::~CGdiPrinterDriver() {} -int CGdiPrinterDriver::GetDeviceCaps(int caps_id) { +int CGdiPrinterDriver::GetDeviceCaps(int caps_id) const { if (caps_id == FXDC_HORZ_SIZE) return m_HorzSize; if (caps_id == FXDC_VERT_SIZE) diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h index b09c4ebbd5..9744324008 100644 --- a/core/fxge/win32/win32_int.h +++ b/core/fxge/win32/win32_int.h @@ -7,7 +7,7 @@ #ifndef CORE_FXGE_WIN32_WIN32_INT_H_ #define CORE_FXGE_WIN32_WIN32_INT_H_ -#include "core/fxge/include/fx_ge.h" +#include "core/fxge/include/ifx_renderdevicedriver.h" #include "core/fxge/win32/dwrite_int.h" struct WINDIB_Open_Args_; @@ -111,7 +111,7 @@ class CGdiDeviceDriver : public IFX_RenderDeviceDriver { ~CGdiDeviceDriver() override; // IFX_RenderDeviceDriver - int GetDeviceCaps(int caps_id) override; + int GetDeviceCaps(int caps_id) const override; void SaveState() override; void RestoreState(bool bKeepSaved) override; FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, @@ -220,7 +220,7 @@ class CGdiPrinterDriver : public CGdiDeviceDriver { ~CGdiPrinterDriver() override; protected: - int GetDeviceCaps(int caps_id) override; + int GetDeviceCaps(int caps_id) const override; FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, uint32_t color, const FX_RECT* pSrcRect, -- cgit v1.2.3