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/win32 | |
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/win32')
-rw-r--r-- | core/src/fxge/win32/dwrite_int.h | 2 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_device.cpp | 12 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_dwrite.cpp | 2 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_gdipext.cpp | 6 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_print.cpp | 25 | ||||
-rw-r--r-- | core/src/fxge/win32/win32_int.h | 22 |
6 files changed, 34 insertions, 35 deletions
diff --git a/core/src/fxge/win32/dwrite_int.h b/core/src/fxge/win32/dwrite_int.h index a2c91ce5b4..206cdf5020 100644 --- a/core/src/fxge/win32/dwrite_int.h +++ b/core/src/fxge/win32/dwrite_int.h @@ -44,7 +44,7 @@ class CDWriteExt { FX_BOOL DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, - CFX_AffineMatrix* pMatrix, + CFX_Matrix* pMatrix, void* font, FX_FLOAT font_size, FX_ARGB text_color, diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp index b7b625341e..4ca4316c2e 100644 --- a/core/src/fxge/win32/fx_win32_device.cpp +++ b/core/src/fxge/win32/fx_win32_device.cpp @@ -681,7 +681,7 @@ FX_BOOL CGdiDeviceDriver::SetClipRgn(void* hRgn) { return TRUE; } static HPEN _CreatePen(const CFX_GraphStateData* pGraphState, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, FX_DWORD argb) { FX_FLOAT width; FX_FLOAT scale = 1.f; @@ -757,7 +757,7 @@ static HBRUSH _CreateBrush(FX_DWORD argb) { } static void _SetPathToDC(HDC hDC, const CFX_PathData* pPathData, - const CFX_AffineMatrix* pMatrix) { + const CFX_Matrix* pMatrix) { BeginPath(hDC); int nPoints = pPathData->GetPointCount(); FX_PATHPOINT* pPoints = pPathData->GetPoints(); @@ -835,12 +835,12 @@ void CGdiDeviceDriver::DrawLine(FX_FLOAT x1, MoveToEx(m_hDC, FXSYS_round(x1), FXSYS_round(y1), NULL); LineTo(m_hDC, FXSYS_round(x2), FXSYS_round(y2)); } -static FX_BOOL _MatrixNoScaled(const CFX_AffineMatrix* pMatrix) { +static FX_BOOL _MatrixNoScaled(const CFX_Matrix* pMatrix) { return pMatrix->GetA() == 1.0f && pMatrix->GetB() == 0 && pMatrix->GetC() == 0 && pMatrix->GetD() == 1.0f; } FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, FX_DWORD stroke_color, @@ -975,7 +975,7 @@ FX_BOOL CGdiDeviceDriver::FillRect(const FX_RECT* pRect, return TRUE; } FX_BOOL CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, int fill_mode) { if (pPathData->GetPointCount() == 5) { CFX_FloatRect rectf; @@ -992,7 +992,7 @@ FX_BOOL CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, } FX_BOOL CGdiDeviceDriver::SetClip_PathStroke( const CFX_PathData* pPathData, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, const CFX_GraphStateData* pGraphState) { HPEN hPen = _CreatePen(pGraphState, pMatrix, 0xff000000); hPen = (HPEN)SelectObject(m_hDC, hPen); diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp index 0d533436b5..ab50f3cf38 100644 --- a/core/src/fxge/win32/fx_win32_dwrite.cpp +++ b/core/src/fxge/win32/fx_win32_dwrite.cpp @@ -206,7 +206,7 @@ failed: FX_BOOL CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, - CFX_AffineMatrix* pMatrix, + CFX_Matrix* pMatrix, void* font, FX_FLOAT font_size, FX_ARGB text_color, diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp index 368b15fcc0..2886ee81d0 100644 --- a/core/src/fxge/win32/fx_win32_gdipext.cpp +++ b/core/src/fxge/win32/fx_win32_gdipext.cpp @@ -965,7 +965,7 @@ FX_BOOL CGdiplusExt::StretchDIBits(HDC hDC, return TRUE; } static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, DWORD argb, FX_BOOL bTextMode = FALSE) { CGdiplusExt& GdiplusExt = @@ -1072,7 +1072,7 @@ static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, return pPen; } static FX_BOOL IsSmallTriangle(PointF* points, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, int& v1, int& v2) { int pairs[] = {1, 2, 0, 2, 0, 1}; @@ -1098,7 +1098,7 @@ static FX_BOOL IsSmallTriangle(PointF* points, } FX_BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, - const CFX_AffineMatrix* pObject2Device, + const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_argb, FX_DWORD stroke_argb, diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index 126e5d7f47..c829a438b9 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -136,7 +136,7 @@ FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, dest_height, flags, pIccTransform); } static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, - const CFX_AffineMatrix* pDestMatrix) { + const CFX_Matrix* pDestMatrix) { ASSERT(pSrc->GetFormat() == FXDIB_1bppRgb || pSrc->GetFormat() == FXDIB_1bppMask || pSrc->GetFormat() == FXDIB_1bppCmyk); @@ -152,11 +152,11 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, FX_FLOAT area_scale = FXSYS_Div((FX_FLOAT)(src_width * src_height), dest_area); FX_FLOAT size_scale = FXSYS_sqrt(area_scale); - CFX_AffineMatrix adjusted_matrix(*pDestMatrix); + CFX_Matrix adjusted_matrix(*pDestMatrix); adjusted_matrix.Scale(size_scale, size_scale); CFX_FloatRect result_rect_f = adjusted_matrix.GetUnitRect(); FX_RECT result_rect = result_rect_f.GetOutterRect(); - CFX_AffineMatrix src2result; + CFX_Matrix src2result; src2result.e = adjusted_matrix.c + adjusted_matrix.e; src2result.f = adjusted_matrix.d + adjusted_matrix.f; src2result.a = adjusted_matrix.a / pSrcBitmap->GetWidth(); @@ -164,7 +164,7 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, src2result.c = -adjusted_matrix.c / pSrcBitmap->GetHeight(); src2result.d = -adjusted_matrix.d / pSrcBitmap->GetHeight(); src2result.TranslateI(-result_rect.left, -result_rect.top); - CFX_AffineMatrix result2src; + CFX_Matrix result2src; result2src.SetReverse(src2result); CPDF_FixedMatrix result2src_fix(result2src, 8); int result_width = result_rect.Width(); @@ -224,7 +224,7 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, FX_DWORD render_flags, void*& handle, int alpha_flag, @@ -375,22 +375,21 @@ void CPSPrinterDriver::SaveState() { void CPSPrinterDriver::RestoreState(FX_BOOL bKeepSaved) { m_PSRenderer.RestoreState(bKeepSaved); } -FX_BOOL CPSPrinterDriver::SetClip_PathFill( - const CFX_PathData* pPathData, - const CFX_AffineMatrix* pObject2Device, - int fill_mode) { +FX_BOOL CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + int fill_mode) { m_PSRenderer.SetClip_PathFill(pPathData, pObject2Device, fill_mode); return TRUE; } FX_BOOL CPSPrinterDriver::SetClip_PathStroke( const CFX_PathData* pPathData, - const CFX_AffineMatrix* pObject2Device, + const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState) { m_PSRenderer.SetClip_PathStroke(pPathData, pObject2Device, pGraphState); return TRUE; } FX_BOOL CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData, - const CFX_AffineMatrix* pObject2Device, + const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_ARGB fill_color, FX_ARGB stroke_color, @@ -444,7 +443,7 @@ FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_BOOL CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, FX_DWORD render_flags, void*& handle, int alpha_flag, @@ -464,7 +463,7 @@ FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, 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, diff --git a/core/src/fxge/win32/win32_int.h b/core/src/fxge/win32/win32_int.h index 95d31d159d..0616476676 100644 --- a/core/src/fxge/win32/win32_int.h +++ b/core/src/fxge/win32/win32_int.h @@ -36,7 +36,7 @@ class CGdiplusExt { int flags); FX_BOOL DrawPath(HDC hDC, const CFX_PathData* pPathData, - const CFX_AffineMatrix* pObject2Device, + const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_argb, FX_DWORD stroke_argb, @@ -117,13 +117,13 @@ class CGdiDeviceDriver : public IFX_RenderDeviceDriver { } } 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, @@ -212,7 +212,7 @@ class CGdiDisplayDriver : public CGdiDeviceDriver { virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, FX_DWORD render_flags, void*& handle, int alpha_flag, @@ -260,7 +260,7 @@ class CGdiPrinterDriver : public CGdiDeviceDriver { virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, - const CFX_AffineMatrix* pMatrix, + const CFX_Matrix* pMatrix, FX_DWORD render_flags, void*& handle, int alpha_flag, @@ -300,13 +300,13 @@ class CPSPrinterDriver : public IFX_RenderDeviceDriver { void SaveState() override; void RestoreState(FX_BOOL bKeepSaved = FALSE) 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, @@ -337,7 +337,7 @@ class CPSPrinterDriver : 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 render_flags, void*& handle, int alpha_flag, @@ -347,7 +347,7 @@ class CPSPrinterDriver : 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, |