summaryrefslogtreecommitdiff
path: root/core/include/fxge
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-07 17:08:39 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-03-07 17:08:39 -0500
commit594912241cd7d409b5f58a48ccffdc1904d844b2 (patch)
treeadcdb712f0cfa4cb07d1a490b2d45f15362b4329 /core/include/fxge
parentc582c0ddfea8ba01c8449ed7841cdb33c12e0a98 (diff)
downloadpdfium-594912241cd7d409b5f58a48ccffdc1904d844b2.tar.xz
Revert "Fix chromium-style errors."
This reverts commit c582c0ddfea8ba01c8449ed7841cdb33c12e0a98. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1769263002 .
Diffstat (limited to 'core/include/fxge')
-rw-r--r--core/include/fxge/fx_dib.h31
-rw-r--r--core/include/fxge/fx_font.h12
2 files changed, 31 insertions, 12 deletions
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index 43746e5d48..e39bad2b87 100644
--- a/core/include/fxge/fx_dib.h
+++ b/core/include/fxge/fx_dib.h
@@ -160,23 +160,30 @@ FX_ARGB ArgbEncode(int a, FX_COLORREF rgb);
#define FXSETFLAG_ALPHA_FILL(flag, val) flag = ((val) | (flag & 0xffffff00))
#define FXSETFLAG_ALPHA_STROKE(flag, val) \
flag = (((val) << 16) | (flag & 0xff00ffff))
-
class CFX_DIBSource {
public:
virtual ~CFX_DIBSource();
int GetWidth() const { return m_Width; }
+
int GetHeight() const { return m_Height; }
FXDIB_Format GetFormat() const {
return (FXDIB_Format)(m_AlphaFlag * 0x100 + m_bpp);
}
+
FX_DWORD GetPitch() const { return m_Pitch; }
+
FX_DWORD* GetPalette() const { return m_pPalette; }
- virtual uint8_t* GetBuffer() const;
+ virtual uint8_t* GetBuffer() const { return NULL; }
+
virtual const uint8_t* GetScanline(int line) const = 0;
- virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const;
+
+ virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const {
+ return FALSE;
+ }
+
virtual void DownSampleScanline(int line,
uint8_t* dest_scan,
int dest_bpp,
@@ -184,6 +191,7 @@ class CFX_DIBSource {
FX_BOOL bFlipX,
int clip_left,
int clip_width) const = 0;
+
virtual void SetDownSampleSize(int width, int height) {}
int GetBPP() const { return m_bpp; }
@@ -211,6 +219,7 @@ class CFX_DIBSource {
void CopyPalette(const FX_DWORD* pSrcPal, FX_DWORD size = 256);
CFX_DIBitmap* Clone(const FX_RECT* pClip = NULL) const;
+
CFX_DIBitmap* CloneConvert(FXDIB_Format format,
const FX_RECT* pClip = NULL,
void* pIccTransform = NULL) const;
@@ -219,6 +228,7 @@ class CFX_DIBSource {
int dest_height,
FX_DWORD flags = 0,
const FX_RECT* pClip = NULL) const;
+
CFX_DIBitmap* TransformTo(const CFX_Matrix* pMatrix,
int& left,
int& top,
@@ -226,6 +236,7 @@ class CFX_DIBSource {
const FX_RECT* pClip = NULL) const;
CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = NULL) const;
+
FX_BOOL CopyAlphaMask(const CFX_DIBSource* pAlphaMask,
const FX_RECT* pClip = NULL);
@@ -251,15 +262,23 @@ class CFX_DIBSource {
CFX_DIBSource();
int m_Width;
+
int m_Height;
+
int m_bpp;
+
FX_DWORD m_AlphaFlag;
+
FX_DWORD m_Pitch;
+
FX_DWORD* m_pPalette;
void BuildPalette();
+
FX_BOOL BuildAlphaMask();
+
int FindPalette(FX_DWORD color) const;
+
void GetPalette(FX_DWORD* pal, int alpha) const;
};
class CFX_DIBitmap : public CFX_DIBSource {
@@ -277,8 +296,10 @@ class CFX_DIBitmap : public CFX_DIBSource {
FX_BOOL Copy(const CFX_DIBSource* pSrc);
// CFX_DIBSource
- uint8_t* GetBuffer() const override;
- const uint8_t* GetScanline(int line) const override;
+ 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;
+ }
void DownSampleScanline(int line,
uint8_t* dest_scan,
int dest_bpp,
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index 2902145594..67ca1a7f4e 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -365,14 +365,14 @@ class IFX_SystemFontInfo {
int pitch_family,
const FX_CHAR* face,
int& iExact) = 0;
-
#ifdef PDF_ENABLE_XFA
virtual void* MapFontByUnicode(FX_DWORD dwUnicode,
int weight,
FX_BOOL bItalic,
- int pitch_family);
+ int pitch_family) {
+ return NULL;
+ }
#endif // PDF_ENABLE_XFA
-
virtual void* GetFont(const FX_CHAR* face) = 0;
virtual FX_DWORD GetFontData(void* hFont,
FX_DWORD table,
@@ -380,9 +380,9 @@ class IFX_SystemFontInfo {
FX_DWORD size) = 0;
virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0;
virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0;
- virtual int GetFaceIndex(void* hFont);
+ virtual int GetFaceIndex(void* hFont) { return 0; }
virtual void DeleteFont(void* hFont) = 0;
- virtual void* RetainFont(void* hFont);
+ virtual void* RetainFont(void* hFont) { return NULL; }
protected:
virtual ~IFX_SystemFontInfo() {}
@@ -446,7 +446,6 @@ class CFX_CountedFaceCache {
class CFX_FontCache {
public:
- CFX_FontCache();
~CFX_FontCache();
CFX_FaceCache* GetCachedFace(CFX_Font* pFont);
void ReleaseCachedFace(CFX_Font* pFont);
@@ -457,7 +456,6 @@ class CFX_FontCache {
CFX_FTCacheMap m_FTFaceMap;
CFX_FTCacheMap m_ExtFaceMap;
};
-
class CFX_AutoFontCache {
public:
CFX_AutoFontCache(CFX_FontCache* pFontCache, CFX_Font* pFont)