summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-12-10 15:34:55 -0800
committerTom Sepez <tsepez@chromium.org>2015-12-10 15:34:55 -0800
commit60d909e9d4444b2b8582275624ee97734d331a38 (patch)
tree6a884e5dd0c785c141919531033de7e2fc5b0e01 /core/src/fpdfapi
parent33c8c7602f8981c32d37a9b2e25496401e914391 (diff)
downloadpdfium-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/fpdfapi')
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp28
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp17
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp5
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_page/pageint.h10
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp10
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render.cpp94
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp16
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp50
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp58
-rw-r--r--core/src/fpdfapi/fpdf_render/render_int.h92
17 files changed, 201 insertions, 217 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
index 36dbb97a6c..4df841fb75 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
@@ -9,7 +9,7 @@
#include "core/include/fpdfapi/fpdf_serial.h"
#include "core/src/fpdfapi/fpdf_page/pageint.h"
-CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& ar, CFX_AffineMatrix& matrix) {
+CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& ar, CFX_Matrix& matrix) {
ar << matrix.a << " " << matrix.b << " " << matrix.c << " " << matrix.d << " "
<< matrix.e << " " << matrix.f;
return ar;
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index d4c71085a1..1434c9d336 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -1343,12 +1343,12 @@ void CPDF_CIDFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level) {
FX_WORD CID = CIDFromCharCode(charcode);
const uint8_t* pTransform = GetCIDTransform(CID);
if (pTransform && !bVert) {
- CFX_AffineMatrix matrix(CIDTransformToFloat(pTransform[0]),
- CIDTransformToFloat(pTransform[1]),
- CIDTransformToFloat(pTransform[2]),
- CIDTransformToFloat(pTransform[3]),
- CIDTransformToFloat(pTransform[4]) * 1000,
- CIDTransformToFloat(pTransform[5]) * 1000);
+ CFX_Matrix matrix(CIDTransformToFloat(pTransform[0]),
+ CIDTransformToFloat(pTransform[1]),
+ CIDTransformToFloat(pTransform[2]),
+ CIDTransformToFloat(pTransform[3]),
+ CIDTransformToFloat(pTransform[4]) * 1000,
+ CIDTransformToFloat(pTransform[5]) * 1000);
CFX_FloatRect rect_f(rect);
rect_f.Transform(&matrix);
rect = rect_f.GetOutterRect();
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 3777cd078c..45b796ce86 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -65,21 +65,21 @@ void CPDF_PageObject::RecalcBBox() {
break;
}
}
-void CPDF_PageObject::TransformClipPath(CFX_AffineMatrix& matrix) {
+void CPDF_PageObject::TransformClipPath(CFX_Matrix& matrix) {
if (m_ClipPath.IsNull()) {
return;
}
m_ClipPath.GetModify();
m_ClipPath.Transform(matrix);
}
-void CPDF_PageObject::TransformGeneralState(CFX_AffineMatrix& matrix) {
+void CPDF_PageObject::TransformGeneralState(CFX_Matrix& matrix) {
if (m_GeneralState.IsNull()) {
return;
}
CPDF_GeneralStateData* pGS = m_GeneralState.GetModify();
pGS->m_Matrix.Concat(matrix);
}
-FX_RECT CPDF_PageObject::GetBBox(const CFX_AffineMatrix* pMatrix) const {
+FX_RECT CPDF_PageObject::GetBBox(const CFX_Matrix* pMatrix) const {
CFX_FloatRect rect(m_Left, m_Bottom, m_Right, m_Top);
if (pMatrix) {
pMatrix->TransformRect(rect);
@@ -209,7 +209,7 @@ void CPDF_TextObject::CopyData(const CPDF_PageObject* pSrc) {
m_PosY = pSrcObj->m_PosY;
}
-void CPDF_TextObject::GetTextMatrix(CFX_AffineMatrix* pMatrix) const {
+void CPDF_TextObject::GetTextMatrix(CFX_Matrix* pMatrix) const {
FX_FLOAT* pTextMatrix = m_TextState.GetMatrix();
pMatrix->Set(pTextMatrix[0], pTextMatrix[2], pTextMatrix[1], pTextMatrix[3],
m_PosX, m_PosY);
@@ -509,7 +509,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
min_y = min_y * fontsize / 1000;
max_y = max_y * fontsize / 1000;
}
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
GetTextMatrix(&matrix);
m_Left = min_x;
m_Right = max_x;
@@ -553,9 +553,9 @@ void CPDF_TextObject::CalcCharPos(FX_FLOAT* pPosArray) const {
}
}
-void CPDF_TextObject::Transform(const CFX_AffineMatrix& matrix) {
+void CPDF_TextObject::Transform(const CFX_Matrix& matrix) {
m_TextState.GetModify();
- CFX_AffineMatrix text_matrix;
+ CFX_Matrix text_matrix;
GetTextMatrix(&text_matrix);
text_matrix.Concat(matrix);
FX_FLOAT* pTextMatrix = m_TextState.GetMatrix();
@@ -623,7 +623,7 @@ void CPDF_ShadingObject::CopyData(const CPDF_PageObject* pSrc) {
}
m_Matrix = pSrcObj->m_Matrix;
}
-void CPDF_ShadingObject::Transform(const CFX_AffineMatrix& matrix) {
+void CPDF_ShadingObject::Transform(const CFX_Matrix& matrix) {
if (!m_ClipPath.IsNull()) {
m_ClipPath.GetModify();
m_ClipPath.Transform(matrix);
@@ -648,7 +648,7 @@ void CPDF_ShadingObject::CalcBoundingBox() {
CPDF_FormObject::~CPDF_FormObject() {
delete m_pForm;
}
-void CPDF_FormObject::Transform(const CFX_AffineMatrix& matrix) {
+void CPDF_FormObject::Transform(const CFX_Matrix& matrix) {
m_FormMatrix.Concat(matrix);
CalcBoundingBox();
}
@@ -725,7 +725,7 @@ CPDF_PageObject* CPDF_PageObjects::GetObjectByIndex(int index) const {
}
return (CPDF_PageObject*)m_ObjectList.GetAt(pos);
}
-void CPDF_PageObjects::Transform(const CFX_AffineMatrix& matrix) {
+void CPDF_PageObjects::Transform(const CFX_Matrix& matrix) {
FX_POSITION pos = m_ObjectList.GetHeadPosition();
while (pos) {
CPDF_PageObject* pObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
@@ -923,7 +923,7 @@ CPDF_Form::CPDF_Form(CPDF_Document* pDoc,
}
CPDF_Form::~CPDF_Form() {}
void CPDF_Form::StartParse(CPDF_AllStates* pGraphicStates,
- CFX_AffineMatrix* pParentMatrix,
+ CFX_Matrix* pParentMatrix,
CPDF_Type3Char* pType3Char,
CPDF_ParseOptions* pOptions,
int level) {
@@ -936,7 +936,7 @@ void CPDF_Form::StartParse(CPDF_AllStates* pGraphicStates,
m_ParseState = CONTENT_PARSING;
}
void CPDF_Form::ParseContent(CPDF_AllStates* pGraphicStates,
- CFX_AffineMatrix* pParentMatrix,
+ CFX_Matrix* pParentMatrix,
CPDF_Type3Char* pType3Char,
CPDF_ParseOptions* pOptions,
int level) {
@@ -953,7 +953,7 @@ CPDF_Form* CPDF_Form::Clone() const {
}
return pClone;
}
-void CPDF_Page::GetDisplayMatrix(CFX_AffineMatrix& matrix,
+void CPDF_Page::GetDisplayMatrix(CFX_Matrix& matrix,
int xPos,
int yPos,
int xSize,
@@ -962,7 +962,7 @@ void CPDF_Page::GetDisplayMatrix(CFX_AffineMatrix& matrix,
if (m_PageWidth == 0 || m_PageHeight == 0) {
return;
}
- CFX_AffineMatrix display_matrix;
+ CFX_Matrix display_matrix;
int x0, y0, x1, y1, x2, y2;
iRotate %= 4;
switch (iRotate) {
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 3ae04d7111..44d1dc47b6 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -91,7 +91,7 @@ CPDF_ColorSpace* CPDF_Document::LoadColorSpace(CPDF_Object* pCSObj,
}
CPDF_Pattern* CPDF_Document::LoadPattern(CPDF_Object* pPatternObj,
FX_BOOL bShading,
- const CFX_AffineMatrix* matrix) {
+ const CFX_Matrix* matrix) {
return GetValidatePageData()->GetPattern(pPatternObj, bShading, matrix);
}
CPDF_IccProfile* CPDF_Document::LoadIccProfile(CPDF_Stream* pStream) {
@@ -404,7 +404,7 @@ void CPDF_DocPageData::ReleaseColorSpace(CPDF_Object* pColorSpace) {
CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj,
FX_BOOL bShading,
- const CFX_AffineMatrix* matrix) {
+ const CFX_Matrix* matrix) {
if (!pPatternObj)
return nullptr;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
index 5c43b44e76..3852a4852a 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -190,7 +190,7 @@ void CPDF_ClipPath::AppendTexts(CPDF_TextObject** pTexts, int count) {
pData->m_pTextList[pData->m_TextCount + count] = NULL;
pData->m_TextCount += count + 1;
}
-void CPDF_ClipPath::Transform(const CPDF_Matrix& matrix) {
+void CPDF_ClipPath::Transform(const CFX_Matrix& matrix) {
CPDF_ClipPathData* pData = GetModify();
int i;
for (i = 0; i < pData->m_PathCount; i++) {
@@ -529,7 +529,7 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
if (ToDictionary(pObject)) {
pGeneralState->m_pSoftMask = pObject;
FXSYS_memcpy(pGeneralState->m_SMaskMatrix,
- &pParser->GetCurStates()->m_CTM, sizeof(CPDF_Matrix));
+ &pParser->GetCurStates()->m_CTM, sizeof(CFX_Matrix));
} else {
pGeneralState->m_pSoftMask = NULL;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
index 9c16173a6f..775bd91d16 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
@@ -32,7 +32,7 @@ void CPDF_ImageObject::CopyData(const CPDF_PageObject* pSrc) {
m_pImage = pSrcObj->m_pImage->Clone();
m_Matrix = pSrcObj->m_Matrix;
}
-void CPDF_ImageObject::Transform(const CFX_AffineMatrix& matrix) {
+void CPDF_ImageObject::Transform(const CFX_Matrix& matrix) {
m_Matrix.Concat(matrix);
CalcBoundingBox();
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index a2d4988f92..21fddead33 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -19,7 +19,7 @@ CPDF_StreamContentParser::CPDF_StreamContentParser(
CPDF_Document* pDocument,
CPDF_Dictionary* pPageResources,
CPDF_Dictionary* pParentResources,
- CFX_AffineMatrix* pmtContentToUser,
+ CFX_Matrix* pmtContentToUser,
CPDF_PageObjects* pObjList,
CPDF_Dictionary* pResources,
CPDF_Rect* pBBox,
@@ -620,7 +620,7 @@ void CPDF_StreamContentParser::Handle_ConcatMatrix() {
FX_FLOAT a2 = GetNumber16(5), b2 = GetNumber16(4), c2 = GetNumber16(3),
d2 = GetNumber16(2);
FX_FLOAT e2 = GetNumber(1), f2 = GetNumber(0);
- CFX_AffineMatrix new_matrix(a2, b2, c2, d2, e2, f2);
+ CFX_Matrix new_matrix(a2, b2, c2, d2, e2, f2);
new_matrix.Concat(m_pCurStates->m_CTM);
m_pCurStates->m_CTM = new_matrix;
OnChangeTextMatrix();
@@ -721,8 +721,7 @@ void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) {
if (!m_Options.m_bSeparateForm) {
CPDF_Dictionary* pResources =
pStream->GetDict()->GetDict(FX_BSTRC("Resources"));
- CFX_AffineMatrix form_matrix =
- pStream->GetDict()->GetMatrix(FX_BSTRC("Matrix"));
+ CFX_Matrix form_matrix = pStream->GetDict()->GetMatrix(FX_BSTRC("Matrix"));
form_matrix.Concat(m_pCurStates->m_CTM);
CPDF_Array* pBBox = pStream->GetDict()->GetArray(FX_BSTRC("BBox"));
CFX_FloatRect form_bbox;
@@ -777,7 +776,7 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream,
if (pStream == NULL && pImage == NULL) {
return NULL;
}
- CFX_AffineMatrix ImageMatrix;
+ CFX_Matrix ImageMatrix;
ImageMatrix.Copy(m_pCurStates->m_CTM);
ImageMatrix.Concat(m_mtContentToUser);
CPDF_ImageObject* pImageObj = new CPDF_ImageObject;
@@ -1093,7 +1092,7 @@ void CPDF_StreamContentParser::Handle_SetColorPS_Stroke() {
}
CFX_FloatRect GetShadingBBox(CPDF_Stream* pStream,
ShadingType type,
- const CFX_AffineMatrix* pMatrix,
+ const CFX_Matrix* pMatrix,
CPDF_Function** pFuncs,
int nFuncs,
CPDF_ColorSpace* pCS);
@@ -1387,8 +1386,8 @@ void CPDF_StreamContentParser::Handle_SetTextMatrix() {
m_pCurStates->m_TextLineY = 0;
}
void CPDF_StreamContentParser::OnChangeTextMatrix() {
- CFX_AffineMatrix text_matrix(m_pCurStates->m_TextHorzScale, 0.0f, 0.0f, 1.0f,
- 0.0f, 0.0f);
+ CFX_Matrix text_matrix(m_pCurStates->m_TextHorzScale, 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f);
text_matrix.Concat(m_pCurStates->m_TextMatrix);
text_matrix.Concat(m_pCurStates->m_CTM);
text_matrix.Concat(m_mtContentToUser);
@@ -1511,7 +1510,7 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, FX_BOOL bStroke) {
pPathData->SetPointCount(PathPointCount);
FXSYS_memcpy(pPathData->GetPoints(), m_pPathPoints,
sizeof(FX_PATHPOINT) * PathPointCount);
- CFX_AffineMatrix matrix = m_pCurStates->m_CTM;
+ CFX_Matrix matrix = m_pCurStates->m_CTM;
matrix.Concat(m_mtContentToUser);
if (bStroke || FillType) {
CPDF_PathObject* pPathObj = new CPDF_PathObject;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index a1aa686248..d862225ec6 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -962,15 +962,14 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions) {
}
void CPDF_ContentParser::Start(CPDF_Form* pForm,
CPDF_AllStates* pGraphicStates,
- CFX_AffineMatrix* pParentMatrix,
+ CFX_Matrix* pParentMatrix,
CPDF_Type3Char* pType3Char,
CPDF_ParseOptions* pOptions,
int level) {
m_pType3Char = pType3Char;
m_pObjects = pForm;
m_bForm = TRUE;
- CFX_AffineMatrix form_matrix =
- pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
+ CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
if (pGraphicStates) {
form_matrix.Concat(pGraphicStates->m_CTM);
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp
index 0880388541..a768434647 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp
@@ -17,7 +17,7 @@ void CPDF_PathObject::CopyData(const CPDF_PageObject* pSrc) {
m_bStroke = pSrcObj->m_bStroke;
m_Matrix = pSrcObj->m_Matrix;
}
-void CPDF_PathObject::Transform(const CPDF_Matrix& matrix) {
+void CPDF_PathObject::Transform(const CFX_Matrix& matrix) {
m_Matrix.Concat(matrix);
CalcBoundingBox();
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
index 0c6b476db2..77e375bcc0 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
@@ -26,7 +26,7 @@ ShadingType ToShadingType(int type) {
} // namespace
-CPDF_Pattern::CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix)
+CPDF_Pattern::CPDF_Pattern(const CFX_Matrix* pParentMatrix)
: m_pPatternObj(NULL),
m_PatternType(PATTERN_TILING),
m_pDocument(NULL),
@@ -38,7 +38,7 @@ CPDF_Pattern::CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix)
CPDF_Pattern::~CPDF_Pattern() {}
CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc,
CPDF_Object* pPatternObj,
- const CFX_AffineMatrix* parentMatrix)
+ const CFX_Matrix* parentMatrix)
: CPDF_Pattern(parentMatrix) {
m_PatternType = PATTERN_TILING;
m_pPatternObj = pPatternObj;
@@ -80,7 +80,7 @@ FX_BOOL CPDF_TilingPattern::Load() {
CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc,
CPDF_Object* pPatternObj,
FX_BOOL bShading,
- const CFX_AffineMatrix* parentMatrix)
+ const CFX_Matrix* parentMatrix)
: CPDF_Pattern(parentMatrix) {
m_PatternType = PATTERN_SHADING;
m_pPatternObj = bShading ? NULL : pPatternObj;
@@ -253,7 +253,7 @@ void CPDF_MeshStream::GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b) {
}
}
FX_DWORD CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex,
- CFX_AffineMatrix* pObject2Bitmap) {
+ CFX_Matrix* pObject2Bitmap) {
FX_DWORD flag = GetFlag();
GetCoords(vertex.x, vertex.y);
pObject2Bitmap->Transform(vertex.x, vertex.y);
@@ -263,7 +263,7 @@ FX_DWORD CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex,
}
FX_BOOL CPDF_MeshStream::GetVertexRow(CPDF_MeshVertex* vertex,
int count,
- CFX_AffineMatrix* pObject2Bitmap) {
+ CFX_Matrix* pObject2Bitmap) {
for (int i = 0; i < count; i++) {
if (m_BitStream.IsEOF()) {
return FALSE;
@@ -278,7 +278,7 @@ FX_BOOL CPDF_MeshStream::GetVertexRow(CPDF_MeshVertex* vertex,
CFX_FloatRect GetShadingBBox(CPDF_Stream* pStream,
ShadingType type,
- const CFX_AffineMatrix* pMatrix,
+ const CFX_Matrix* pMatrix,
CPDF_Function** pFuncs,
int nFuncs,
CPDF_ColorSpace* pCS) {
diff --git a/core/src/fpdfapi/fpdf_page/pageint.h b/core/src/fpdfapi/fpdf_page/pageint.h
index 84c8366780..d5a035fe2b 100644
--- a/core/src/fpdfapi/fpdf_page/pageint.h
+++ b/core/src/fpdfapi/fpdf_page/pageint.h
@@ -167,7 +167,7 @@ class CPDF_StreamContentParser {
CPDF_StreamContentParser(CPDF_Document* pDoc,
CPDF_Dictionary* pPageResources,
CPDF_Dictionary* pParentResources,
- CFX_AffineMatrix* pmtContentToUser,
+ CFX_Matrix* pmtContentToUser,
CPDF_PageObjects* pObjList,
CPDF_Dictionary* pResources,
CFX_FloatRect* pBBox,
@@ -312,7 +312,7 @@ class CPDF_StreamContentParser {
CPDF_Dictionary* m_pResources;
CPDF_PageObjects* m_pObjectList;
int m_Level;
- CFX_AffineMatrix m_mtContentToUser;
+ CFX_Matrix m_mtContentToUser;
CFX_FloatRect m_BBox;
CPDF_ParseOptions m_Options;
_ContentParam m_ParamBuf1[PARAM_BUF_SIZE];
@@ -357,7 +357,7 @@ class CPDF_ContentParser {
void Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions);
void Start(CPDF_Form* pForm,
CPDF_AllStates* pGraphicStates,
- CFX_AffineMatrix* pParentMatrix,
+ CFX_Matrix* pParentMatrix,
CPDF_Type3Char* pType3Char,
CPDF_ParseOptions* pOptions,
int level);
@@ -386,7 +386,7 @@ class CPDF_AllStates : public CPDF_GraphicStates {
void Copy(const CPDF_AllStates& src);
void ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser* pParser);
void SetLineDash(CPDF_Array*, FX_FLOAT, FX_FLOAT scale);
- CFX_AffineMatrix m_TextMatrix, m_CTM, m_ParentMatrix;
+ CFX_Matrix m_TextMatrix, m_CTM, m_ParentMatrix;
FX_FLOAT m_TextX, m_TextY, m_TextLineX, m_TextLineY;
FX_FLOAT m_TextLeading, m_TextRise, m_TextHorzScale;
};
@@ -407,7 +407,7 @@ class CPDF_DocPageData {
void ReleaseColorSpace(CPDF_Object* pColorSpace);
CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj,
FX_BOOL bShading,
- const CFX_AffineMatrix* matrix);
+ const CFX_Matrix* matrix);
void ReleasePattern(CPDF_Object* pPatternObj);
CPDF_Image* GetImage(CPDF_Object* pImageStream);
void ReleaseImage(CPDF_Object* pImageStream);
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
index 752a09d83d..f91ddfa5dc 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
@@ -440,8 +440,8 @@ CFX_FloatRect CPDF_Array::GetRect() {
rect.top = GetNumber(3);
return rect;
}
-CFX_AffineMatrix CPDF_Array::GetMatrix() {
- CFX_AffineMatrix matrix;
+CFX_Matrix CPDF_Array::GetMatrix() {
+ CFX_Matrix matrix;
if (!IsArray() || m_Objects.GetSize() != 6)
return matrix;
@@ -702,8 +702,8 @@ CFX_FloatRect CPDF_Dictionary::GetRect(const CFX_ByteStringC& key) const {
rect = pArray->GetRect();
return rect;
}
-CFX_AffineMatrix CPDF_Dictionary::GetMatrix(const CFX_ByteStringC& key) const {
- CFX_AffineMatrix matrix;
+CFX_Matrix CPDF_Dictionary::GetMatrix(const CFX_ByteStringC& key) const {
+ CFX_Matrix matrix;
CPDF_Array* pArray = GetArray(key);
if (pArray)
matrix = pArray->GetMatrix();
@@ -814,7 +814,7 @@ void CPDF_Dictionary::SetAtRect(const CFX_ByteStringC& key,
SetAt(key, pArray);
}
void CPDF_Dictionary::SetAtMatrix(const CFX_ByteStringC& key,
- const CFX_AffineMatrix& matrix) {
+ const CFX_Matrix& matrix) {
CPDF_Array* pArray = new CPDF_Array;
pArray->AddNumber16(matrix.a);
pArray->AddNumber16(matrix.b);
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index a2638fe7e1..faf6afe7f6 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -181,7 +181,7 @@ CPDF_RenderStatus::~CPDF_RenderStatus() {
FX_BOOL CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext,
CFX_RenderDevice* pDevice,
- const CFX_AffineMatrix* pDeviceMatrix,
+ const CFX_Matrix* pDeviceMatrix,
const CPDF_PageObject* pStopObj,
const CPDF_RenderStatus* pParentState,
const CPDF_GraphicStates* pInitialStates,
@@ -241,9 +241,9 @@ FX_BOOL CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext,
return TRUE;
}
void CPDF_RenderStatus::RenderObjectList(const CPDF_PageObjects* pObjs,
- const CFX_AffineMatrix* pObj2Device) {
+ const CFX_Matrix* pObj2Device) {
CFX_FloatRect clip_rect = m_pDevice->GetClipBox();
- CFX_AffineMatrix device2object;
+ CFX_Matrix device2object;
device2object.SetReverse(*pObj2Device);
device2object.TransformRect(clip_rect);
int index = 0;
@@ -270,9 +270,8 @@ void CPDF_RenderStatus::RenderObjectList(const CPDF_PageObjects* pObjs,
}
}
}
-void CPDF_RenderStatus::RenderSingleObject(
- const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device) {
+void CPDF_RenderStatus::RenderSingleObject(const CPDF_PageObject* pObj,
+ const CFX_Matrix* pObj2Device) {
CFX_AutoRestorer<int> restorer(&s_CurrentRecursionDepth);
if (++s_CurrentRecursionDepth > kRenderMaxRecursionDepth) {
return;
@@ -290,10 +289,9 @@ void CPDF_RenderStatus::RenderSingleObject(
ProcessObjectNoClip(pObj, pObj2Device);
}
-FX_BOOL CPDF_RenderStatus::ContinueSingleObject(
- const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device,
- IFX_Pause* pPause) {
+FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj,
+ const CFX_Matrix* pObj2Device,
+ IFX_Pause* pPause) {
if (m_pObjectRenderer) {
if (m_pObjectRenderer->Continue(pPause))
return TRUE;
@@ -335,11 +333,10 @@ IPDF_ObjectRenderer* IPDF_ObjectRenderer::Create(int type) {
}
return new CPDF_ImageRenderer;
}
-FX_BOOL CPDF_RenderStatus::GetObjectClippedRect(
- const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device,
- FX_BOOL bLogical,
- FX_RECT& rect) const {
+FX_BOOL CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj,
+ const CFX_Matrix* pObj2Device,
+ FX_BOOL bLogical,
+ FX_RECT& rect) const {
rect = pObj->GetBBox(pObj2Device);
FX_RECT rtClip = m_pDevice->GetClipBox();
if (!bLogical) {
@@ -359,7 +356,7 @@ FX_BOOL CPDF_RenderStatus::GetObjectClippedRect(
return rect.IsEmpty();
}
void CPDF_RenderStatus::DitherObjectArea(const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device) {
+ const CFX_Matrix* pObj2Device) {
CFX_DIBitmap* pBitmap = m_pDevice->GetBitmap();
if (pBitmap == NULL) {
return;
@@ -380,9 +377,8 @@ void CPDF_RenderStatus::DitherObjectArea(const CPDF_PageObject* pObj,
pBitmap->DitherFS(pal, 16, &rect);
}
}
-void CPDF_RenderStatus::ProcessObjectNoClip(
- const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device) {
+void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj,
+ const CFX_Matrix* pObj2Device) {
FX_BOOL bRet = FALSE;
switch (pObj->m_Type) {
case PDFPAGE_TEXT:
@@ -405,9 +401,8 @@ void CPDF_RenderStatus::ProcessObjectNoClip(
DrawObjWithBackground(pObj, pObj2Device);
}
}
-FX_BOOL CPDF_RenderStatus::DrawObjWithBlend(
- const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device) {
+FX_BOOL CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj,
+ const CFX_Matrix* pObj2Device) {
FX_BOOL bRet = FALSE;
switch (pObj->m_Type) {
case PDFPAGE_PATH:
@@ -427,9 +422,8 @@ void CPDF_RenderStatus::GetScaledMatrix(CFX_Matrix& matrix) const {
matrix.a *= FXSYS_fabs(dCTM.a);
matrix.d *= FXSYS_fabs(dCTM.d);
}
-void CPDF_RenderStatus::DrawObjWithBackground(
- const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device) {
+void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj,
+ const CFX_Matrix* pObj2Device) {
FX_RECT rect;
if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) {
return;
@@ -443,7 +437,7 @@ void CPDF_RenderStatus::DrawObjWithBackground(
if (!buffer.Initialize(m_pContext, m_pDevice, &rect, pObj, &m_Options, res)) {
return;
}
- CFX_AffineMatrix matrix = *pObj2Device;
+ CFX_Matrix matrix = *pObj2Device;
matrix.Concat(*buffer.GetMatrix());
GetScaledMatrix(matrix);
CPDF_Dictionary* pFormResource = NULL;
@@ -462,14 +456,14 @@ void CPDF_RenderStatus::DrawObjWithBackground(
buffer.OutputToDevice();
}
FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj,
- const CFX_AffineMatrix* pObj2Device) {
+ const CFX_Matrix* pObj2Device) {
CPDF_Dictionary* pOC =
pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("OC"));
if (pOC && m_Options.m_pOCContext &&
!m_Options.m_pOCContext->CheckOCGVisible(pOC)) {
return TRUE;
}
- CFX_AffineMatrix matrix = pFormObj->m_FormMatrix;
+ CFX_Matrix matrix = pFormObj->m_FormMatrix;
matrix.Concat(*pObj2Device);
CPDF_Dictionary* pResources = NULL;
if (pFormObj->m_pForm && pFormObj->m_pForm->m_pFormDict) {
@@ -486,7 +480,7 @@ FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj,
m_pDevice->RestoreState();
return TRUE;
}
-FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix) {
+FX_BOOL IsAvailableMatrix(const CFX_Matrix& matrix) {
if (matrix.a == 0 || matrix.d == 0) {
return matrix.b != 0 && matrix.c != 0;
}
@@ -496,7 +490,7 @@ FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix) {
return TRUE;
}
FX_BOOL CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj,
- const CFX_AffineMatrix* pObj2Device) {
+ const CFX_Matrix* pObj2Device) {
int FillType = pPathObj->m_FillType;
FX_BOOL bStroke = pPathObj->m_bStroke;
ProcessPathPattern(pPathObj, pObj2Device, FillType, bStroke);
@@ -511,7 +505,7 @@ FX_BOOL CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj,
if (bStroke) {
stroke_argb = GetStrokeArgb(pPathObj);
}
- CFX_AffineMatrix path_matrix = pPathObj->m_Matrix;
+ CFX_Matrix path_matrix = pPathObj->m_Matrix;
path_matrix.Concat(*pObj2Device);
if (!IsAvailableMatrix(path_matrix)) {
return TRUE;
@@ -623,7 +617,7 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const {
return m_Options.TranslateColor(ArgbEncode(alpha, rgb));
}
void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath,
- const CFX_AffineMatrix* pObj2Device) {
+ const CFX_Matrix* pObj2Device) {
if (ClipPath.IsNull()) {
if (!m_LastClipPath.IsNull()) {
m_pDevice->RestoreState(TRUE);
@@ -683,7 +677,7 @@ void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath,
}
void CPDF_RenderStatus::DrawClipPath(CPDF_ClipPath ClipPath,
- const CFX_AffineMatrix* pObj2Device) {
+ const CFX_Matrix* pObj2Device) {
if (ClipPath.IsNull()) {
return;
}
@@ -707,9 +701,9 @@ void CPDF_RenderStatus::DrawClipPath(CPDF_ClipPath ClipPath,
}
}
FX_BOOL CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
FX_BOOL bStroke) {
- CFX_AffineMatrix path_matrix = pPathObj->m_Matrix;
+ CFX_Matrix path_matrix = pPathObj->m_Matrix;
path_matrix.Concat(*pObj2Device);
if (bStroke) {
CFX_GraphStateData graphState(*pPathObj->m_GraphState);
@@ -725,9 +719,8 @@ FX_BOOL CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj,
}
return m_pDevice->SetClip_PathFill(pPathObj->m_Path, &path_matrix, fill_mode);
}
-FX_BOOL CPDF_RenderStatus::ProcessTransparency(
- const CPDF_PageObject* pPageObj,
- const CFX_AffineMatrix* pObj2Device) {
+FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj,
+ const CFX_Matrix* pObj2Device) {
const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState;
int blend_type =
pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL;
@@ -838,7 +831,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(
CFX_DIBitmap* bitmap = bitmap_device.GetBitmap();
bitmap->Clear(0);
- CFX_AffineMatrix new_matrix = *pObj2Device;
+ CFX_Matrix new_matrix = *pObj2Device;
new_matrix.TranslateI(-rect.left, -rect.top);
new_matrix.Scale(scaleX, scaleY);
nonstd::unique_ptr<CFX_DIBitmap> pTextMask;
@@ -855,7 +848,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(
if (textobj == NULL) {
break;
}
- CFX_AffineMatrix text_matrix;
+ CFX_Matrix text_matrix;
textobj->GetTextMatrix(&text_matrix);
CPDF_TextRenderer::DrawTextPath(
&text_device, textobj->m_nChars, textobj->m_pCharCodes,
@@ -871,7 +864,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(
bitmap_render.ProcessObjectNoClip(pPageObj, &new_matrix);
m_bStopped = bitmap_render.m_bStopped;
if (pSMaskDict) {
- CFX_AffineMatrix smask_matrix;
+ CFX_Matrix smask_matrix;
FXSYS_memcpy(&smask_matrix, pGeneralState->m_SMaskMatrix,
sizeof smask_matrix);
smask_matrix.Concat(*pObj2Device);
@@ -930,7 +923,7 @@ CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj,
return pBackdrop.release();
}
- CFX_AffineMatrix FinalMatrix = m_DeviceMatrix;
+ CFX_Matrix FinalMatrix = m_DeviceMatrix;
FinalMatrix.TranslateI(-left, -top);
FinalMatrix.Scale(scaleX, scaleY);
pBackdrop->Clear(pBackdrop->HasAlpha() ? 0 : 0xffffffff);
@@ -943,7 +936,7 @@ CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj,
void CPDF_RenderContext::GetBackground(CFX_DIBitmap* pBuffer,
const CPDF_PageObject* pObj,
const CPDF_RenderOptions* pOptions,
- CFX_AffineMatrix* pFinalMatrix) {
+ CFX_Matrix* pFinalMatrix) {
CFX_FxgeDevice device;
device.Attach(pBuffer);
@@ -994,9 +987,8 @@ void CPDF_RenderContext::Clear() {
m_bFirstLayer = TRUE;
m_ContentList.RemoveAll();
}
-void CPDF_RenderContext::AppendObjectList(
- CPDF_PageObjects* pObjs,
- const CFX_AffineMatrix* pObject2Device) {
+void CPDF_RenderContext::AppendObjectList(CPDF_PageObjects* pObjs,
+ const CFX_Matrix* pObject2Device) {
_PDF_RenderItem* pItem = m_ContentList.AddSpace();
pItem->m_pObjectList = pObjs;
if (pObject2Device) {
@@ -1007,19 +999,19 @@ void CPDF_RenderContext::AppendObjectList(
}
void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice,
const CPDF_RenderOptions* pOptions,
- const CFX_AffineMatrix* pLastMatrix) {
+ const CFX_Matrix* pLastMatrix) {
Render(pDevice, NULL, pOptions, pLastMatrix);
}
void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice,
const CPDF_PageObject* pStopObj,
const CPDF_RenderOptions* pOptions,
- const CFX_AffineMatrix* pLastMatrix) {
+ const CFX_Matrix* pLastMatrix) {
int count = m_ContentList.GetSize();
for (int j = 0; j < count; j++) {
pDevice->SaveState();
_PDF_RenderItem* pItem = m_ContentList.GetDataPtr(j);
if (pLastMatrix) {
- CFX_AffineMatrix FinalMatrix = pItem->m_Matrix;
+ CFX_Matrix FinalMatrix = pItem->m_Matrix;
FinalMatrix.Concat(*pLastMatrix);
CPDF_RenderStatus status;
status.Initialize(this, pDevice, pLastMatrix, pStopObj, NULL, NULL,
@@ -1051,7 +1043,7 @@ void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice,
}
void CPDF_RenderContext::DrawObjectList(CFX_RenderDevice* pDevice,
CPDF_PageObjects* pObjs,
- const CFX_AffineMatrix* pObject2Device,
+ const CFX_Matrix* pObject2Device,
const CPDF_RenderOptions* pOptions) {
AppendObjectList(pObjs, pObject2Device);
Render(pDevice, pOptions);
@@ -1130,7 +1122,7 @@ void CPDF_ProgressiveRenderer::Continue(IFX_Pause* pPause) {
pItem->m_pObjectList->m_Transparency, FALSE, NULL);
m_pDevice->SaveState();
m_ClipRect = m_pDevice->GetClipBox();
- CFX_AffineMatrix device2object;
+ CFX_Matrix device2object;
device2object.SetReverse(pItem->m_Matrix);
device2object.TransformRect(m_ClipRect);
}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 71e847a160..81efc956a2 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -15,7 +15,7 @@
#include "core/src/fpdfapi/fpdf_page/pageint.h"
FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj,
- const CFX_AffineMatrix* pObj2Device) {
+ const CFX_Matrix* pObj2Device) {
CPDF_ImageRenderer render;
if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) {
render.Continue(NULL);
@@ -471,7 +471,7 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() {
}
FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus,
const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
FX_BOOL bStdCS,
int blendType) {
m_pRenderStatus = pStatus;
@@ -495,7 +495,7 @@ FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus,
const CFX_DIBSource* pDIBSource,
FX_ARGB bitmap_argb,
int bitmap_alpha,
- const CFX_AffineMatrix* pImage2Device,
+ const CFX_Matrix* pImage2Device,
FX_DWORD flags,
FX_BOOL bStdCS,
int blendType) {
@@ -520,7 +520,7 @@ FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) {
if (rect.IsEmpty()) {
return FALSE;
}
- CFX_AffineMatrix new_matrix = m_ImageMatrix;
+ CFX_Matrix new_matrix = m_ImageMatrix;
new_matrix.TranslateI(-rect.left, -rect.top);
int width = rect.Width();
int height = rect.Height();
@@ -617,7 +617,7 @@ FX_BOOL CPDF_ImageRenderer::DrawMaskedImage() {
if (rect.IsEmpty()) {
return FALSE;
}
- CFX_AffineMatrix new_matrix = m_ImageMatrix;
+ CFX_Matrix new_matrix = m_ImageMatrix;
new_matrix.TranslateI(-rect.left, -rect.top);
int width = rect.Width();
int height = rect.Height();
@@ -901,7 +901,7 @@ ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(
int bpc,
const CPDF_Dictionary* pParams);
FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj,
- CFX_AffineMatrix* pImage2Device,
+ CFX_Matrix* pImage2Device,
const FX_RECT* pClipBox) {
if (FXSYS_fabs(pImage2Device->a) < FXSYS_fabs(pImage2Device->b) * 10 &&
FXSYS_fabs(pImage2Device->d) < FXSYS_fabs(pImage2Device->c) * 10) {
@@ -1042,7 +1042,7 @@ FX_BOOL CPDF_QuickStretcher::Continue(IFX_Pause* pPause) {
}
CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
FX_RECT* pClipRect,
- const CFX_AffineMatrix* pMatrix) {
+ const CFX_Matrix* pMatrix) {
if (pSMaskDict == NULL) {
return NULL;
}
@@ -1059,7 +1059,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
if (pFuncObj && (pFuncObj->IsDictionary() || pFuncObj->IsStream()))
pFunc.reset(CPDF_Function::Load(pFuncObj));
- CFX_AffineMatrix matrix = *pMatrix;
+ CFX_Matrix matrix = *pMatrix;
matrix.TranslateI(-pClipRect->left, -pClipRect->top);
CPDF_Form form(m_pContext->m_pDocument, m_pContext->m_pPageResources, pGroup);
form.ParseContent(NULL, NULL, NULL, NULL);
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 576c18ebbd..193c2ae05a 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -13,7 +13,7 @@
#define SHADING_STEPS 256
static void DrawAxialShading(CFX_DIBitmap* pBitmap,
- CFX_AffineMatrix* pObject2Bitmap,
+ CFX_Matrix* pObject2Bitmap,
CPDF_Dictionary* pDict,
CPDF_Function** pFuncs,
int nFuncs,
@@ -46,7 +46,7 @@ static void DrawAxialShading(CFX_DIBitmap* pBitmap,
FX_FLOAT y_span = end_y - start_y;
FX_FLOAT axis_len_square =
FXSYS_Mul(x_span, x_span) + FXSYS_Mul(y_span, y_span);
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
matrix.SetReverse(*pObject2Bitmap);
int total_results = 0;
for (int j = 0; j < nFuncs; j++) {
@@ -104,7 +104,7 @@ static void DrawAxialShading(CFX_DIBitmap* pBitmap,
}
}
static void DrawRadialShading(CFX_DIBitmap* pBitmap,
- CFX_AffineMatrix* pObject2Bitmap,
+ CFX_Matrix* pObject2Bitmap,
CPDF_Dictionary* pDict,
CPDF_Function** pFuncs,
int nFuncs,
@@ -121,7 +121,7 @@ static void DrawRadialShading(CFX_DIBitmap* pBitmap,
FX_FLOAT end_x = pCoords->GetNumber(3);
FX_FLOAT end_y = pCoords->GetNumber(4);
FX_FLOAT end_r = pCoords->GetNumber(5);
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
matrix.SetReverse(*pObject2Bitmap);
FX_FLOAT t_min = 0, t_max = 1.0f;
CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Domain"));
@@ -242,7 +242,7 @@ static void DrawRadialShading(CFX_DIBitmap* pBitmap,
}
}
static void DrawFuncShading(CFX_DIBitmap* pBitmap,
- CFX_AffineMatrix* pObject2Bitmap,
+ CFX_Matrix* pObject2Bitmap,
CPDF_Dictionary* pDict,
CPDF_Function** pFuncs,
int nFuncs,
@@ -257,8 +257,8 @@ static void DrawFuncShading(CFX_DIBitmap* pBitmap,
ymin = pDomain->GetNumber(2);
ymax = pDomain->GetNumber(3);
}
- CFX_AffineMatrix mtDomain2Target = pDict->GetMatrix(FX_BSTRC("Matrix"));
- CFX_AffineMatrix matrix, reverse_matrix;
+ CFX_Matrix mtDomain2Target = pDict->GetMatrix(FX_BSTRC("Matrix"));
+ CFX_Matrix matrix, reverse_matrix;
matrix.SetReverse(*pObject2Bitmap);
reverse_matrix.SetReverse(mtDomain2Target);
matrix.Concat(reverse_matrix);
@@ -411,7 +411,7 @@ static void DrawGouraud(CFX_DIBitmap* pBitmap,
}
}
static void DrawFreeGouraudShading(CFX_DIBitmap* pBitmap,
- CFX_AffineMatrix* pObject2Bitmap,
+ CFX_Matrix* pObject2Bitmap,
CPDF_Stream* pShadingStream,
CPDF_Function** pFuncs,
int nFuncs,
@@ -445,7 +445,7 @@ static void DrawFreeGouraudShading(CFX_DIBitmap* pBitmap,
}
}
static void DrawLatticeGouraudShading(CFX_DIBitmap* pBitmap,
- CFX_AffineMatrix* pObject2Bitmap,
+ CFX_Matrix* pObject2Bitmap,
CPDF_Stream* pShadingStream,
CPDF_Function** pFuncs,
int nFuncs,
@@ -748,7 +748,7 @@ FX_BOOL _CheckCoonTensorPara(const CPDF_MeshStream& stream) {
static void DrawCoonPatchMeshes(FX_BOOL bTensor,
CFX_DIBitmap* pBitmap,
- CFX_AffineMatrix* pObject2Bitmap,
+ CFX_Matrix* pObject2Bitmap,
CPDF_Stream* pShadingStream,
CPDF_Function** pFuncs,
int nFuncs,
@@ -826,7 +826,7 @@ static void DrawCoonPatchMeshes(FX_BOOL bTensor,
}
}
void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
- CFX_AffineMatrix* pMatrix,
+ CFX_Matrix* pMatrix,
FX_RECT& clip_rect,
int alpha,
FX_BOOL bAlphaMode) {
@@ -861,7 +861,7 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
}
CPDF_DeviceBuffer buffer;
buffer.Initialize(m_pContext, m_pDevice, &clip_rect, m_pCurObj, 150);
- CFX_AffineMatrix FinalMatrix = *pMatrix;
+ CFX_Matrix FinalMatrix = *pMatrix;
FinalMatrix.Concat(*buffer.GetMatrix());
CFX_DIBitmap* pBitmap = buffer.GetBitmap();
if (pBitmap->GetBuffer() == NULL) {
@@ -913,7 +913,7 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
}
void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern,
CPDF_PageObject* pPageObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
FX_BOOL bStroke) {
if (!pattern->Load()) {
return;
@@ -935,7 +935,7 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern,
m_pDevice->RestoreState();
return;
}
- CFX_AffineMatrix matrix = pattern->m_Pattern2Form;
+ CFX_Matrix matrix = pattern->m_Pattern2Form;
matrix.Concat(*pObj2Device);
GetScaledMatrix(matrix);
int alpha = pPageObj->m_GeneralState.GetAlpha(bStroke);
@@ -944,14 +944,14 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern,
m_pDevice->RestoreState();
}
FX_BOOL CPDF_RenderStatus::ProcessShading(CPDF_ShadingObject* pShadingObj,
- const CFX_AffineMatrix* pObj2Device) {
+ const CFX_Matrix* pObj2Device) {
FX_RECT rect = pShadingObj->GetBBox(pObj2Device);
FX_RECT clip_box = m_pDevice->GetClipBox();
rect.Intersect(clip_box);
if (rect.IsEmpty()) {
return TRUE;
}
- CFX_AffineMatrix matrix = pShadingObj->m_Matrix;
+ CFX_Matrix matrix = pShadingObj->m_Matrix;
matrix.Concat(*pObj2Device);
DrawShading(pShadingObj->m_pShading, &matrix, rect,
pShadingObj->m_GeneralState.GetAlpha(FALSE),
@@ -961,7 +961,7 @@ FX_BOOL CPDF_RenderStatus::ProcessShading(CPDF_ShadingObject* pShadingObj,
static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc,
CPDF_PageRenderCache* pCache,
CPDF_TilingPattern* pPattern,
- const CFX_AffineMatrix* pObject2Device,
+ const CFX_Matrix* pObject2Device,
int width,
int height,
int flags) {
@@ -978,9 +978,9 @@ static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc,
pPattern->m_Pattern2Form.TransformRect(cell_bbox);
pObject2Device->TransformRect(cell_bbox);
CFX_FloatRect bitmap_rect(0.0f, 0.0f, (FX_FLOAT)width, (FX_FLOAT)height);
- CFX_AffineMatrix mtAdjust;
+ CFX_Matrix mtAdjust;
mtAdjust.MatchRect(bitmap_rect, cell_bbox);
- CFX_AffineMatrix mtPattern2Bitmap = *pObject2Device;
+ CFX_Matrix mtPattern2Bitmap = *pObject2Device;
mtPattern2Bitmap.Concat(mtAdjust);
CPDF_RenderOptions options;
if (!pPattern->m_bColored) {
@@ -996,7 +996,7 @@ static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc,
}
void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
CPDF_PageObject* pPageObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
FX_BOOL bStroke) {
if (!pPattern->Load()) {
return;
@@ -1023,7 +1023,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
FX_FLOAT sd = FXSYS_fabs(dCTM.d);
clip_box.right = clip_box.left + (int32_t)FXSYS_ceil(clip_box.Width() * sa);
clip_box.bottom = clip_box.top + (int32_t)FXSYS_ceil(clip_box.Height() * sd);
- CFX_AffineMatrix mtPattern2Device = pPattern->m_Pattern2Form;
+ CFX_Matrix mtPattern2Device = pPattern->m_Pattern2Form;
mtPattern2Device.Concat(*pObj2Device);
GetScaledMatrix(mtPattern2Device);
FX_BOOL bAligned = FALSE;
@@ -1044,7 +1044,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
height = 1;
}
int min_col, max_col, min_row, max_row;
- CFX_AffineMatrix mtDevice2Pattern;
+ CFX_Matrix mtDevice2Pattern;
mtDevice2Pattern.SetReverse(mtPattern2Device);
CFX_FloatRect clip_box_p(clip_box);
clip_box_p.Transform(&mtDevice2Pattern);
@@ -1073,7 +1073,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
orig_x = col * pPattern->m_XStep;
orig_y = row * pPattern->m_YStep;
mtPattern2Device.Transform(orig_x, orig_y);
- CFX_AffineMatrix matrix = *pObj2Device;
+ CFX_Matrix matrix = *pObj2Device;
matrix.Translate(orig_x - mtPattern2Device.e,
orig_y - mtPattern2Device.f);
m_pDevice->SaveState();
@@ -1182,7 +1182,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
delete pPatternBitmap;
}
void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
CPDF_Color* pColor,
FX_BOOL bStroke) {
CPDF_Pattern* pattern = pColor->GetPattern();
@@ -1198,7 +1198,7 @@ void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj,
}
}
void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
int& filltype,
FX_BOOL& bStroke) {
if (filltype) {
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 8cfa8dc4fb..47876a2280 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -18,7 +18,7 @@ CPDF_Type3Cache::~CPDF_Type3Cache() {
m_SizeMap.clear();
}
CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(FX_DWORD charcode,
- const CFX_AffineMatrix* pMatrix,
+ const CFX_Matrix* pMatrix,
FX_FLOAT retinaScaleX,
FX_FLOAT retinaScaleY) {
_CPDF_UniqueKeyGen keygen;
@@ -126,7 +126,7 @@ static int _DetectFirstLastScan(const CFX_DIBitmap* pBitmap, FX_BOOL bFirst) {
}
CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize,
FX_DWORD charcode,
- const CFX_AffineMatrix* pMatrix,
+ const CFX_Matrix* pMatrix,
FX_FLOAT retinaScaleX,
FX_FLOAT retinaScaleY) {
const CPDF_Type3Char* pChar = m_pFont->LoadChar(charcode);
@@ -134,7 +134,7 @@ CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize,
return nullptr;
CFX_DIBitmap* pBitmap = pChar->m_pBitmap;
- CFX_AffineMatrix image_matrix, text_matrix;
+ CFX_Matrix image_matrix, text_matrix;
image_matrix = pChar->m_ImageMatrix;
text_matrix.Set(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d, 0, 0);
image_matrix.Concat(text_matrix);
@@ -194,7 +194,7 @@ void _CPDF_UniqueKeyGen::Generate(int count, ...) {
m_KeyLen = count * sizeof(FX_DWORD);
}
FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
CFX_PathData* pClippingPath) {
if (textobj->m_nChars == 0) {
return TRUE;
@@ -257,7 +257,7 @@ FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj,
fill_argb = GetFillArgb(textobj);
}
}
- CFX_AffineMatrix text_matrix;
+ CFX_Matrix text_matrix;
textobj->GetTextMatrix(&text_matrix);
if (IsAvailableMatrix(text_matrix) == FALSE) {
return TRUE;
@@ -269,12 +269,12 @@ FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj,
return TRUE;
}
if (bClip || bStroke) {
- const CFX_AffineMatrix* pDeviceMatrix = pObj2Device;
- CFX_AffineMatrix device_matrix;
+ const CFX_Matrix* pDeviceMatrix = pObj2Device;
+ CFX_Matrix device_matrix;
if (bStroke) {
const FX_FLOAT* pCTM = textobj->m_TextState.GetObject()->m_CTM;
if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) {
- CFX_AffineMatrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0);
+ CFX_Matrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0);
text_matrix.ConcatInverse(ctm);
device_matrix.Copy(ctm);
device_matrix.Concat(*pObj2Device);
@@ -354,9 +354,8 @@ class CPDF_RefType3Cache {
FX_DWORD m_dwCount;
CPDF_Type3Font* m_pType3Font;
};
-FX_BOOL CPDF_RenderStatus::ProcessType3Text(
- const CPDF_TextObject* textobj,
- const CFX_AffineMatrix* pObj2Device) {
+FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj,
+ const CFX_Matrix* pObj2Device) {
CPDF_Type3Font* pType3Font = textobj->m_TextState.GetFont()->GetType3Font();
for (int j = 0; j < m_Type3FontCache.GetSize(); j++) {
if (m_Type3FontCache.GetAt(j) == pType3Font)
@@ -365,9 +364,9 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(
CFX_Matrix dCTM = m_pDevice->GetCTM();
FX_FLOAT sa = FXSYS_fabs(dCTM.a);
FX_FLOAT sd = FXSYS_fabs(dCTM.d);
- CFX_AffineMatrix text_matrix;
+ CFX_Matrix text_matrix;
textobj->GetTextMatrix(&text_matrix);
- CFX_AffineMatrix char_matrix = pType3Font->GetFontMatrix();
+ CFX_Matrix char_matrix = pType3Font->GetFontMatrix();
FX_FLOAT font_size = textobj->m_TextState.GetFontSize();
char_matrix.Scale(font_size, font_size);
FX_ARGB fill_argb = GetFillArgb(textobj, TRUE);
@@ -393,7 +392,7 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(
if (pType3Char == NULL) {
continue;
}
- CFX_AffineMatrix matrix = char_matrix;
+ CFX_Matrix matrix = char_matrix;
matrix.e += iChar ? textobj->m_pCharPos[iChar - 1] : 0;
matrix.Concat(text_matrix);
matrix.Concat(*pObj2Device);
@@ -474,7 +473,7 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(
origin_y - pBitmap->m_Top, fill_argb);
}
} else {
- CFX_AffineMatrix image_matrix = pType3Char->m_ImageMatrix;
+ CFX_Matrix image_matrix = pType3Char->m_ImageMatrix;
image_matrix.Concat(matrix);
CPDF_ImageRenderer renderer;
if (renderer.Start(this, pType3Char->m_pBitmap, fill_argb, 255,
@@ -597,8 +596,8 @@ FX_BOOL CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice,
FX_FLOAT* pCharPos,
CPDF_Font* pFont,
FX_FLOAT font_size,
- const CFX_AffineMatrix* pText2User,
- const CFX_AffineMatrix* pUser2Device,
+ const CFX_Matrix* pText2User,
+ const CFX_Matrix* pUser2Device,
const CFX_GraphStateData* pGraphState,
FX_ARGB fill_argb,
FX_ARGB stroke_argb,
@@ -628,7 +627,7 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice,
FX_FLOAT origin_x = (FX_FLOAT)left;
FX_FLOAT origin_y =
(FX_FLOAT)top + font_size * (FX_FLOAT)font_bbox.top / 1000.0f;
- CFX_AffineMatrix matrix(1.0f, 0, 0, -1.0f, 0, 0);
+ CFX_Matrix matrix(1.0f, 0, 0, -1.0f, 0, 0);
DrawTextString(pDevice, origin_x, origin_y, pFont, font_size, &matrix, str,
argb);
}
@@ -637,7 +636,7 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice,
FX_FLOAT origin_y,
CPDF_Font* pFont,
FX_FLOAT font_size,
- const CFX_AffineMatrix* pMatrix,
+ const CFX_Matrix* pMatrix,
const CFX_ByteString& str,
FX_ARGB fill_argb,
FX_ARGB stroke_argb,
@@ -667,7 +666,7 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice,
cur_pos += pFont->GetCharWidthF(pCharCodes[i]) * font_size / 1000;
}
}
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
if (pMatrix) {
matrix = *pMatrix;
}
@@ -692,7 +691,7 @@ FX_BOOL CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice,
FX_FLOAT* pCharPos,
CPDF_Font* pFont,
FX_FLOAT font_size,
- const CFX_AffineMatrix* pText2Device,
+ const CFX_Matrix* pText2Device,
FX_ARGB fill_argb,
const CPDF_RenderOptions* pOptions) {
CFX_FontCache* pCache =
@@ -731,14 +730,13 @@ FX_BOOL CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice,
&pFont->m_Font, pCache, font_size,
pText2Device, fill_argb, FXGE_flags);
}
-void CPDF_RenderStatus::DrawTextPathWithPattern(
- const CPDF_TextObject* textobj,
- const CFX_AffineMatrix* pObj2Device,
- CPDF_Font* pFont,
- FX_FLOAT font_size,
- const CFX_AffineMatrix* pTextMatrix,
- FX_BOOL bFill,
- FX_BOOL bStroke) {
+void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj,
+ const CFX_Matrix* pObj2Device,
+ CPDF_Font* pFont,
+ FX_FLOAT font_size,
+ const CFX_Matrix* pTextMatrix,
+ FX_BOOL bFill,
+ FX_BOOL bStroke) {
if (!bStroke) {
CPDF_PathObject path;
CPDF_TextObject* pCopy = new CPDF_TextObject;
@@ -777,7 +775,7 @@ void CPDF_RenderStatus::DrawTextPathWithPattern(
CPDF_PathObject path;
path.m_GraphState = textobj->m_GraphState;
path.m_ColorState = textobj->m_ColorState;
- CFX_AffineMatrix matrix;
+ CFX_Matrix matrix;
if (charpos.m_bGlyphAdjust)
matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h
index 5b862b3401..d173f47b7c 100644
--- a/core/src/fpdfapi/fpdf_render/render_int.h
+++ b/core/src/fpdfapi/fpdf_render/render_int.h
@@ -41,14 +41,14 @@ class CPDF_Type3Cache {
~CPDF_Type3Cache();
CFX_GlyphBitmap* LoadGlyph(FX_DWORD charcode,
- const CFX_AffineMatrix* pMatrix,
+ const CFX_Matrix* pMatrix,
FX_FLOAT retinaScaleX = 1.0f,
FX_FLOAT retinaScaleY = 1.0f);
protected:
CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize,
FX_DWORD charcode,
- const CFX_AffineMatrix* pMatrix,
+ const CFX_Matrix* pMatrix,
FX_FLOAT retinaScaleX = 1.0f,
FX_FLOAT retinaScaleY = 1.0f);
CPDF_Type3Font* const m_pFont;
@@ -93,7 +93,7 @@ class CPDF_DocRenderData {
struct _PDF_RenderItem {
public:
CPDF_PageObjects* m_pObjectList;
- CFX_AffineMatrix m_Matrix;
+ CFX_Matrix m_Matrix;
};
typedef CFX_ArrayTemplate<_PDF_RenderItem> CPDF_RenderLayer;
@@ -104,7 +104,7 @@ class IPDF_ObjectRenderer {
virtual ~IPDF_ObjectRenderer() {}
virtual FX_BOOL Start(CPDF_RenderStatus* pRenderStatus,
const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
FX_BOOL bStdCS,
int blendType = FXDIB_BLEND_NORMAL) = 0;
virtual FX_BOOL Continue(IFX_Pause* pPause) = 0;
@@ -117,7 +117,7 @@ class CPDF_RenderStatus {
~CPDF_RenderStatus();
FX_BOOL Initialize(class CPDF_RenderContext* pContext,
CFX_RenderDevice* pDevice,
- const CFX_AffineMatrix* pDeviceMatrix,
+ const CFX_Matrix* pDeviceMatrix,
const CPDF_PageObject* pStopObj,
const CPDF_RenderStatus* pParentStatus,
const CPDF_GraphicStates* pInitialStates,
@@ -131,11 +131,11 @@ class CPDF_RenderStatus {
FX_DWORD GroupFamily = 0,
FX_BOOL bLoadMask = FALSE);
void RenderObjectList(const CPDF_PageObjects* pObjs,
- const CFX_AffineMatrix* pObj2Device);
+ const CFX_Matrix* pObj2Device);
void RenderSingleObject(const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device);
+ const CFX_Matrix* pObj2Device);
FX_BOOL ContinueSingleObject(const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
IFX_Pause* pPause);
CPDF_RenderContext* GetContext() { return m_pContext; }
@@ -147,49 +147,46 @@ class CPDF_RenderStatus {
protected:
friend class CPDF_ImageRenderer;
friend class CPDF_RenderContext;
- void ProcessClipPath(CPDF_ClipPath ClipPath,
- const CFX_AffineMatrix* pObj2Device);
- void DrawClipPath(CPDF_ClipPath ClipPath,
- const CFX_AffineMatrix* pObj2Device);
+ void ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_Matrix* pObj2Device);
+ void DrawClipPath(CPDF_ClipPath ClipPath, const CFX_Matrix* pObj2Device);
FX_BOOL ProcessTransparency(const CPDF_PageObject* PageObj,
- const CFX_AffineMatrix* pObj2Device);
+ const CFX_Matrix* pObj2Device);
void ProcessObjectNoClip(const CPDF_PageObject* PageObj,
- const CFX_AffineMatrix* pObj2Device);
+ const CFX_Matrix* pObj2Device);
void DrawObjWithBackground(const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device);
+ const CFX_Matrix* pObj2Device);
FX_BOOL DrawObjWithBlend(const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device);
- FX_BOOL ProcessPath(CPDF_PathObject* pPathObj,
- const CFX_AffineMatrix* pObj2Device);
+ const CFX_Matrix* pObj2Device);
+ FX_BOOL ProcessPath(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device);
void ProcessPathPattern(CPDF_PathObject* pPathObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
int& filltype,
FX_BOOL& bStroke);
void DrawPathWithPattern(CPDF_PathObject* pPathObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
CPDF_Color* pColor,
FX_BOOL bStroke);
void DrawTilingPattern(CPDF_TilingPattern* pPattern,
CPDF_PageObject* pPageObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
FX_BOOL bStroke);
void DrawShadingPattern(CPDF_ShadingPattern* pPattern,
CPDF_PageObject* pPageObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
FX_BOOL bStroke);
FX_BOOL SelectClipPath(CPDF_PathObject* pPathObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
FX_BOOL bStroke);
FX_BOOL ProcessImage(CPDF_ImageObject* pImageObj,
- const CFX_AffineMatrix* pObj2Device);
+ const CFX_Matrix* pObj2Device);
FX_BOOL OutputBitmapAlpha(CPDF_ImageObject* pImageObj,
- const CFX_AffineMatrix* pImage2Device);
+ const CFX_Matrix* pImage2Device);
FX_BOOL OutputImage(CPDF_ImageObject* pImageObj,
- const CFX_AffineMatrix* pImage2Device);
+ const CFX_Matrix* pImage2Device);
FX_BOOL OutputDIBSource(const CFX_DIBSource* pOutputBitmap,
FX_ARGB fill_argb,
int bitmap_alpha,
- const CFX_AffineMatrix* pImage2Device,
+ const CFX_Matrix* pImage2Device,
CPDF_ImageCache* pImageCache,
FX_DWORD flags);
void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
@@ -200,26 +197,25 @@ class CPDF_RenderStatus {
int blend_mode,
int bIsolated);
FX_BOOL ProcessShading(CPDF_ShadingObject* pShadingObj,
- const CFX_AffineMatrix* pObj2Device);
+ const CFX_Matrix* pObj2Device);
void DrawShading(CPDF_ShadingPattern* pPattern,
- CFX_AffineMatrix* pMatrix,
+ CFX_Matrix* pMatrix,
FX_RECT& clip_rect,
int alpha,
FX_BOOL bAlphaMode);
FX_BOOL ProcessType3Text(const CPDF_TextObject* textobj,
- const CFX_AffineMatrix* pObj2Device);
+ const CFX_Matrix* pObj2Device);
FX_BOOL ProcessText(const CPDF_TextObject* textobj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
CFX_PathData* pClippingPath);
void DrawTextPathWithPattern(const CPDF_TextObject* textobj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
CPDF_Font* pFont,
FX_FLOAT font_size,
- const CFX_AffineMatrix* pTextMatrix,
+ const CFX_Matrix* pTextMatrix,
FX_BOOL bFill,
FX_BOOL bStroke);
- FX_BOOL ProcessForm(CPDF_FormObject* pFormObj,
- const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ProcessForm(CPDF_FormObject* pFormObj, const CFX_Matrix* pObj2Device);
CFX_DIBitmap* GetBackdrop(const CPDF_PageObject* pObj,
const FX_RECT& rect,
int& left,
@@ -227,7 +223,7 @@ class CPDF_RenderStatus {
FX_BOOL bBackAlphaRequired);
CFX_DIBitmap* LoadSMask(CPDF_Dictionary* pSMaskDict,
FX_RECT* pClipRect,
- const CFX_AffineMatrix* pMatrix);
+ const CFX_Matrix* pMatrix);
void Init(CPDF_RenderContext* pParent);
static class CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont);
static CPDF_GraphicStates* CloneObjStates(const CPDF_GraphicStates* pPathObj,
@@ -239,9 +235,9 @@ class CPDF_RenderStatus {
CPDF_RenderContext* m_pContext;
FX_BOOL m_bStopped;
void DitherObjectArea(const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device);
+ const CFX_Matrix* pObj2Device);
FX_BOOL GetObjectClippedRect(const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
FX_BOOL bLogical,
FX_RECT& rect) const;
void GetScaledMatrix(CFX_Matrix& matrix) const;
@@ -251,7 +247,7 @@ class CPDF_RenderStatus {
static int s_CurrentRecursionDepth;
CFX_RenderDevice* m_pDevice;
- CFX_AffineMatrix m_DeviceMatrix;
+ CFX_Matrix m_DeviceMatrix;
CPDF_ClipPath m_LastClipPath;
const CPDF_PageObject* m_pCurObj;
const CPDF_PageObject* m_pStopObj;
@@ -340,7 +336,7 @@ class CPDF_ImageRenderer : public IPDF_ObjectRenderer {
// IPDF_ObjectRenderer
FX_BOOL Start(CPDF_RenderStatus* pStatus,
const CPDF_PageObject* pObj,
- const CFX_AffineMatrix* pObj2Device,
+ const CFX_Matrix* pObj2Device,
FX_BOOL bStdCS,
int blendType = FXDIB_BLEND_NORMAL) override;
FX_BOOL Continue(IFX_Pause* pPause) override;
@@ -349,7 +345,7 @@ class CPDF_ImageRenderer : public IPDF_ObjectRenderer {
const CFX_DIBSource* pDIBSource,
FX_ARGB bitmap_argb,
int bitmap_alpha,
- const CFX_AffineMatrix* pImage2Device,
+ const CFX_Matrix* pImage2Device,
FX_DWORD flags,
FX_BOOL bStdCS,
int blendType = FXDIB_BLEND_NORMAL);
@@ -358,8 +354,8 @@ class CPDF_ImageRenderer : public IPDF_ObjectRenderer {
CPDF_RenderStatus* m_pRenderStatus;
CPDF_ImageObject* m_pImageObject;
int m_Status;
- const CFX_AffineMatrix* m_pObj2Device;
- CFX_AffineMatrix m_ImageMatrix;
+ const CFX_Matrix* m_pObj2Device;
+ CFX_Matrix m_ImageMatrix;
CPDF_ImageLoader m_Loader;
const CFX_DIBSource* m_pDIBSource;
CFX_DIBitmap* m_pClone;
@@ -396,7 +392,7 @@ class CPDF_ScaledRenderBuffer {
CFX_RenderDevice* GetDevice() {
return m_pBitmapDevice ? m_pBitmapDevice.get() : m_pDevice;
}
- CFX_AffineMatrix* GetMatrix() { return &m_Matrix; }
+ CFX_Matrix* GetMatrix() { return &m_Matrix; }
void OutputToDevice();
private:
@@ -405,7 +401,7 @@ class CPDF_ScaledRenderBuffer {
FX_RECT m_Rect;
const CPDF_PageObject* m_pObject;
nonstd::unique_ptr<CFX_FxgeDevice> m_pBitmapDevice;
- CFX_AffineMatrix m_Matrix;
+ CFX_Matrix m_Matrix;
};
class ICodec_ScanlineDecoder;
@@ -414,7 +410,7 @@ class CPDF_QuickStretcher {
CPDF_QuickStretcher();
~CPDF_QuickStretcher();
FX_BOOL Start(CPDF_ImageObject* pImageObj,
- CFX_AffineMatrix* pImage2Device,
+ CFX_Matrix* pImage2Device,
const FX_RECT* pClipBox);
FX_BOOL Continue(IFX_Pause* pPause);
CFX_DIBitmap* m_pBitmap;
@@ -439,7 +435,7 @@ class CPDF_DeviceBuffer {
int max_dpi = 0);
void OutputToDevice();
CFX_DIBitmap* GetBitmap() const { return m_pBitmap.get(); }
- const CFX_AffineMatrix* GetMatrix() const { return &m_Matrix; }
+ const CFX_Matrix* GetMatrix() const { return &m_Matrix; }
private:
CFX_RenderDevice* m_pDevice;
@@ -447,7 +443,7 @@ class CPDF_DeviceBuffer {
FX_RECT m_Rect;
const CPDF_PageObject* m_pObject;
nonstd::unique_ptr<CFX_DIBitmap> m_pBitmap;
- CFX_AffineMatrix m_Matrix;
+ CFX_Matrix m_Matrix;
};
class CPDF_ImageCache {