summaryrefslogtreecommitdiff
path: root/core/include/fxge
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-14 21:49:19 -0700
committerLei Zhang <thestig@chromium.org>2015-08-14 21:49:19 -0700
commit62b2e912dc2a508972fbf01b25f7449c39ff1543 (patch)
tree47a244dc5891b2a338ca529b796e12994e642cbc /core/include/fxge
parentbdf72c353af5b8a34ef5efdeddfff36d2089a158 (diff)
downloadpdfium-62b2e912dc2a508972fbf01b25f7449c39ff1543.tar.xz
Merge to XFA: Use override in more classes in core/
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1292613003 . (cherry picked from commit c2c3f7b5f0396409451a9d344f35ec1929a76e9f) Review URL: https://codereview.chromium.org/1296043002 .
Diffstat (limited to 'core/include/fxge')
-rw-r--r--core/include/fxge/fpf.h10
-rw-r--r--core/include/fxge/fx_dib.h91
-rw-r--r--core/include/fxge/fx_font.h8
-rw-r--r--core/include/fxge/fx_ge.h16
4 files changed, 65 insertions, 60 deletions
diff --git a/core/include/fxge/fpf.h b/core/include/fxge/fpf.h
index efa001e916..e65fae0bbd 100644
--- a/core/include/fxge/fpf.h
+++ b/core/include/fxge/fpf.h
@@ -9,18 +9,21 @@
#include "../fxcrt/fx_coordinates.h"
-class IFPF_DeviceModule;
class IFPF_FontMgr;
-class IFPF_Font;
+
class IFPF_DeviceModule {
public:
virtual ~IFPF_DeviceModule() {}
virtual void Destroy() = 0;
virtual IFPF_FontMgr* GetFontMgr() = 0;
};
+
IFPF_DeviceModule* FPF_GetDeviceModule();
+
#define FPF_MATCHFONT_REPLACEANSI 1
+
typedef struct FPF_HFONT_ { void* pData; } * FPF_HFONT;
+
class IFPF_Font {
public:
virtual void Release() = 0;
@@ -47,8 +50,9 @@ class IFPF_Font {
FX_DWORD dwSize) = 0;
protected:
- ~IFPF_Font() {}
+ virtual ~IFPF_Font() {}
};
+
class IFPF_FontMgr {
public:
virtual ~IFPF_FontMgr() {}
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index ddc47d3db5..818aaac520 100644
--- a/core/include/fxge/fx_dib.h
+++ b/core/include/fxge/fx_dib.h
@@ -69,6 +69,8 @@ typedef FX_DWORD FX_CMYK;
class CFX_ClipRgn;
class CFX_DIBSource;
class CFX_DIBitmap;
+class CStretchEngine;
+
#define FXSYS_RGB(r, g, b) ((r) | ((g) << 8) | ((b) << 16))
#define FXSYS_GetRValue(rgb) ((rgb)&0xff)
#define FXSYS_GetGValue(rgb) (((rgb) >> 8) & 0xff)
@@ -281,11 +283,9 @@ class CFX_DIBSource {
};
class CFX_DIBitmap : public CFX_DIBSource {
public:
- virtual ~CFX_DIBitmap();
-
CFX_DIBitmap();
-
- CFX_DIBitmap(const CFX_DIBitmap& src);
+ explicit CFX_DIBitmap(const CFX_DIBitmap& src);
+ ~CFX_DIBitmap() override;
FX_BOOL Create(int width,
int height,
@@ -295,19 +295,18 @@ class CFX_DIBitmap : public CFX_DIBSource {
FX_BOOL Copy(const CFX_DIBSource* pSrc);
- virtual uint8_t* GetBuffer() const { return m_pBuffer; }
-
- virtual const uint8_t* GetScanline(int line) const {
+ // CFX_DIBSource
+ uint8_t* GetBuffer() const override { return m_pBuffer; }
+ const uint8_t* GetScanline(int line) const override {
return m_pBuffer ? m_pBuffer + line * m_Pitch : NULL;
}
-
- virtual void DownSampleScanline(int line,
- uint8_t* dest_scan,
- int dest_bpp,
- int dest_width,
- FX_BOOL bFlipX,
- int clip_left,
- int clip_width) const;
+ void DownSampleScanline(int line,
+ uint8_t* dest_scan,
+ int dest_bpp,
+ int dest_width,
+ FX_BOOL bFlipX,
+ int clip_left,
+ int clip_width) const override;
void TakeOver(CFX_DIBitmap* pSrcBitmap);
@@ -407,12 +406,12 @@ class CFX_DIBExtractor {
private:
CFX_DIBitmap* m_pBitmap;
};
+
typedef CFX_CountRef<CFX_DIBitmap> CFX_DIBitmapRef;
class CFX_FilteredDIB : public CFX_DIBSource {
public:
CFX_FilteredDIB();
-
- ~CFX_FilteredDIB();
+ ~CFX_FilteredDIB() override;
void LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc = FALSE);
@@ -429,14 +428,15 @@ class CFX_FilteredDIB : public CFX_DIBSource {
int Bpp) const = 0;
protected:
- virtual const uint8_t* GetScanline(int line) const;
- virtual void DownSampleScanline(int line,
- uint8_t* dest_scan,
- int dest_bpp,
- int dest_width,
- FX_BOOL bFlipX,
- int clip_left,
- int clip_width) const;
+ // CFX_DIBSource
+ const uint8_t* GetScanline(int line) const override;
+ void DownSampleScanline(int line,
+ uint8_t* dest_scan,
+ int dest_bpp,
+ int dest_width,
+ FX_BOOL bFlipX,
+ int clip_left,
+ int clip_width) const override;
const CFX_DIBSource* m_pSrc;
@@ -444,6 +444,7 @@ class CFX_FilteredDIB : public CFX_DIBSource {
uint8_t* m_pScanline;
};
+
class IFX_ScanlineComposer {
public:
virtual ~IFX_ScanlineComposer() {}
@@ -514,11 +515,11 @@ class CFX_ScanlineCompositor {
int m_CacheSize;
FX_BOOL m_bRgbByteOrder;
};
+
class CFX_BitmapComposer : public IFX_ScanlineComposer {
public:
CFX_BitmapComposer();
-
- ~CFX_BitmapComposer();
+ ~CFX_BitmapComposer() override;
void Compose(CFX_DIBitmap* pDest,
const CFX_ClipRgn* pClipRgn,
@@ -533,14 +534,15 @@ class CFX_BitmapComposer : public IFX_ScanlineComposer {
void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL);
- virtual FX_BOOL SetInfo(int width,
- int height,
- FXDIB_Format src_format,
- FX_DWORD* pSrcPalette);
+ // IFX_ScanlineComposer
+ FX_BOOL SetInfo(int width,
+ int height,
+ FXDIB_Format src_format,
+ FX_DWORD* pSrcPalette) override;
- virtual void ComposeScanline(int line,
- const uint8_t* scanline,
- const uint8_t* scan_extra_alpha);
+ void ComposeScanline(int line,
+ const uint8_t* scanline,
+ const uint8_t* scan_extra_alpha) override;
protected:
void DoCompose(uint8_t* dest_scan,
@@ -569,20 +571,21 @@ class CFX_BitmapComposer : public IFX_ScanlineComposer {
uint8_t* m_pAddClipScan;
uint8_t* m_pScanlineAlphaV;
};
+
class CFX_BitmapStorer : public IFX_ScanlineComposer {
public:
CFX_BitmapStorer();
+ ~CFX_BitmapStorer() override;
- ~CFX_BitmapStorer();
+ // IFX_ScanlineComposer
+ void ComposeScanline(int line,
+ const uint8_t* scanline,
+ const uint8_t* scan_extra_alpha) override;
- virtual void ComposeScanline(int line,
- const uint8_t* scanline,
- const uint8_t* scan_extra_alpha);
-
- virtual FX_BOOL SetInfo(int width,
- int height,
- FXDIB_Format src_format,
- FX_DWORD* pSrcPalette);
+ FX_BOOL SetInfo(int width,
+ int height,
+ FXDIB_Format src_format,
+ FX_DWORD* pSrcPalette) override;
CFX_DIBitmap* GetBitmap() { return m_pBitmap; }
@@ -593,7 +596,7 @@ class CFX_BitmapStorer : public IFX_ScanlineComposer {
private:
CFX_DIBitmap* m_pBitmap;
};
-class CStretchEngine;
+
class CFX_ImageStretcher {
public:
CFX_ImageStretcher();
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index 835a018112..e0c6e31542 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -278,7 +278,7 @@ class IFX_AdditionalFontEnum {
};
class CFX_FontMapper {
public:
- CFX_FontMapper(CFX_FontMgr* mgr);
+ explicit CFX_FontMapper(CFX_FontMgr* mgr);
~CFX_FontMapper();
void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
@@ -326,6 +326,7 @@ class CFX_FontMapper {
IFX_FontEnumerator* m_pFontEnumerator;
CFX_FontMgr* const m_pFontMgr;
};
+
class IFX_SystemFontInfo {
public:
static IFX_SystemFontInfo* CreateDefault();
@@ -356,12 +357,13 @@ class IFX_SystemFontInfo {
virtual void* RetainFont(void* hFont) { return NULL; }
protected:
- ~IFX_SystemFontInfo() {}
+ virtual ~IFX_SystemFontInfo() {}
};
+
class CFX_FolderFontInfo : public IFX_SystemFontInfo {
public:
CFX_FolderFontInfo();
- virtual ~CFX_FolderFontInfo();
+ ~CFX_FolderFontInfo() override;
void AddPath(const CFX_ByteStringC& path);
diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h
index 0aa3f17d4d..23be3648d1 100644
--- a/core/include/fxge/fx_ge.h
+++ b/core/include/fxge/fx_ge.h
@@ -10,17 +10,12 @@
#include "fx_dib.h"
#include "fx_font.h"
-class CFX_ClipRgn;
-class CFX_PathData;
-class CFX_GraphStateData;
class CFX_Font;
class CFX_FontMgr;
class CFX_FontCache;
class CFX_FaceCache;
-class CFX_RenderDevice;
class IFX_RenderDeviceDriver;
class CCodec_ModuleMgr;
-class IFXG_PaintModuleMgr;
class CFX_GEModule {
public:
@@ -434,8 +429,7 @@ class CFX_RenderDevice {
class CFX_FxgeDevice : public CFX_RenderDevice {
public:
CFX_FxgeDevice();
-
- ~CFX_FxgeDevice();
+ ~CFX_FxgeDevice() override;
FX_BOOL Attach(CFX_DIBitmap* pBitmap,
int dither_bits = 0,
@@ -455,8 +449,7 @@ class CFX_FxgeDevice : public CFX_RenderDevice {
class CFX_SkiaDevice : public CFX_RenderDevice {
public:
CFX_SkiaDevice();
-
- ~CFX_SkiaDevice();
+ ~CFX_SkiaDevice() override;
FX_BOOL Attach(CFX_DIBitmap* pBitmap,
int dither_bits = 0,
@@ -473,6 +466,7 @@ class CFX_SkiaDevice : public CFX_RenderDevice {
protected:
FX_BOOL m_bOwnedBitmap;
};
+
class IFX_RenderDeviceDriver {
public:
static IFX_RenderDeviceDriver* CreateFxgeDriver(
@@ -612,14 +606,16 @@ class IFX_RenderDeviceDriver {
virtual void ClearDriver() {}
};
+
class IFX_PSOutput {
public:
virtual void Release() = 0;
virtual void OutputPS(const FX_CHAR* string, int len) = 0;
protected:
- ~IFX_PSOutput() {}
+ virtual ~IFX_PSOutput() {}
};
+
class CPSFont;
class CFX_PSRenderer {
public: