diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-12-10 15:34:55 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-12-10 15:34:55 -0800 |
commit | 60d909e9d4444b2b8582275624ee97734d331a38 (patch) | |
tree | 6a884e5dd0c785c141919531033de7e2fc5b0e01 /core/src/fxge/apple | |
parent | 33c8c7602f8981c32d37a9b2e25496401e914391 (diff) | |
download | pdfium-60d909e9d4444b2b8582275624ee97734d331a38.tar.xz |
Merge to XFA: Remove CFX_AffineMatrix/CPDF_Matrix
Review URL: https://codereview.chromium.org/1513363002 .
(cherry picked from commit f32c969bce6743fca1e7ff796b54a1692d26d7f0)
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1519693002 .
Diffstat (limited to 'core/src/fxge/apple')
-rw-r--r-- | core/src/fxge/apple/apple_int.h | 18 | ||||
-rw-r--r-- | core/src/fxge/apple/fx_apple_platform.cpp | 25 | ||||
-rw-r--r-- | core/src/fxge/apple/fx_quartz_device.cpp | 55 |
3 files changed, 47 insertions, 51 deletions
diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h index 504e144327..0601fccb23 100644 --- a/core/src/fxge/apple/apple_int.h +++ b/core/src/fxge/apple/apple_int.h @@ -53,7 +53,7 @@ class CQuartz2D { void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize); void DestroyFont(void* pFont); - void setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix); + void setGraphicsTextMatrix(void* graphics, CFX_Matrix* matrix); FX_BOOL drawGraphicsString(void* graphics, void* font, FX_FLOAT fontSize, @@ -61,7 +61,7 @@ class CQuartz2D { CGPoint* glyphPositions, int32_t chars, FX_ARGB argb, - CFX_AffineMatrix* matrix = NULL); + CFX_Matrix* matrix = NULL); void saveGraphicsState(void* graphics); void restoreGraphicsState(void* graphics); }; @@ -87,13 +87,13 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { void SaveState() override; void RestoreState(FX_BOOL bKeepSaved) override; FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, - const CFX_AffineMatrix* pObject2Device, + const CFX_Matrix* pObject2Device, int fill_mode) override; FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, - const CFX_AffineMatrix* pObject2Device, + const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState) override; FX_BOOL DrawPath(const CFX_PathData* pPathData, - const CFX_AffineMatrix* pObject2Device, + const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, FX_DWORD stroke_color, @@ -150,7 +150,7 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, FX_DWORD flags, void*& handle, int alpha_flag = 0, @@ -166,7 +166,7 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, - const CFX_AffineMatrix* pObject2Device, + const CFX_Matrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color, int alpha_flag = 0, @@ -186,8 +186,8 @@ class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, - const CFX_AffineMatrix* pGlyphMatrix, - const CFX_AffineMatrix* pObject2Device, + const CFX_Matrix* pGlyphMatrix, + const CFX_Matrix* pObject2Device, FX_FLOAT font_size, FX_DWORD argb, int alpha_flag, diff --git a/core/src/fxge/apple/fx_apple_platform.cpp b/core/src/fxge/apple/fx_apple_platform.cpp index 8346873408..f0a23825b9 100644 --- a/core/src/fxge/apple/fx_apple_platform.cpp +++ b/core/src/fxge/apple/fx_apple_platform.cpp @@ -34,7 +34,7 @@ void CFX_FaceCache::DestroyPlatform() {} CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext( CFX_Font* pFont, FX_DWORD glyph_index, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, int dest_width, int anti_alias) { return NULL; @@ -44,7 +44,7 @@ static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, - const CFX_AffineMatrix* pObject2Device, + const CFX_Matrix* pObject2Device, FX_FLOAT font_size, FX_DWORD argb, int alpha_flag, @@ -52,7 +52,7 @@ static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext, if (nChars == 0) { return TRUE; } - CFX_AffineMatrix new_matrix; + CFX_Matrix new_matrix; FX_BOOL bNegSize = font_size < 0; if (bNegSize) { font_size = -font_size; @@ -97,16 +97,15 @@ static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext, nChars, argb, NULL); } static void _DoNothing(void* info, const void* data, size_t size) {} -FX_BOOL CFX_AggDeviceDriver::DrawDeviceText( - int nChars, - const FXTEXT_CHARPOS* pCharPos, - CFX_Font* pFont, - CFX_FontCache* pCache, - const CFX_AffineMatrix* pObject2Device, - FX_FLOAT font_size, - FX_DWORD argb, - int alpha_flag, - void* pIccTransform) { +FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, + const FXTEXT_CHARPOS* pCharPos, + CFX_Font* pFont, + CFX_FontCache* pCache, + const CFX_Matrix* pObject2Device, + FX_FLOAT font_size, + FX_DWORD argb, + int alpha_flag, + void* pIccTransform) { if (!pFont) { return FALSE; } diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp index e933695a86..0b19438230 100644 --- a/core/src/fxge/apple/fx_quartz_device.cpp +++ b/core/src/fxge/apple/fx_quartz_device.cpp @@ -56,8 +56,7 @@ void* CQuartz2D::CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize) { void CQuartz2D::DestroyFont(void* pFont) { CGFontRelease((CGFontRef)pFont); } -void CQuartz2D::setGraphicsTextMatrix(void* graphics, - CFX_AffineMatrix* matrix) { +void CQuartz2D::setGraphicsTextMatrix(void* graphics, CFX_Matrix* matrix) { if (!graphics || !matrix) { return; } @@ -74,7 +73,7 @@ FX_BOOL CQuartz2D::drawGraphicsString(void* graphics, CGPoint* glyphPositions, int32_t charsCount, FX_ARGB argb, - CFX_AffineMatrix* matrix) { + CFX_Matrix* matrix) { if (!graphics) { return FALSE; } @@ -224,7 +223,7 @@ void CFX_QuartzDeviceDriver::RestoreState(FX_BOOL isKeepSaved) { } } FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData, - const CFX_AffineMatrix* matrix, + const CFX_Matrix* matrix, int fillMode) { SaveState(); CGAffineTransform m = CGAffineTransformIdentity; @@ -260,7 +259,7 @@ FX_FLOAT CFX_QuartzDeviceDriver::getLineWidth( } FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathStroke( const CFX_PathData* pathData, - const CFX_AffineMatrix* matrix, + const CFX_Matrix* matrix, const CFX_GraphStateData* graphState) { SaveState(); CGAffineTransform m = CGAffineTransformIdentity; @@ -336,7 +335,7 @@ static CGBlendMode GetCGBlendMode(int blend_type) { return mode; } FX_BOOL CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData, - const CFX_AffineMatrix* matrix, + const CFX_Matrix* matrix, const CFX_GraphStateData* graphState, FX_DWORD fillArgb, FX_DWORD strokeArgb, @@ -736,17 +735,16 @@ FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap, RestoreState(FALSE); return TRUE; } -FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun( - int nChars, - const FXTEXT_CHARPOS* pCharPos, - CFX_Font* pFont, - CFX_FontCache* pCache, - const CFX_AffineMatrix* pGlyphMatrix, - const CFX_AffineMatrix* pObject2Device, - FX_FLOAT font_size, - FX_DWORD argb, - int alpha_flag, - void* pIccTransform) { +FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars, + const FXTEXT_CHARPOS* pCharPos, + CFX_Font* pFont, + CFX_FontCache* pCache, + const CFX_Matrix* pGlyphMatrix, + const CFX_Matrix* pObject2Device, + FX_FLOAT font_size, + FX_DWORD argb, + int alpha_flag, + void* pIccTransform) { if (nChars == 0) { return TRUE; } @@ -769,7 +767,7 @@ FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun( glyph_positions[i].x = pCharPos[i].m_OriginX; glyph_positions[i].y = pCharPos[i].m_OriginY; } - CFX_AffineMatrix text_matrix; + CFX_Matrix text_matrix; if (pObject2Device) { text_matrix.Concat(*pObject2Device); } @@ -803,16 +801,15 @@ FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun( RestoreState(FALSE); return TRUE; } -FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText( - int nChars, - const FXTEXT_CHARPOS* pCharPos, - CFX_Font* pFont, - CFX_FontCache* pCache, - const CFX_AffineMatrix* pObject2Device, - FX_FLOAT font_size, - FX_DWORD color, - int alpha_flag, - void* pIccTransform) { +FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars, + const FXTEXT_CHARPOS* pCharPos, + CFX_Font* pFont, + CFX_FontCache* pCache, + const CFX_Matrix* pObject2Device, + FX_FLOAT font_size, + FX_DWORD color, + int alpha_flag, + void* pIccTransform) { if (NULL == pFont || NULL == _context) { return FALSE; } @@ -837,7 +834,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText( } } const FXTEXT_CHARPOS* char_pos = pCharPos + i; - CFX_AffineMatrix glphy_matrix; + CFX_Matrix glphy_matrix; if (font_size < 0) { glphy_matrix.Concat(-1, 0, 0, -1, 0, 0); } |