summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-06-21 11:24:24 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-21 11:24:24 -0700
commit095d346ff71ebe0385dfe7fa77baad6a1ce91fcb (patch)
tree2cfdb14ff75fb94607eea2306c56e282b25edf31 /core/fxge
parent8f93cc640473a7d2855c3bc9bfd5169a8b1ca76c (diff)
downloadpdfium-095d346ff71ebe0385dfe7fa77baad6a1ce91fcb.tar.xz
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
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/agg/fx_agg_driver.cpp94
-rw-r--r--core/fxge/agg/fx_agg_driver.h5
-rw-r--r--core/fxge/apple/apple_int.h5
-rw-r--r--core/fxge/apple/fx_quartz_device.cpp20
-rw-r--r--core/fxge/ge/fx_ge_device.cpp1
-rw-r--r--core/fxge/ge/fx_ge_text.cpp1
-rw-r--r--core/fxge/ifx_renderdevicedriver.cpp92
-rw-r--r--core/fxge/include/fx_ge.h87
-rw-r--r--core/fxge/include/fx_ge_win32.h3
-rw-r--r--core/fxge/include/ifx_renderdevicedriver.h104
-rw-r--r--core/fxge/skia/fx_skia_device.cpp84
-rw-r--r--core/fxge/skia/fx_skia_device.h4
-rw-r--r--core/fxge/win32/fx_win32_device.cpp2
-rw-r--r--core/fxge/win32/fx_win32_print.cpp2
-rw-r--r--core/fxge/win32/win32_int.h6
15 files changed, 226 insertions, 284 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index f5d7cbbf4c..814cf0ec26 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -12,6 +12,7 @@
#include "core/fxge/dib/dib_int.h"
#include "core/fxge/ge/fx_text_int.h"
#include "core/fxge/include/fx_ge.h"
+#include "core/fxge/include/ifx_renderdevicedriver.h"
#include "third_party/agg23/agg_conv_dash.h"
#include "third_party/agg23/agg_conv_stroke.h"
#include "third_party/agg23/agg_curves.h"
@@ -416,97 +417,6 @@ static void RasterizeStroke(agg::rasterizer_scanline_aa& rasterizer,
}
}
-IFX_RenderDeviceDriver* IFX_RenderDeviceDriver::CreateFxgeDriver(
- CFX_DIBitmap* pBitmap,
- FX_BOOL bRgbByteOrder,
- CFX_DIBitmap* pOriDevice,
- FX_BOOL bGroupKnockout) {
- return new CFX_AggDeviceDriver(pBitmap, bRgbByteOrder, pOriDevice,
- bGroupKnockout);
-}
-
-IFX_RenderDeviceDriver::~IFX_RenderDeviceDriver() {}
-
-CFX_Matrix IFX_RenderDeviceDriver::GetCTM() const {
- return CFX_Matrix();
-}
-
-FX_BOOL IFX_RenderDeviceDriver::StartRendering() {
- return TRUE;
-}
-
-void IFX_RenderDeviceDriver::EndRendering() {}
-
-FX_BOOL IFX_RenderDeviceDriver::SetClip_PathStroke(
- const CFX_PathData* pPathData,
- const CFX_Matrix* pObject2Device,
- const CFX_GraphStateData* pGraphState) {
- return FALSE;
-}
-
-FX_BOOL IFX_RenderDeviceDriver::SetPixel(int x, int y, uint32_t color) {
- return FALSE;
-}
-
-FX_BOOL IFX_RenderDeviceDriver::FillRectWithBlend(const FX_RECT* pRect,
- uint32_t fill_color,
- int blend_type) {
- return FALSE;
-}
-
-FX_BOOL IFX_RenderDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
- FX_FLOAT y1,
- FX_FLOAT x2,
- FX_FLOAT y2,
- uint32_t color,
- int blend_type) {
- return FALSE;
-}
-
-FX_BOOL IFX_RenderDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap,
- int left,
- int top) {
- return FALSE;
-}
-CFX_DIBitmap* IFX_RenderDeviceDriver::GetBackDrop() {
- return nullptr;
-}
-
-FX_BOOL IFX_RenderDeviceDriver::ContinueDIBits(void* handle,
- IFX_Pause* pPause) {
- return FALSE;
-}
-
-void IFX_RenderDeviceDriver::CancelDIBits(void* handle) {}
-
-FX_BOOL IFX_RenderDeviceDriver::DrawDeviceText(int nChars,
- const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont,
- CFX_FontCache* pCache,
- const CFX_Matrix* pObject2Device,
- FX_FLOAT font_size,
- uint32_t color) {
- return FALSE;
-}
-
-void* IFX_RenderDeviceDriver::GetPlatformSurface() const {
- return nullptr;
-}
-
-int IFX_RenderDeviceDriver::GetDriverType() const {
- return 0;
-}
-
-void IFX_RenderDeviceDriver::ClearDriver() {}
-
-FX_BOOL IFX_RenderDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern,
- const CFX_Matrix* pMatrix,
- const FX_RECT& clip_rect,
- int alpha,
- FX_BOOL bAlphaMode) {
- return false;
-}
-
CFX_AggDeviceDriver::CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap,
FX_BOOL bRgbByteOrder,
CFX_DIBitmap* pOriDevice,
@@ -554,7 +464,7 @@ FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars,
}
#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
-int CFX_AggDeviceDriver::GetDeviceCaps(int caps_id) {
+int CFX_AggDeviceDriver::GetDeviceCaps(int caps_id) const {
switch (caps_id) {
case FXDC_DEVICE_CLASS:
return FXDC_DISPLAY;
diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h
index 7c2e98047f..15f9706b3f 100644
--- a/core/fxge/agg/fx_agg_driver.h
+++ b/core/fxge/agg/fx_agg_driver.h
@@ -7,11 +7,12 @@
#ifndef CORE_FXGE_AGG_FX_AGG_DRIVER_H_
#define CORE_FXGE_AGG_FX_AGG_DRIVER_H_
-#include "core/fxge/include/fx_ge.h"
+#include "core/fxge/include/ifx_renderdevicedriver.h"
#include "third_party/agg23/agg_clip_liang_barsky.h"
#include "third_party/agg23/agg_path_storage.h"
#include "third_party/agg23/agg_rasterizer_scanline_aa.h"
+class CFX_ClipRgn;
class CFX_Matrix;
class CFX_PathData;
@@ -37,7 +38,7 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver {
void DestroyPlatform();
// 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,
diff --git a/core/fxge/apple/apple_int.h b/core/fxge/apple/apple_int.h
index c19282b12b..0462938d5a 100644
--- a/core/fxge/apple/apple_int.h
+++ b/core/fxge/apple/apple_int.h
@@ -11,7 +11,8 @@
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
-#include "core/fxge/include/fx_ge.h"
+#include "core/fxge/include/fx_dib.h"
+#include "core/fxge/include/ifx_renderdevicedriver.h"
#if _FX_OS_ == _FX_MACOSX_
#include <Carbon/Carbon.h>
@@ -85,7 +86,7 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver {
~CFX_QuartzDeviceDriver() override;
// IFX_RenderDeviceDriver
- int GetDeviceCaps(int caps_id) override;
+ int GetDeviceCaps(int caps_id) const override;
CFX_Matrix GetCTM() const override;
void SaveState() override;
void RestoreState(bool bKeepSaved) override;
diff --git a/core/fxge/apple/fx_quartz_device.cpp b/core/fxge/apple/fx_quartz_device.cpp
index 8adf6326c1..b3591a3da1 100644
--- a/core/fxge/apple/fx_quartz_device.cpp
+++ b/core/fxge/apple/fx_quartz_device.cpp
@@ -190,24 +190,20 @@ CFX_QuartzDeviceDriver::~CFX_QuartzDeviceDriver() {
CGContextRelease(m_context);
}
}
-int CFX_QuartzDeviceDriver::GetDeviceCaps(int capsID) {
+int CFX_QuartzDeviceDriver::GetDeviceCaps(int capsID) const {
switch (capsID) {
- case FXDC_DEVICE_CLASS: {
+ case FXDC_DEVICE_CLASS:
return m_deviceClass;
- }
- case FXDC_PIXEL_WIDTH: {
+ case FXDC_PIXEL_WIDTH:
return m_width;
- }
- case FXDC_PIXEL_HEIGHT: {
+ case FXDC_PIXEL_HEIGHT:
return m_height;
- }
- case FXDC_BITS_PIXEL: {
+ case FXDC_BITS_PIXEL:
return 32;
- }
- case FXDC_RENDER_CAPS: {
+ case FXDC_RENDER_CAPS:
return m_renderCaps;
- }
- default: { return 0; }
+ default:
+ return 0;
}
}
CFX_Matrix CFX_QuartzDeviceDriver::GetCTM() const {
diff --git a/core/fxge/ge/fx_ge_device.cpp b/core/fxge/ge/fx_ge_device.cpp
index adf68a8749..00cc541c22 100644
--- a/core/fxge/ge/fx_ge_device.cpp
+++ b/core/fxge/ge/fx_ge_device.cpp
@@ -5,6 +5,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "core/fxge/include/fx_ge.h"
+#include "core/fxge/include/ifx_renderdevicedriver.h"
CFX_RenderDevice::CFX_RenderDevice()
: m_pBitmap(nullptr),
diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp
index cf349eb9c0..9f635edacc 100644
--- a/core/fxge/ge/fx_ge_text.cpp
+++ b/core/fxge/ge/fx_ge_text.cpp
@@ -11,6 +11,7 @@
#include "core/fxge/ge/fx_text_int.h"
#include "core/fxge/include/fx_freetype.h"
#include "core/fxge/include/fx_ge.h"
+#include "core/fxge/include/ifx_renderdevicedriver.h"
#ifdef _SKIA_SUPPORT_
#include "third_party/skia/include/core/SkStream.h"
diff --git a/core/fxge/ifx_renderdevicedriver.cpp b/core/fxge/ifx_renderdevicedriver.cpp
new file mode 100644
index 0000000000..2265a3d55b
--- /dev/null
+++ b/core/fxge/ifx_renderdevicedriver.cpp
@@ -0,0 +1,92 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "core/fxge/include/ifx_renderdevicedriver.h"
+
+#include "core/fxcrt/include/fx_coordinates.h"
+
+IFX_RenderDeviceDriver::~IFX_RenderDeviceDriver() {}
+
+CFX_Matrix IFX_RenderDeviceDriver::GetCTM() const {
+ return CFX_Matrix();
+}
+
+FX_BOOL IFX_RenderDeviceDriver::StartRendering() {
+ return TRUE;
+}
+
+void IFX_RenderDeviceDriver::EndRendering() {}
+
+FX_BOOL IFX_RenderDeviceDriver::SetClip_PathStroke(
+ const CFX_PathData* pPathData,
+ const CFX_Matrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState) {
+ return FALSE;
+}
+
+FX_BOOL IFX_RenderDeviceDriver::SetPixel(int x, int y, uint32_t color) {
+ return FALSE;
+}
+
+FX_BOOL IFX_RenderDeviceDriver::FillRectWithBlend(const FX_RECT* pRect,
+ uint32_t fill_color,
+ int blend_type) {
+ return FALSE;
+}
+
+FX_BOOL IFX_RenderDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
+ FX_FLOAT y1,
+ FX_FLOAT x2,
+ FX_FLOAT y2,
+ uint32_t color,
+ int blend_type) {
+ return FALSE;
+}
+
+FX_BOOL IFX_RenderDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap,
+ int left,
+ int top) {
+ return FALSE;
+}
+
+CFX_DIBitmap* IFX_RenderDeviceDriver::GetBackDrop() {
+ return nullptr;
+}
+
+FX_BOOL IFX_RenderDeviceDriver::ContinueDIBits(void* handle,
+ IFX_Pause* pPause) {
+ return FALSE;
+}
+
+void IFX_RenderDeviceDriver::CancelDIBits(void* handle) {}
+
+FX_BOOL IFX_RenderDeviceDriver::DrawDeviceText(int nChars,
+ const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont,
+ CFX_FontCache* pCache,
+ const CFX_Matrix* pObject2Device,
+ FX_FLOAT font_size,
+ uint32_t color) {
+ return FALSE;
+}
+
+void* IFX_RenderDeviceDriver::GetPlatformSurface() const {
+ return nullptr;
+}
+
+int IFX_RenderDeviceDriver::GetDriverType() const {
+ return 0;
+}
+
+void IFX_RenderDeviceDriver::ClearDriver() {}
+
+FX_BOOL IFX_RenderDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern,
+ const CFX_Matrix* pMatrix,
+ const FX_RECT& clip_rect,
+ int alpha,
+ FX_BOOL bAlphaMode) {
+ return false;
+}
diff --git a/core/fxge/include/fx_ge.h b/core/fxge/include/fx_ge.h
index 538afdb581..5599a75f59 100644
--- a/core/fxge/include/fx_ge.h
+++ b/core/fxge/include/fx_ge.h
@@ -423,91 +423,4 @@ class CFX_FxgeDevice : public CFX_RenderDevice {
bool m_bOwnedBitmap;
};
-class IFX_RenderDeviceDriver {
- public:
- virtual ~IFX_RenderDeviceDriver();
-
- static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* pBitmap,
- FX_BOOL bRgbByteOrder,
- CFX_DIBitmap* pOriDevice,
- FX_BOOL bGroupKnockout);
-
-
- virtual int GetDeviceCaps(int caps_id) = 0;
-
- virtual CFX_Matrix GetCTM() const;
-
- virtual FX_BOOL StartRendering();
- virtual void EndRendering();
- virtual void SaveState() = 0;
- virtual void RestoreState(bool bKeepSaved) = 0;
-
- virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_Matrix* pObject2Device,
- int fill_mode) = 0;
- virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_Matrix* pObject2Device,
- const CFX_GraphStateData* pGraphState);
- virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
- const CFX_Matrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- uint32_t fill_color,
- uint32_t stroke_color,
- int fill_mode,
- int blend_type) = 0;
- virtual FX_BOOL SetPixel(int x, int y, uint32_t color);
- virtual FX_BOOL FillRectWithBlend(const FX_RECT* pRect,
- uint32_t fill_color,
- int blend_type);
- virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1,
- FX_FLOAT y1,
- FX_FLOAT x2,
- FX_FLOAT y2,
- uint32_t color,
- int blend_type);
-
- virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0;
- virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top);
- virtual CFX_DIBitmap* GetBackDrop();
- virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
- uint32_t color,
- const FX_RECT* pSrcRect,
- int dest_left,
- int dest_top,
- int blend_type) = 0;
- virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
- uint32_t color,
- int dest_left,
- int dest_top,
- int dest_width,
- int dest_height,
- const FX_RECT* pClipRect,
- uint32_t flags,
- int blend_type) = 0;
- virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
- int bitmap_alpha,
- uint32_t color,
- const CFX_Matrix* pMatrix,
- uint32_t flags,
- void*& handle,
- int blend_type) = 0;
- virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause);
- virtual void CancelDIBits(void* handle);
- virtual FX_BOOL DrawDeviceText(int nChars,
- const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont,
- CFX_FontCache* pCache,
- const CFX_Matrix* pObject2Device,
- FX_FLOAT font_size,
- uint32_t color);
- virtual void* GetPlatformSurface() const;
- virtual int GetDriverType() const;
- virtual void ClearDriver();
- virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern,
- const CFX_Matrix* pMatrix,
- const FX_RECT& clip_rect,
- int alpha,
- FX_BOOL bAlphaMode);
-};
-
#endif // CORE_FXGE_INCLUDE_FX_GE_H_
diff --git a/core/fxge/include/fx_ge_win32.h b/core/fxge/include/fx_ge_win32.h
index 703093d92f..c0889c1852 100644
--- a/core/fxge/include/fx_ge_win32.h
+++ b/core/fxge/include/fx_ge_win32.h
@@ -13,6 +13,9 @@
#endif
#define WINDIB_OPEN_MEMORY 0x1
#define WINDIB_OPEN_PATHNAME 0x2
+
+class IFX_RenderDeviceDriver;
+
typedef struct WINDIB_Open_Args_ {
int flags;
diff --git a/core/fxge/include/ifx_renderdevicedriver.h b/core/fxge/include/ifx_renderdevicedriver.h
new file mode 100644
index 0000000000..572469b8c0
--- /dev/null
+++ b/core/fxge/include/ifx_renderdevicedriver.h
@@ -0,0 +1,104 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FXGE_INCLUDE_IFX_RENDERDEVICEDRIVER_H_
+#define CORE_FXGE_INCLUDE_IFX_RENDERDEVICEDRIVER_H_
+
+#include "core/fxcrt/include/fx_system.h"
+
+class CFX_DIBitmap;
+class CFX_DIBSource;
+class CFX_Font;
+class CFX_FontCache;
+class CFX_GraphStateData;
+class CFX_Matrix;
+class CFX_PathData;
+class CPDF_ShadingPattern;
+class IFX_Pause;
+struct FXTEXT_CHARPOS;
+struct FX_RECT;
+
+class IFX_RenderDeviceDriver {
+ public:
+ virtual ~IFX_RenderDeviceDriver();
+
+ virtual int GetDeviceCaps(int caps_id) const = 0;
+ virtual CFX_Matrix GetCTM() const;
+
+ virtual FX_BOOL StartRendering();
+ virtual void EndRendering();
+ virtual void SaveState() = 0;
+ virtual void RestoreState(bool bKeepSaved) = 0;
+
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_Matrix* pObject2Device,
+ int fill_mode) = 0;
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_Matrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState);
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
+ const CFX_Matrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ uint32_t fill_color,
+ uint32_t stroke_color,
+ int fill_mode,
+ int blend_type) = 0;
+ virtual FX_BOOL SetPixel(int x, int y, uint32_t color);
+ virtual FX_BOOL FillRectWithBlend(const FX_RECT* pRect,
+ uint32_t fill_color,
+ int blend_type);
+ virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1,
+ FX_FLOAT y1,
+ FX_FLOAT x2,
+ FX_FLOAT y2,
+ uint32_t color,
+ int blend_type);
+
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0;
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top);
+ virtual CFX_DIBitmap* GetBackDrop();
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
+ uint32_t color,
+ const FX_RECT* pSrcRect,
+ int dest_left,
+ int dest_top,
+ int blend_type) = 0;
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
+ uint32_t color,
+ int dest_left,
+ int dest_top,
+ int dest_width,
+ int dest_height,
+ const FX_RECT* pClipRect,
+ uint32_t flags,
+ int blend_type) = 0;
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
+ int bitmap_alpha,
+ uint32_t color,
+ const CFX_Matrix* pMatrix,
+ uint32_t flags,
+ void*& handle,
+ int blend_type) = 0;
+ virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause);
+ virtual void CancelDIBits(void* handle);
+ virtual FX_BOOL DrawDeviceText(int nChars,
+ const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont,
+ CFX_FontCache* pCache,
+ const CFX_Matrix* pObject2Device,
+ FX_FLOAT font_size,
+ uint32_t color);
+ virtual void* GetPlatformSurface() const;
+ virtual int GetDriverType() const;
+ virtual void ClearDriver();
+ virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern,
+ const CFX_Matrix* pMatrix,
+ const FX_RECT& clip_rect,
+ int alpha,
+ FX_BOOL bAlphaMode);
+};
+
+#endif // CORE_FXGE_INCLUDE_IFX_RENDERDEVICEDRIVER_H_
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index f253b06c6d..ad7bd2d291 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -620,7 +620,7 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawDeviceText(int nChars,
return TRUE;
}
-int CFX_SkiaDeviceDriver::GetDeviceCaps(int caps_id) {
+int CFX_SkiaDeviceDriver::GetDeviceCaps(int caps_id) const {
switch (caps_id) {
case FXDC_DEVICE_CLASS:
return FXDC_DISPLAY;
@@ -1182,86 +1182,4 @@ void CFX_FxgeDevice::PreMultiply() {
(static_cast<CFX_SkiaDeviceDriver*>(GetDeviceDriver()))->PreMultiply();
}
-IFX_RenderDeviceDriver::~IFX_RenderDeviceDriver() {}
-
-CFX_Matrix IFX_RenderDeviceDriver::GetCTM() const {
- return CFX_Matrix();
-}
-
-FX_BOOL IFX_RenderDeviceDriver::StartRendering() {
- return TRUE;
-}
-
-void IFX_RenderDeviceDriver::EndRendering() {}
-
-FX_BOOL IFX_RenderDeviceDriver::SetClip_PathStroke(
- const CFX_PathData* pPathData,
- const CFX_Matrix* pObject2Device,
- const CFX_GraphStateData* pGraphState) {
- return FALSE;
-}
-
-FX_BOOL IFX_RenderDeviceDriver::SetPixel(int x, int y, uint32_t color) {
- return FALSE;
-}
-
-FX_BOOL IFX_RenderDeviceDriver::FillRectWithBlend(const FX_RECT* pRect,
- uint32_t fill_color,
- int blend_type) {
- return FALSE;
-}
-
-FX_BOOL IFX_RenderDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
- FX_FLOAT y1,
- FX_FLOAT x2,
- FX_FLOAT y2,
- uint32_t color,
- int blend_type) {
- return FALSE;
-}
-
-FX_BOOL IFX_RenderDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap,
- int left,
- int top) {
- return FALSE;
-}
-CFX_DIBitmap* IFX_RenderDeviceDriver::GetBackDrop() {
- return nullptr;
-}
-
-FX_BOOL IFX_RenderDeviceDriver::ContinueDIBits(void* handle,
- IFX_Pause* pPause) {
- return FALSE;
-}
-
-void IFX_RenderDeviceDriver::CancelDIBits(void* handle) {}
-
-FX_BOOL IFX_RenderDeviceDriver::DrawDeviceText(int nChars,
- const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont,
- CFX_FontCache* pCache,
- const CFX_Matrix* pObject2Device,
- FX_FLOAT font_size,
- uint32_t color) {
- return FALSE;
-}
-
-void* IFX_RenderDeviceDriver::GetPlatformSurface() const {
- return nullptr;
-}
-
-int IFX_RenderDeviceDriver::GetDriverType() const {
- return 0;
-}
-
-void IFX_RenderDeviceDriver::ClearDriver() {}
-
-FX_BOOL IFX_RenderDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern,
- const CFX_Matrix* pMatrix,
- const FX_RECT& clip_rect,
- int alpha,
- FX_BOOL bAlphaMode) {
- return false;
-}
-
#endif
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h
index 5ad66f79b3..4ea1ad1218 100644
--- a/core/fxge/skia/fx_skia_device.h
+++ b/core/fxge/skia/fx_skia_device.h
@@ -7,6 +7,8 @@
#if defined(_SKIA_SUPPORT_)
+#include "core/fxge/include/ifx_renderdevicedriver.h"
+
class SkCanvas;
class SkMatrix;
class SkPaint;
@@ -25,7 +27,7 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver {
~CFX_SkiaDeviceDriver() override;
/** Options */
- int GetDeviceCaps(int caps_id) override;
+ int GetDeviceCaps(int caps_id) const override;
/** Save and restore all graphic states */
void SaveState() override;
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,