diff options
Diffstat (limited to 'core/fxge')
-rw-r--r-- | core/fxge/agg/fx_agg_driver.cpp | 2 | ||||
-rw-r--r-- | core/fxge/android/cfpf_skiafont.h | 5 | ||||
-rw-r--r-- | core/fxge/android/cfx_androidfontinfo.h | 3 | ||||
-rw-r--r-- | core/fxge/cfx_facecache.h | 3 | ||||
-rw-r--r-- | core/fxge/cfx_renderdevice.h | 9 | ||||
-rw-r--r-- | core/fxge/dib/cfx_bitmapcomposer.h | 3 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagerenderer.cpp | 4 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagerenderer.h | 3 | ||||
-rw-r--r-- | core/fxge/dib/cstretchengine.h | 3 | ||||
-rw-r--r-- | core/fxge/ge/cfx_facecache.cpp | 4 | ||||
-rw-r--r-- | core/fxge/ge/cfx_folderfontinfo.h | 3 | ||||
-rw-r--r-- | core/fxge/ge/cfx_font.cpp | 4 | ||||
-rw-r--r-- | core/fxge/ge/cfx_renderdevice.cpp | 9 | ||||
-rw-r--r-- | core/fxge/skia/fx_skia_device.cpp | 6 | ||||
-rw-r--r-- | core/fxge/win32/cfx_psrenderer.cpp | 2 | ||||
-rw-r--r-- | core/fxge/win32/fx_win32_device.cpp | 2 |
16 files changed, 40 insertions, 25 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 6174f6e18f..22d80071a9 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp @@ -438,7 +438,7 @@ class CFX_Renderer { CFX_RetainPtr<CFX_DIBitmap> m_pOriDevice; CFX_RetainPtr<CFX_DIBitmap> m_pClipMask; CFX_RetainPtr<CFX_DIBitmap> m_pDevice; - const CFX_ClipRgn* m_pClipRgn; + CFX_UnownedPtr<const CFX_ClipRgn> m_pClipRgn; }; void CFX_Renderer::CompositeSpan(uint8_t* dest_scan, diff --git a/core/fxge/android/cfpf_skiafont.h b/core/fxge/android/cfpf_skiafont.h index 657ced88f2..5686e9e31f 100644 --- a/core/fxge/android/cfpf_skiafont.h +++ b/core/fxge/android/cfpf_skiafont.h @@ -7,6 +7,7 @@ #ifndef CORE_FXGE_ANDROID_CFPF_SKIAFONT_H_ #define CORE_FXGE_ANDROID_CFPF_SKIAFONT_H_ +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_system.h" #include "core/fxge/fx_font.h" @@ -42,8 +43,8 @@ class CFPF_SkiaFont { uint8_t uCharset); private: - CFPF_SkiaFontMgr* m_pFontMgr; - CFPF_SkiaFontDescriptor* m_pFontDes; + CFX_UnownedPtr<CFPF_SkiaFontMgr> m_pFontMgr; + CFX_UnownedPtr<CFPF_SkiaFontDescriptor> m_pFontDes; FXFT_Face m_Face; uint32_t m_dwStyle; uint8_t m_uCharset; diff --git a/core/fxge/android/cfx_androidfontinfo.h b/core/fxge/android/cfx_androidfontinfo.h index ce08f2558a..17bbf89a3e 100644 --- a/core/fxge/android/cfx_androidfontinfo.h +++ b/core/fxge/android/cfx_androidfontinfo.h @@ -7,6 +7,7 @@ #ifndef CORE_FXGE_ANDROID_CFX_ANDROIDFONTINFO_H_ #define CORE_FXGE_ANDROID_CFX_ANDROIDFONTINFO_H_ +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_system.h" #include "core/fxge/cfx_fontmapper.h" #include "core/fxge/fx_font.h" @@ -39,7 +40,7 @@ class CFX_AndroidFontInfo : public IFX_SystemFontInfo { void DeleteFont(void* hFont) override; protected: - CFPF_SkiaFontMgr* m_pFontMgr; + CFX_UnownedPtr<CFPF_SkiaFontMgr> m_pFontMgr; }; #endif // CORE_FXGE_ANDROID_CFX_ANDROIDFONTINFO_H_ diff --git a/core/fxge/cfx_facecache.h b/core/fxge/cfx_facecache.h index 5857a6310b..d6847debdb 100644 --- a/core/fxge/cfx_facecache.h +++ b/core/fxge/cfx_facecache.h @@ -10,6 +10,7 @@ #include <map> #include <memory> +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxge/fx_font.h" #include "core/fxge/fx_freetype.h" @@ -59,7 +60,7 @@ class CFX_FaceCache { std::map<CFX_ByteString, std::unique_ptr<CFX_SizeGlyphCache>> m_SizeMap; std::map<uint32_t, std::unique_ptr<CFX_PathData>> m_PathMap; #if defined _SKIA_SUPPORT_ || _SKIA_SUPPORT_PATHS_ - CFX_TypeFace* m_pTypeface; + CFX_UnownedPtr<CFX_TypeFace> m_pTypeface; #endif }; diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h index 4d8b407b35..f33da57cc9 100644 --- a/core/fxge/cfx_renderdevice.h +++ b/core/fxge/cfx_renderdevice.h @@ -9,6 +9,7 @@ #include <memory> +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxge/fx_dib.h" #include "core/fxge/fx_font.h" @@ -84,13 +85,11 @@ class CFX_RenderDevice { public: class StateRestorer { public: - explicit StateRestorer(CFX_RenderDevice* pDevice) : m_pDevice(pDevice) { - m_pDevice->SaveState(); - } - ~StateRestorer() { m_pDevice->RestoreState(false); } + explicit StateRestorer(CFX_RenderDevice* pDevice); + ~StateRestorer(); private: - CFX_RenderDevice* m_pDevice; + CFX_UnownedPtr<CFX_RenderDevice> m_pDevice; }; CFX_RenderDevice(); diff --git a/core/fxge/dib/cfx_bitmapcomposer.h b/core/fxge/dib/cfx_bitmapcomposer.h index 6e961cbd45..cc4ecb13fe 100644 --- a/core/fxge/dib/cfx_bitmapcomposer.h +++ b/core/fxge/dib/cfx_bitmapcomposer.h @@ -10,6 +10,7 @@ #include <vector> #include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxge/dib/cfx_scanlinecompositor.h" #include "core/fxge/dib/ifx_scanlinecomposer.h" @@ -56,7 +57,7 @@ class CFX_BitmapComposer : public IFX_ScanlineComposer { const uint8_t* scan_extra_alpha); CFX_RetainPtr<CFX_DIBitmap> m_pBitmap; - const CFX_ClipRgn* m_pClipRgn; + CFX_UnownedPtr<const CFX_ClipRgn> m_pClipRgn; FXDIB_Format m_SrcFormat; int m_DestLeft; int m_DestTop; diff --git a/core/fxge/dib/cfx_imagerenderer.cpp b/core/fxge/dib/cfx_imagerenderer.cpp index cff95fdd70..ec611cacbe 100644 --- a/core/fxge/dib/cfx_imagerenderer.cpp +++ b/core/fxge/dib/cfx_imagerenderer.cpp @@ -122,14 +122,14 @@ bool CFX_ImageRenderer::Continue(IFX_Pause* pPause) { m_pDevice->CompositeMask( m_pTransformer->result().left, m_pTransformer->result().top, pBitmap->GetWidth(), pBitmap->GetHeight(), pBitmap, m_MaskColor, 0, 0, - m_BlendType, m_pClipRgn, m_bRgbByteOrder, m_AlphaFlag); + m_BlendType, m_pClipRgn.Get(), m_bRgbByteOrder, m_AlphaFlag); } else { if (m_BitmapAlpha != 255) pBitmap->MultiplyAlpha(m_BitmapAlpha); m_pDevice->CompositeBitmap( m_pTransformer->result().left, m_pTransformer->result().top, pBitmap->GetWidth(), pBitmap->GetHeight(), pBitmap, 0, 0, m_BlendType, - m_pClipRgn, m_bRgbByteOrder); + m_pClipRgn.Get(), m_bRgbByteOrder); } return false; } diff --git a/core/fxge/dib/cfx_imagerenderer.h b/core/fxge/dib/cfx_imagerenderer.h index f3d1286dc6..cad621e19c 100644 --- a/core/fxge/dib/cfx_imagerenderer.h +++ b/core/fxge/dib/cfx_imagerenderer.h @@ -10,6 +10,7 @@ #include <memory> #include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxge/dib/cfx_bitmapcomposer.h" #include "core/fxge/dib/cfx_dibitmap.h" @@ -38,7 +39,7 @@ class CFX_ImageRenderer { private: CFX_RetainPtr<CFX_DIBitmap> m_pDevice; - const CFX_ClipRgn* m_pClipRgn; + CFX_UnownedPtr<const CFX_ClipRgn> m_pClipRgn; int m_BitmapAlpha; uint32_t m_MaskColor; CFX_Matrix m_Matrix; diff --git a/core/fxge/dib/cstretchengine.h b/core/fxge/dib/cstretchengine.h index 280641cb59..049059361e 100644 --- a/core/fxge/dib/cstretchengine.h +++ b/core/fxge/dib/cstretchengine.h @@ -9,6 +9,7 @@ #include <vector> +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxge/fx_dib.h" @@ -58,7 +59,7 @@ class CStretchEngine { int m_DestBpp; int m_SrcBpp; int m_bHasAlpha; - IFX_ScanlineComposer* m_pDestBitmap; + CFX_UnownedPtr<IFX_ScanlineComposer> m_pDestBitmap; int m_DestWidth; int m_DestHeight; FX_RECT m_DestClip; diff --git a/core/fxge/ge/cfx_facecache.cpp b/core/fxge/ge/cfx_facecache.cpp index 9c79444dd3..6049729089 100644 --- a/core/fxge/ge/cfx_facecache.cpp +++ b/core/fxge/ge/cfx_facecache.cpp @@ -90,7 +90,7 @@ CFX_FaceCache::CFX_FaceCache(FXFT_Face face) CFX_FaceCache::~CFX_FaceCache() { #if defined _SKIA_SUPPORT_ || _SKIA_SUPPORT_PATHS_ - SkSafeUnref(m_pTypeface); + SkSafeUnref(m_pTypeface.Get()); #endif } @@ -370,7 +370,7 @@ CFX_TypeFace* CFX_FaceCache::GetDeviceCache(const CFX_Font* pFont) { new SkMemoryStream(pFont->GetFontData(), pFont->GetSize())); } #endif - return m_pTypeface; + return m_pTypeface.Get(); } #endif diff --git a/core/fxge/ge/cfx_folderfontinfo.h b/core/fxge/ge/cfx_folderfontinfo.h index 6aadb1526f..ad363b5f0d 100644 --- a/core/fxge/ge/cfx_folderfontinfo.h +++ b/core/fxge/ge/cfx_folderfontinfo.h @@ -11,6 +11,7 @@ #include <memory> #include <vector> +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxge/cfx_fontmapper.h" #include "core/fxge/fx_font.h" #include "core/fxge/ifx_systemfontinfo.h" @@ -62,7 +63,7 @@ class CFX_FolderFontInfo : public IFX_SystemFontInfo { std::map<CFX_ByteString, std::unique_ptr<CFX_FontFaceInfo>> m_FontList; std::vector<CFX_ByteString> m_PathList; - CFX_FontMapper* m_pMapper; + CFX_UnownedPtr<CFX_FontMapper> m_pMapper; }; #endif // CORE_FXGE_GE_CFX_FOLDERFONTINFO_H_ diff --git a/core/fxge/ge/cfx_font.cpp b/core/fxge/ge/cfx_font.cpp index 229ede7894..144675cdbd 100644 --- a/core/fxge/ge/cfx_font.cpp +++ b/core/fxge/ge/cfx_font.cpp @@ -28,12 +28,12 @@ namespace { -typedef struct { +struct OUTLINE_PARAMS { CFX_PathData* m_pPath; int m_CurX; int m_CurY; float m_CoordUnit; -} OUTLINE_PARAMS; +}; #ifdef PDF_ENABLE_XFA diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp index f9153d1cdb..4404833758 100644 --- a/core/fxge/ge/cfx_renderdevice.cpp +++ b/core/fxge/ge/cfx_renderdevice.cpp @@ -1120,3 +1120,12 @@ bool CFX_RenderDevice::DrawTextPath(int nChars, } return true; } + +CFX_RenderDevice::StateRestorer::StateRestorer(CFX_RenderDevice* pDevice) + : m_pDevice(pDevice) { + m_pDevice->SaveState(); +} + +CFX_RenderDevice::StateRestorer::~StateRestorer() { + m_pDevice->RestoreState(false); +} diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 7d91ab2b72..f4b72fe2ad 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -822,7 +822,7 @@ class SkiaState { skPaint.setAntiAlias(true); skPaint.setColor(m_fillColor); if (m_pTypeFace) { // exclude placeholder test fonts - sk_sp<SkTypeface> typeface(SkSafeRef(m_pTypeFace)); + sk_sp<SkTypeface> typeface(SkSafeRef(m_pTypeFace.Get())); skPaint.setTypeface(typeface); } skPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); @@ -1266,8 +1266,8 @@ class SkiaState { CFX_GraphStateData m_clipState; CFX_GraphStateData m_drawState; CFX_Matrix m_clipMatrix; - CFX_SkiaDeviceDriver* m_pDriver; - CFX_TypeFace* m_pTypeFace; + CFX_UnownedPtr<CFX_SkiaDeviceDriver> m_pDriver; + CFX_UnownedPtr<CFX_TypeFace> m_pTypeFace; float m_fontSize; uint32_t m_fillColor; uint32_t m_strokeColor; diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index 400babd16b..b5260c1073 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp @@ -76,7 +76,7 @@ void PSCompressData(int PSLevel, } // namespace struct PSGlyph { - CFX_Font* m_pFont; + CFX_UnownedPtr<CFX_Font> m_pFont; uint32_t m_GlyphIndex; bool m_bGlyphAdjust; float m_AdjustMatrix[4]; diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index b495251dee..f6481187b3 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -363,7 +363,7 @@ class CFX_Win32FontInfo final : public IFX_SystemFontInfo { CFX_ByteString FindFont(const CFX_ByteString& name); HDC m_hDC; - CFX_FontMapper* m_pMapper; + CFX_UnownedPtr<CFX_FontMapper> m_pMapper; CFX_ByteString m_LastFamily; CFX_ByteString m_KaiTi, m_FangSong; }; |