summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-05 20:49:06 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-05 20:49:06 +0000
commitb20364c990152495dc259a4a8fc36cdd7dbd7ca4 (patch)
tree44dcb6edd4e9360e2cb576cb409613e8fb4849de /core
parent06f3042167126d60184dc3c401e71924cf3b46af (diff)
downloadpdfium-b20364c990152495dc259a4a8fc36cdd7dbd7ca4.tar.xz
Make CPDF_RenderStatus matrix params const-ref.
Eliminate the possibility of nullptr. Change-Id: I16c3e442d78e5151330db7227bd1c1630af3d4a3 Reviewed-on: https://pdfium-review.googlesource.com/c/43531 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/render/cpdf_imagerenderer.cpp4
-rw-r--r--core/fpdfapi/render/cpdf_progressiverenderer.cpp4
-rw-r--r--core/fpdfapi/render/cpdf_rendercontext.cpp4
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp230
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.h48
5 files changed, 146 insertions, 144 deletions
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index 59186b9296..affe12d6aa 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -283,11 +283,11 @@ bool CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) {
static_cast<float>(-rect.top));
if (CPDF_TilingPattern* pTilingPattern = m_pPattern->AsTilingPattern()) {
bitmap_render.DrawTilingPattern(pTilingPattern, m_pImageObject.Get(),
- &patternDevice, false);
+ patternDevice, false);
} else if (CPDF_ShadingPattern* pShadingPattern =
m_pPattern->AsShadingPattern()) {
bitmap_render.DrawShadingPattern(pShadingPattern, m_pImageObject.Get(),
- &patternDevice, false);
+ patternDevice, false);
}
CFX_DefaultRenderDevice bitmap_device2;
diff --git a/core/fpdfapi/render/cpdf_progressiverenderer.cpp b/core/fpdfapi/render/cpdf_progressiverenderer.cpp
index 15b58fbefe..1a38740a42 100644
--- a/core/fpdfapi/render/cpdf_progressiverenderer.cpp
+++ b/core/fpdfapi/render/cpdf_progressiverenderer.cpp
@@ -87,13 +87,13 @@ void CPDF_ProgressiveRenderer::Continue(PauseIndicatorIface* pPause) {
if (m_pDevice->GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) {
m_LastObjectRendered = iter;
m_pRenderStatus->ProcessClipPath(pCurObj->m_ClipPath,
- &m_pCurrentLayer->m_Matrix);
+ m_pCurrentLayer->m_Matrix);
return;
}
is_mask = true;
}
if (m_pRenderStatus->ContinueSingleObject(
- pCurObj, &m_pCurrentLayer->m_Matrix, pPause)) {
+ pCurObj, m_pCurrentLayer->m_Matrix, pPause)) {
return;
}
if (pCurObj->IsImage() && m_pRenderStatus->GetRenderOptions().HasFlag(
diff --git a/core/fpdfapi/render/cpdf_rendercontext.cpp b/core/fpdfapi/render/cpdf_rendercontext.cpp
index 48b87d9f2c..604170fad0 100644
--- a/core/fpdfapi/render/cpdf_rendercontext.cpp
+++ b/core/fpdfapi/render/cpdf_rendercontext.cpp
@@ -75,10 +75,10 @@ void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice,
FinalMatrix.Concat(*pLastMatrix);
status.SetDeviceMatrix(*pLastMatrix);
status.Initialize(nullptr, nullptr);
- status.RenderObjectList(layer.m_pObjectHolder.Get(), &FinalMatrix);
+ status.RenderObjectList(layer.m_pObjectHolder.Get(), FinalMatrix);
} else {
status.Initialize(nullptr, nullptr);
- status.RenderObjectList(layer.m_pObjectHolder.Get(), &layer.m_Matrix);
+ status.RenderObjectList(layer.m_pObjectHolder.Get(), layer.m_Matrix);
}
if (status.GetRenderOptions().HasFlag(RENDER_LIMITEDIMAGECACHE)) {
m_pPageCache->CacheOptimization(
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index fd2897eaa4..7d78253ea6 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -144,7 +144,7 @@ void GetShadingSteps(float t_min,
}
void DrawAxialShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
- const CFX_Matrix* pObject2Bitmap,
+ const CFX_Matrix& mtObject2Bitmap,
const CPDF_Dictionary* pDict,
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const CPDF_ColorSpace* pCS,
@@ -187,9 +187,10 @@ void DrawAxialShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
GetShadingSteps(t_min, t_max, funcs, pCS, alpha, total_results, rgb_array);
int pitch = pBitmap->GetPitch();
- CFX_Matrix matrix = pObject2Bitmap->GetInverse();
+ CFX_Matrix matrix = mtObject2Bitmap.GetInverse();
for (int row = 0; row < height; row++) {
- uint32_t* dib_buf = (uint32_t*)(pBitmap->GetBuffer() + row * pitch);
+ uint32_t* dib_buf =
+ reinterpret_cast<uint32_t*>(pBitmap->GetBuffer() + row * pitch);
for (int column = 0; column < width; column++) {
CFX_PointF pos = matrix.Transform(
CFX_PointF(static_cast<float>(column), static_cast<float>(row)));
@@ -214,7 +215,7 @@ void DrawAxialShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
}
void DrawRadialShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
- const CFX_Matrix* pObject2Bitmap,
+ const CFX_Matrix& mtObject2Bitmap,
const CPDF_Dictionary* pDict,
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const CPDF_ColorSpace* pCS,
@@ -266,7 +267,7 @@ void DrawRadialShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
bool bDecreasing =
(dr < 0 && static_cast<int>(sqrt(dx * dx + dy * dy)) < -dr);
- CFX_Matrix matrix = pObject2Bitmap->GetInverse();
+ CFX_Matrix matrix = mtObject2Bitmap.GetInverse();
for (int row = 0; row < height; row++) {
uint32_t* dib_buf =
reinterpret_cast<uint32_t*>(pBitmap->GetBuffer() + row * pitch);
@@ -317,7 +318,7 @@ void DrawRadialShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
}
void DrawFuncShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
- const CFX_Matrix* pObject2Bitmap,
+ const CFX_Matrix& mtObject2Bitmap,
const CPDF_Dictionary* pDict,
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const CPDF_ColorSpace* pCS,
@@ -340,7 +341,7 @@ void DrawFuncShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
ymax = pDomain->GetNumberAt(3);
}
CFX_Matrix mtDomain2Target = pDict->GetMatrixFor("Matrix");
- CFX_Matrix matrix = pObject2Bitmap->GetInverse();
+ CFX_Matrix matrix = mtObject2Bitmap.GetInverse();
matrix.Concat(mtDomain2Target.GetInverse());
int width = pBitmap->GetWidth();
int height = pBitmap->GetHeight();
@@ -477,7 +478,7 @@ void DrawGouraud(const RetainPtr<CFX_DIBitmap>& pBitmap,
void DrawFreeGouraudShading(
const RetainPtr<CFX_DIBitmap>& pBitmap,
- const CFX_Matrix* pObject2Bitmap,
+ const CFX_Matrix& mtObject2Bitmap,
const CPDF_Stream* pShadingStream,
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const CPDF_ColorSpace* pCS,
@@ -495,14 +496,14 @@ void DrawFreeGouraudShading(
while (!stream.BitStream()->IsEOF()) {
CPDF_MeshVertex vertex;
uint32_t flag;
- if (!stream.ReadVertex(*pObject2Bitmap, &vertex, &flag))
+ if (!stream.ReadVertex(mtObject2Bitmap, &vertex, &flag))
return;
if (flag == 0) {
triangle[0] = vertex;
for (int j = 1; j < 3; j++) {
uint32_t tflag;
- if (!stream.ReadVertex(*pObject2Bitmap, &triangle[j], &tflag))
+ if (!stream.ReadVertex(mtObject2Bitmap, &triangle[j], &tflag))
return;
}
} else {
@@ -518,7 +519,7 @@ void DrawFreeGouraudShading(
void DrawLatticeGouraudShading(
const RetainPtr<CFX_DIBitmap>& pBitmap,
- const CFX_Matrix* pObject2Bitmap,
+ const CFX_Matrix& mtObject2Bitmap,
const CPDF_Stream* pShadingStream,
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const CPDF_ColorSpace* pCS,
@@ -535,13 +536,13 @@ void DrawLatticeGouraudShading(
return;
std::vector<CPDF_MeshVertex> vertices[2];
- vertices[0] = stream.ReadVertexRow(*pObject2Bitmap, row_verts);
+ vertices[0] = stream.ReadVertexRow(mtObject2Bitmap, row_verts);
if (vertices[0].empty())
return;
int last_index = 0;
while (1) {
- vertices[1 - last_index] = stream.ReadVertexRow(*pObject2Bitmap, row_verts);
+ vertices[1 - last_index] = stream.ReadVertexRow(mtObject2Bitmap, row_verts);
if (vertices[1 - last_index].empty())
return;
@@ -836,7 +837,7 @@ struct CPDF_PatchDrawer {
void DrawCoonPatchMeshes(
ShadingType type,
const RetainPtr<CFX_DIBitmap>& pBitmap,
- const CFX_Matrix* pObject2Bitmap,
+ const CFX_Matrix& mtObject2Bitmap,
const CPDF_Stream* pShadingStream,
const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
const CPDF_ColorSpace* pCS,
@@ -885,7 +886,7 @@ void DrawCoonPatchMeshes(
for (i = iStartPoint; i < point_count; i++) {
if (!stream.CanReadCoords())
break;
- coords[i] = pObject2Bitmap->Transform(stream.ReadCoords());
+ coords[i] = mtObject2Bitmap.Transform(stream.ReadCoords());
}
for (i = iStartColor; i < 4; i++) {
@@ -922,7 +923,7 @@ void DrawCoonPatchMeshes(
RetainPtr<CFX_DIBitmap> DrawPatternBitmap(CPDF_Document* pDoc,
CPDF_PageRenderCache* pCache,
CPDF_TilingPattern* pPattern,
- const CFX_Matrix* pObject2Device,
+ const CFX_Matrix& mtObject2Device,
int width,
int height,
int flags) {
@@ -936,12 +937,12 @@ RetainPtr<CFX_DIBitmap> DrawPatternBitmap(CPDF_Document* pDoc,
pBitmap->Clear(0);
CFX_FloatRect cell_bbox =
pPattern->pattern_to_form()->TransformRect(pPattern->bbox());
- cell_bbox = pObject2Device->TransformRect(cell_bbox);
+ cell_bbox = mtObject2Device.TransformRect(cell_bbox);
CFX_FloatRect bitmap_rect(0.0f, 0.0f, (float)width, (float)height);
CFX_Matrix mtAdjust;
mtAdjust.MatchRect(bitmap_rect, cell_bbox);
- CFX_Matrix mtPattern2Bitmap = *pObject2Device;
+ CFX_Matrix mtPattern2Bitmap = mtObject2Device;
mtPattern2Bitmap.Concat(mtAdjust);
CPDF_RenderOptions options;
if (!pPattern->colored())
@@ -1025,11 +1026,11 @@ void CPDF_RenderStatus::Initialize(const CPDF_RenderStatus* pParentState,
void CPDF_RenderStatus::RenderObjectList(
const CPDF_PageObjectHolder* pObjectHolder,
- const CFX_Matrix* pObj2Device) {
+ const CFX_Matrix& mtObj2Device) {
#if defined _SKIA_SUPPORT_
DebugVerifyDeviceIsPreMultiplied();
#endif
- CFX_FloatRect clip_rect = pObj2Device->GetInverse().TransformRect(
+ CFX_FloatRect clip_rect = mtObj2Device.GetInverse().TransformRect(
CFX_FloatRect(m_pDevice->GetClipBox()));
for (const auto& pCurObj : *pObjectHolder->GetPageObjectList()) {
if (pCurObj.get() == m_pStopObj) {
@@ -1045,7 +1046,7 @@ void CPDF_RenderStatus::RenderObjectList(
pCurObj->m_Top < clip_rect.bottom) {
continue;
}
- RenderSingleObject(pCurObj.get(), pObj2Device);
+ RenderSingleObject(pCurObj.get(), mtObj2Device);
if (m_bStopped)
return;
}
@@ -1055,7 +1056,7 @@ void CPDF_RenderStatus::RenderObjectList(
}
void CPDF_RenderStatus::RenderSingleObject(CPDF_PageObject* pObj,
- const CFX_Matrix* pObj2Device) {
+ const CFX_Matrix& mtObj2Device) {
#if defined _SKIA_SUPPORT_
DebugVerifyDeviceIsPreMultiplied();
#endif
@@ -1068,25 +1069,25 @@ void CPDF_RenderStatus::RenderSingleObject(CPDF_PageObject* pObj,
!m_Options.GetOCContext()->CheckObjectVisible(pObj)) {
return;
}
- ProcessClipPath(pObj->m_ClipPath, pObj2Device);
- if (ProcessTransparency(pObj, pObj2Device)) {
+ ProcessClipPath(pObj->m_ClipPath, mtObj2Device);
+ if (ProcessTransparency(pObj, mtObj2Device)) {
return;
}
- ProcessObjectNoClip(pObj, pObj2Device);
+ ProcessObjectNoClip(pObj, mtObj2Device);
#if defined _SKIA_SUPPORT_
DebugVerifyDeviceIsPreMultiplied();
#endif
}
bool CPDF_RenderStatus::ContinueSingleObject(CPDF_PageObject* pObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
PauseIndicatorIface* pPause) {
if (m_pImageRenderer) {
if (m_pImageRenderer->Continue(pPause))
return true;
if (!m_pImageRenderer->GetResult())
- DrawObjWithBackground(pObj, pObj2Device);
+ DrawObjWithBackground(pObj, mtObj2Device);
m_pImageRenderer.reset();
return false;
}
@@ -1097,81 +1098,81 @@ bool CPDF_RenderStatus::ContinueSingleObject(CPDF_PageObject* pObj,
return false;
}
- ProcessClipPath(pObj->m_ClipPath, pObj2Device);
- if (ProcessTransparency(pObj, pObj2Device))
+ ProcessClipPath(pObj->m_ClipPath, mtObj2Device);
+ if (ProcessTransparency(pObj, mtObj2Device))
return false;
if (!pObj->IsImage()) {
- ProcessObjectNoClip(pObj, pObj2Device);
+ ProcessObjectNoClip(pObj, mtObj2Device);
return false;
}
m_pImageRenderer = pdfium::MakeUnique<CPDF_ImageRenderer>();
- if (!m_pImageRenderer->Start(this, pObj->AsImage(), pObj2Device, false,
+ if (!m_pImageRenderer->Start(this, pObj->AsImage(), &mtObj2Device, false,
FXDIB_BLEND_NORMAL)) {
if (!m_pImageRenderer->GetResult())
- DrawObjWithBackground(pObj, pObj2Device);
+ DrawObjWithBackground(pObj, mtObj2Device);
m_pImageRenderer.reset();
return false;
}
- return ContinueSingleObject(pObj, pObj2Device, pPause);
+ return ContinueSingleObject(pObj, mtObj2Device, pPause);
}
FX_RECT CPDF_RenderStatus::GetObjectClippedRect(
const CPDF_PageObject* pObj,
- const CFX_Matrix* pObj2Device) const {
- FX_RECT rect = pObj->GetBBox(pObj2Device);
+ const CFX_Matrix& mtObj2Device) const {
+ FX_RECT rect = pObj->GetBBox(&mtObj2Device);
rect.Intersect(m_pDevice->GetClipBox());
return rect;
}
void CPDF_RenderStatus::ProcessObjectNoClip(CPDF_PageObject* pObj,
- const CFX_Matrix* pObj2Device) {
+ const CFX_Matrix& mtObj2Device) {
#if defined _SKIA_SUPPORT_
DebugVerifyDeviceIsPreMultiplied();
#endif
bool bRet = false;
switch (pObj->GetType()) {
case CPDF_PageObject::TEXT:
- bRet = ProcessText(pObj->AsText(), pObj2Device, nullptr);
+ bRet = ProcessText(pObj->AsText(), mtObj2Device, nullptr);
break;
case CPDF_PageObject::PATH:
- bRet = ProcessPath(pObj->AsPath(), pObj2Device);
+ bRet = ProcessPath(pObj->AsPath(), mtObj2Device);
break;
case CPDF_PageObject::IMAGE:
- bRet = ProcessImage(pObj->AsImage(), pObj2Device);
+ bRet = ProcessImage(pObj->AsImage(), mtObj2Device);
break;
case CPDF_PageObject::SHADING:
- ProcessShading(pObj->AsShading(), pObj2Device);
+ ProcessShading(pObj->AsShading(), mtObj2Device);
return;
case CPDF_PageObject::FORM:
- bRet = ProcessForm(pObj->AsForm(), pObj2Device);
+ bRet = ProcessForm(pObj->AsForm(), mtObj2Device);
break;
}
if (!bRet)
- DrawObjWithBackground(pObj, pObj2Device);
+ DrawObjWithBackground(pObj, mtObj2Device);
#if defined _SKIA_SUPPORT_
DebugVerifyDeviceIsPreMultiplied();
#endif
}
bool CPDF_RenderStatus::DrawObjWithBlend(CPDF_PageObject* pObj,
- const CFX_Matrix* pObj2Device) {
+ const CFX_Matrix& mtObj2Device) {
switch (pObj->GetType()) {
case CPDF_PageObject::PATH:
- return ProcessPath(pObj->AsPath(), pObj2Device);
+ return ProcessPath(pObj->AsPath(), mtObj2Device);
case CPDF_PageObject::IMAGE:
- return ProcessImage(pObj->AsImage(), pObj2Device);
+ return ProcessImage(pObj->AsImage(), mtObj2Device);
case CPDF_PageObject::FORM:
- return ProcessForm(pObj->AsForm(), pObj2Device);
+ return ProcessForm(pObj->AsForm(), mtObj2Device);
default:
return false;
}
}
void CPDF_RenderStatus::DrawObjWithBackground(CPDF_PageObject* pObj,
- const CFX_Matrix* pObj2Device) {
- FX_RECT rect = GetObjectClippedRect(pObj, pObj2Device);
+ const CFX_Matrix& mtObj2Device) {
+ FX_RECT rect = GetObjectClippedRect(pObj, mtObj2Device);
if (rect.IsEmpty())
return;
@@ -1185,7 +1186,7 @@ void CPDF_RenderStatus::DrawObjWithBackground(CPDF_PageObject* pObj,
res)) {
return;
}
- CFX_Matrix matrix = *pObj2Device;
+ CFX_Matrix matrix = mtObj2Device;
matrix.Concat(*buffer.GetMatrix());
const CPDF_Dictionary* pFormResource = nullptr;
const CPDF_FormObject* pFormObj = pObj->AsForm();
@@ -1201,12 +1202,12 @@ void CPDF_RenderStatus::DrawObjWithBackground(CPDF_PageObject* pObj,
status.SetDropObjects(m_bDropObjects);
status.SetFormResource(pFormResource);
status.Initialize(nullptr, nullptr);
- status.RenderSingleObject(pObj, &matrix);
+ status.RenderSingleObject(pObj, matrix);
buffer.OutputToDevice();
}
bool CPDF_RenderStatus::ProcessForm(const CPDF_FormObject* pFormObj,
- const CFX_Matrix* pObj2Device) {
+ const CFX_Matrix& mtObj2Device) {
#if defined _SKIA_SUPPORT_
DebugVerifyDeviceIsPreMultiplied();
#endif
@@ -1216,7 +1217,7 @@ bool CPDF_RenderStatus::ProcessForm(const CPDF_FormObject* pFormObj,
return true;
}
CFX_Matrix matrix = pFormObj->form_matrix();
- matrix.Concat(*pObj2Device);
+ matrix.Concat(mtObj2Device);
const CPDF_Dictionary* pFormDict = pFormObj->form()->GetDict();
const CPDF_Dictionary* pResources =
pFormDict ? pFormDict->GetDictFor("Resources") : nullptr;
@@ -1230,7 +1231,7 @@ bool CPDF_RenderStatus::ProcessForm(const CPDF_FormObject* pFormObj,
status.m_curBlend = m_curBlend;
{
CFX_RenderDevice::StateRestorer restorer(m_pDevice);
- status.RenderObjectList(pFormObj->form(), &matrix);
+ status.RenderObjectList(pFormObj->form(), matrix);
m_bStopped = status.m_bStopped;
}
#if defined _SKIA_SUPPORT_
@@ -1240,17 +1241,17 @@ bool CPDF_RenderStatus::ProcessForm(const CPDF_FormObject* pFormObj,
}
bool CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj,
- const CFX_Matrix* pObj2Device) {
+ const CFX_Matrix& mtObj2Device) {
int FillType = pPathObj->m_FillType;
bool bStroke = pPathObj->m_bStroke;
- ProcessPathPattern(pPathObj, pObj2Device, &FillType, &bStroke);
+ ProcessPathPattern(pPathObj, mtObj2Device, &FillType, &bStroke);
if (FillType == 0 && !bStroke)
return true;
uint32_t fill_argb = FillType ? GetFillArgb(pPathObj) : 0;
uint32_t stroke_argb = bStroke ? GetStrokeArgb(pPathObj) : 0;
CFX_Matrix path_matrix = pPathObj->m_Matrix;
- path_matrix.Concat(*pObj2Device);
+ path_matrix.Concat(mtObj2Device);
if (!IsAvailableMatrix(path_matrix))
return true;
@@ -1341,7 +1342,7 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const {
}
void CPDF_RenderStatus::ProcessClipPath(const CPDF_ClipPath& ClipPath,
- const CFX_Matrix* pObj2Device) {
+ const CFX_Matrix& mtObj2Device) {
if (!ClipPath.HasRef()) {
if (m_LastClipPath.HasRef()) {
m_pDevice->RestoreState(true);
@@ -1364,7 +1365,7 @@ void CPDF_RenderStatus::ProcessClipPath(const CPDF_ClipPath& ClipPath,
EmptyPath.AppendRect(-1, -1, 0, 0);
m_pDevice->SetClip_PathFill(&EmptyPath, nullptr, FXFILL_WINDING);
} else {
- m_pDevice->SetClip_PathFill(pPathData, pObj2Device,
+ m_pDevice->SetClip_PathFill(pPathData, &mtObj2Device,
ClipPath.GetClipType(i));
}
}
@@ -1383,7 +1384,7 @@ void CPDF_RenderStatus::ProcessClipPath(const CPDF_ClipPath& ClipPath,
if (pText) {
if (!pTextClippingPath)
pTextClippingPath = pdfium::MakeUnique<CFX_PathData>();
- ProcessText(pText, pObj2Device, pTextClippingPath.get());
+ ProcessText(pText, mtObj2Device, pTextClippingPath.get());
continue;
}
@@ -1399,22 +1400,22 @@ void CPDF_RenderStatus::ProcessClipPath(const CPDF_ClipPath& ClipPath,
}
bool CPDF_RenderStatus::ClipPattern(const CPDF_PageObject* pPageObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
bool bStroke) {
if (pPageObj->IsPath())
- return SelectClipPath(pPageObj->AsPath(), pObj2Device, bStroke);
+ return SelectClipPath(pPageObj->AsPath(), mtObj2Device, bStroke);
if (pPageObj->IsImage()) {
- m_pDevice->SetClip_Rect(pPageObj->GetBBox(pObj2Device));
+ m_pDevice->SetClip_Rect(pPageObj->GetBBox(&mtObj2Device));
return true;
}
return false;
}
bool CPDF_RenderStatus::SelectClipPath(const CPDF_PathObject* pPathObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
bool bStroke) {
CFX_Matrix path_matrix = pPathObj->m_Matrix;
- path_matrix.Concat(*pObj2Device);
+ path_matrix.Concat(mtObj2Device);
if (bStroke) {
CFX_GraphState graphState = pPathObj->m_GraphState;
if (m_Options.HasFlag(RENDER_THINLINE))
@@ -1431,7 +1432,7 @@ bool CPDF_RenderStatus::SelectClipPath(const CPDF_PathObject* pPathObj,
}
bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
- const CFX_Matrix* pObj2Device) {
+ const CFX_Matrix& mtObj2Device) {
#if defined _SKIA_SUPPORT_
DebugVerifyDeviceIsPreMultiplied();
#endif
@@ -1505,15 +1506,15 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
(rendCaps & FXRC_BLEND_MODE)) {
int oldBlend = m_curBlend;
m_curBlend = blend_type;
- bRet = DrawObjWithBlend(pPageObj, pObj2Device);
+ bRet = DrawObjWithBlend(pPageObj, mtObj2Device);
m_curBlend = oldBlend;
}
if (!bRet) {
- DrawObjWithBackground(pPageObj, pObj2Device);
+ DrawObjWithBackground(pPageObj, mtObj2Device);
}
return true;
}
- FX_RECT rect = pPageObj->GetBBox(pObj2Device);
+ FX_RECT rect = pPageObj->GetBBox(&mtObj2Device);
rect.Intersect(m_pDevice->GetClipBox());
if (rect.IsEmpty())
return true;
@@ -1535,7 +1536,7 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
RetainPtr<CFX_DIBitmap> bitmap = bitmap_device.GetBitmap();
bitmap->Clear(0);
- CFX_Matrix new_matrix = *pObj2Device;
+ CFX_Matrix new_matrix = mtObj2Device;
new_matrix.Translate(-rect.left, -rect.top);
RetainPtr<CFX_DIBitmap> pTextMask;
@@ -1567,7 +1568,7 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
bitmap_render.SetDropObjects(m_bDropObjects);
bitmap_render.SetFormResource(pFormResource);
bitmap_render.Initialize(nullptr, nullptr);
- bitmap_render.ProcessObjectNoClip(pPageObj, &new_matrix);
+ bitmap_render.ProcessObjectNoClip(pPageObj, new_matrix);
#if defined _SKIA_SUPPORT_PATHS_
bitmap_device.Flush(true);
bitmap->UnPreMultiply();
@@ -1575,7 +1576,7 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
m_bStopped = bitmap_render.m_bStopped;
if (pSMaskDict) {
CFX_Matrix smask_matrix = *pPageObj->m_GeneralState.GetSMaskMatrix();
- smask_matrix.Concat(*pObj2Device);
+ smask_matrix.Concat(mtObj2Device);
RetainPtr<CFX_DIBBase> pSMaskSource =
LoadSMask(pSMaskDict, &rect, &smask_matrix);
if (pSMaskSource)
@@ -1674,7 +1675,7 @@ void CPDF_RenderStatus::DebugVerifyDeviceIsPreMultiplied() const {
#endif
bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
CFX_PathData* pClippingPath) {
if (textobj->GetCharCodes().empty())
return true;
@@ -1685,7 +1686,7 @@ bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj,
CPDF_Font* pFont = textobj->m_TextState.GetFont();
if (pFont->IsType3Font())
- return ProcessType3Text(textobj, pObj2Device);
+ return ProcessType3Text(textobj, mtObj2Device);
bool bFill = false;
bool bStroke = false;
@@ -1743,12 +1744,12 @@ bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj,
float font_size = textobj->m_TextState.GetFontSize();
if (bPattern) {
- DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size,
+ DrawTextPathWithPattern(textobj, mtObj2Device, pFont, font_size,
&text_matrix, bFill, bStroke);
return true;
}
if (bClip || bStroke) {
- const CFX_Matrix* pDeviceMatrix = pObj2Device;
+ const CFX_Matrix* pDeviceMatrix = &mtObj2Device;
CFX_Matrix device_matrix;
if (bStroke) {
const float* pCTM = textobj->m_TextState.GetCTM();
@@ -1756,7 +1757,7 @@ bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj,
CFX_Matrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0);
text_matrix.ConcatInverse(ctm);
device_matrix = ctm;
- device_matrix.Concat(*pObj2Device);
+ device_matrix.Concat(mtObj2Device);
pDeviceMatrix = &device_matrix;
}
}
@@ -1775,7 +1776,7 @@ bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj,
textobj->m_GraphState.GetObject(), fill_argb, stroke_argb,
pClippingPath, flag);
}
- text_matrix.Concat(*pObj2Device);
+ text_matrix.Concat(mtObj2Device);
return CPDF_TextRenderer::DrawNormalText(
m_pDevice, textobj->GetCharCodes(), textobj->GetCharPositions(), pFont,
font_size, &text_matrix, fill_argb, &m_Options);
@@ -1793,7 +1794,7 @@ RetainPtr<CPDF_Type3Cache> CPDF_RenderStatus::GetCachedType3(
// TODO(npm): Font fallback for type 3 fonts? (Completely separate code!!)
bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj,
- const CFX_Matrix* pObj2Device) {
+ const CFX_Matrix& mtObj2Device) {
CPDF_Type3Font* pType3Font = textobj->m_TextState.GetFont()->AsType3Font();
if (pdfium::ContainsValue(m_Type3FontCache, pType3Font))
return true;
@@ -1824,7 +1825,7 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj,
CFX_Matrix matrix = char_matrix;
matrix.e += iChar > 0 ? textobj->GetCharPositions()[iChar - 1] : 0;
matrix.Concat(text_matrix);
- matrix.Concat(*pObj2Device);
+ matrix.Concat(mtObj2Device);
if (!pType3Char->LoadBitmap(m_pContext.Get())) {
if (!glyphs.empty()) {
for (size_t i = 0; i < iChar; ++i) {
@@ -1865,7 +1866,7 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj,
status.m_Type3FontCache.push_back(pType3Font);
CFX_RenderDevice::StateRestorer restorer(m_pDevice);
- status.RenderObjectList(pType3Char->form(), &matrix);
+ status.RenderObjectList(pType3Char->form(), matrix);
} else {
FX_RECT rect =
matrix.TransformRect(pType3Char->form()->CalcBoundingBox())
@@ -1887,7 +1888,7 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj,
status.m_Type3FontCache = m_Type3FontCache;
status.m_Type3FontCache.push_back(pType3Font);
matrix.Translate(-rect.left, -rect.top);
- status.RenderObjectList(pType3Char->form(), &matrix);
+ status.RenderObjectList(pType3Char->form(), matrix);
m_pDevice->SetDIBits(bitmap_device.GetBitmap(), rect.left, rect.top);
}
} else if (pType3Char->GetBitmap()) {
@@ -1956,7 +1957,7 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj,
}
void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
CPDF_Font* pFont,
float font_size,
const CFX_Matrix* pTextMatrix,
@@ -1979,7 +1980,7 @@ void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj,
path.m_Top = textobj->m_Top;
AutoRestorer<UnownedPtr<const CPDF_PageObject>> restorer2(&m_pCurObj);
- RenderSingleObject(&path, pObj2Device);
+ RenderSingleObject(&path, mtObj2Device);
return;
}
CPDF_CharPosList CharPosList;
@@ -2012,12 +2013,12 @@ void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj,
path.m_bStroke = bStroke;
path.m_FillType = bFill ? FXFILL_WINDING : 0;
path.CalcBoundingBox();
- ProcessPath(&path, pObj2Device);
+ ProcessPath(&path, mtObj2Device);
}
}
void CPDF_RenderStatus::DrawShading(const CPDF_ShadingPattern* pPattern,
- CFX_Matrix* pMatrix,
+ const CFX_Matrix* pMatrix,
const FX_RECT& clip_rect,
int alpha,
bool bAlphaMode) {
@@ -2068,20 +2069,19 @@ void CPDF_RenderStatus::DrawShading(const CPDF_ShadingPattern* pPattern,
case kMaxShading:
return;
case kFunctionBasedShading:
- DrawFuncShading(pBitmap, &FinalMatrix, pDict, funcs, pColorSpace, alpha);
+ DrawFuncShading(pBitmap, FinalMatrix, pDict, funcs, pColorSpace, alpha);
break;
case kAxialShading:
- DrawAxialShading(pBitmap, &FinalMatrix, pDict, funcs, pColorSpace, alpha);
+ DrawAxialShading(pBitmap, FinalMatrix, pDict, funcs, pColorSpace, alpha);
break;
case kRadialShading:
- DrawRadialShading(pBitmap, &FinalMatrix, pDict, funcs, pColorSpace,
- alpha);
+ DrawRadialShading(pBitmap, FinalMatrix, pDict, funcs, pColorSpace, alpha);
break;
case kFreeFormGouraudTriangleMeshShading: {
// The shading object can be a stream or a dictionary. We do not handle
// the case of dictionary at the moment.
if (const CPDF_Stream* pStream = ToStream(pPattern->GetShadingObject())) {
- DrawFreeGouraudShading(pBitmap, &FinalMatrix, pStream, funcs,
+ DrawFreeGouraudShading(pBitmap, FinalMatrix, pStream, funcs,
pColorSpace, alpha);
}
} break;
@@ -2089,7 +2089,7 @@ void CPDF_RenderStatus::DrawShading(const CPDF_ShadingPattern* pPattern,
// The shading object can be a stream or a dictionary. We do not handle
// the case of dictionary at the moment.
if (const CPDF_Stream* pStream = ToStream(pPattern->GetShadingObject())) {
- DrawLatticeGouraudShading(pBitmap, &FinalMatrix, pStream, funcs,
+ DrawLatticeGouraudShading(pBitmap, FinalMatrix, pStream, funcs,
pColorSpace, alpha);
}
} break;
@@ -2098,7 +2098,7 @@ void CPDF_RenderStatus::DrawShading(const CPDF_ShadingPattern* pPattern,
// The shading object can be a stream or a dictionary. We do not handle
// the case of dictionary at the moment.
if (const CPDF_Stream* pStream = ToStream(pPattern->GetShadingObject())) {
- DrawCoonPatchMeshes(pPattern->GetShadingType(), pBitmap, &FinalMatrix,
+ DrawCoonPatchMeshes(pPattern->GetShadingType(), pBitmap, FinalMatrix,
pStream, funcs, pColorSpace, m_Options.GetFlags(),
alpha);
}
@@ -2114,21 +2114,21 @@ void CPDF_RenderStatus::DrawShading(const CPDF_ShadingPattern* pPattern,
void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern,
const CPDF_PageObject* pPageObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
bool bStroke) {
if (!pattern->Load())
return;
CFX_RenderDevice::StateRestorer restorer(m_pDevice);
- if (!ClipPattern(pPageObj, pObj2Device, bStroke))
+ if (!ClipPattern(pPageObj, mtObj2Device, bStroke))
return;
- FX_RECT rect = GetObjectClippedRect(pPageObj, pObj2Device);
+ FX_RECT rect = GetObjectClippedRect(pPageObj, mtObj2Device);
if (rect.IsEmpty())
return;
CFX_Matrix matrix = *pattern->pattern_to_form();
- matrix.Concat(*pObj2Device);
+ matrix.Concat(mtObj2Device);
int alpha =
FXSYS_round(255 * (bStroke ? pPageObj->m_GeneralState.GetStrokeAlpha()
: pPageObj->m_GeneralState.GetFillAlpha()));
@@ -2137,15 +2137,15 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern,
}
void CPDF_RenderStatus::ProcessShading(const CPDF_ShadingObject* pShadingObj,
- const CFX_Matrix* pObj2Device) {
- FX_RECT rect = pShadingObj->GetBBox(pObj2Device);
+ const CFX_Matrix& mtObj2Device) {
+ FX_RECT rect = pShadingObj->GetBBox(&mtObj2Device);
FX_RECT clip_box = m_pDevice->GetClipBox();
rect.Intersect(clip_box);
if (rect.IsEmpty())
return;
CFX_Matrix matrix = pShadingObj->matrix();
- matrix.Concat(*pObj2Device);
+ matrix.Concat(mtObj2Device);
DrawShading(pShadingObj->pattern(), &matrix, rect,
FXSYS_round(255 * pShadingObj->m_GeneralState.GetFillAlpha()),
m_Options.ColorModeIs(CPDF_RenderOptions::kAlpha));
@@ -2153,13 +2153,13 @@ void CPDF_RenderStatus::ProcessShading(const CPDF_ShadingObject* pShadingObj,
void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
CPDF_PageObject* pPageObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
bool bStroke) {
if (!pPattern->Load())
return;
CFX_RenderDevice::StateRestorer restorer(m_pDevice);
- if (!ClipPattern(pPageObj, pObj2Device, bStroke))
+ if (!ClipPattern(pPageObj, mtObj2Device, bStroke))
return;
FX_RECT clip_box = m_pDevice->GetClipBox();
@@ -2167,7 +2167,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
return;
CFX_Matrix mtPattern2Device = *pPattern->pattern_to_form();
- mtPattern2Device.Concat(*pObj2Device);
+ mtPattern2Device.Concat(mtObj2Device);
bool bAligned =
pPattern->bbox().left == 0 && pPattern->bbox().bottom == 0 &&
@@ -2221,7 +2221,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
for (int row = min_row; row <= max_row; row++) {
CFX_PointF original = mtPattern2Device.Transform(
CFX_PointF(col * pPattern->x_step(), row * pPattern->y_step()));
- CFX_Matrix matrix = *pObj2Device;
+ CFX_Matrix matrix = mtObj2Device;
matrix.Translate(original.x - mtPattern2Device.e,
original.y - mtPattern2Device.f);
CFX_RenderDevice::StateRestorer restorer2(m_pDevice);
@@ -2231,7 +2231,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
status.SetFormResource(pFormResource);
status.SetDropObjects(m_bDropObjects);
status.Initialize(this, pStates.get());
- status.RenderObjectList(pPattern->form(), &matrix);
+ status.RenderObjectList(pPattern->form(), matrix);
}
}
return;
@@ -2261,12 +2261,12 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
if (width * height < 16) {
RetainPtr<CFX_DIBitmap> pEnlargedBitmap =
DrawPatternBitmap(m_pContext->GetDocument(), m_pContext->GetPageCache(),
- pPattern, pObj2Device, 8, 8, m_Options.GetFlags());
+ pPattern, mtObj2Device, 8, 8, m_Options.GetFlags());
pPatternBitmap = pEnlargedBitmap->StretchTo(width, height, 0, nullptr);
} else {
pPatternBitmap = DrawPatternBitmap(
m_pContext->GetDocument(), m_pContext->GetPageCache(), pPattern,
- pObj2Device, width, height, m_Options.GetFlags());
+ mtObj2Device, width, height, m_Options.GetFlags());
}
if (!pPatternBitmap)
return;
@@ -2336,7 +2336,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
}
void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
const CPDF_Color* pColor,
bool bStroke) {
CPDF_Pattern* pattern = pColor->GetPattern();
@@ -2344,13 +2344,13 @@ void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj,
return;
if (CPDF_TilingPattern* pTilingPattern = pattern->AsTilingPattern())
- DrawTilingPattern(pTilingPattern, pPathObj, pObj2Device, bStroke);
+ DrawTilingPattern(pTilingPattern, pPathObj, mtObj2Device, bStroke);
else if (CPDF_ShadingPattern* pShadingPattern = pattern->AsShadingPattern())
- DrawShadingPattern(pShadingPattern, pPathObj, pObj2Device, bStroke);
+ DrawShadingPattern(pShadingPattern, pPathObj, mtObj2Device, bStroke);
}
void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
int* filltype,
bool* bStroke) {
ASSERT(filltype);
@@ -2359,23 +2359,23 @@ void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj,
if (*filltype) {
const CPDF_Color& FillColor = *pPathObj->m_ColorState.GetFillColor();
if (FillColor.IsPattern()) {
- DrawPathWithPattern(pPathObj, pObj2Device, &FillColor, false);
+ DrawPathWithPattern(pPathObj, mtObj2Device, &FillColor, false);
*filltype = 0;
}
}
if (*bStroke) {
const CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor();
if (StrokeColor.IsPattern()) {
- DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, true);
+ DrawPathWithPattern(pPathObj, mtObj2Device, &StrokeColor, true);
*bStroke = false;
}
}
}
bool CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj,
- const CFX_Matrix* pObj2Device) {
+ const CFX_Matrix& mtObj2Device) {
CPDF_ImageRenderer render;
- if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend))
+ if (render.Start(this, pImageObj, &mtObj2Device, m_bStdCS, m_curBlend))
render.Continue(nullptr);
return render.GetResult();
}
@@ -2567,7 +2567,7 @@ RetainPtr<CFX_DIBitmap> CPDF_RenderStatus::LoadSMask(
status.SetFormResource(pFormResource);
status.SetDropObjects(m_bDropObjects);
status.Initialize(nullptr, nullptr);
- status.RenderObjectList(&form, &matrix);
+ status.RenderObjectList(&form, matrix);
auto pMask = pdfium::MakeRetain<CFX_DIBitmap>();
if (!pMask->Create(width, height, FXDIB_8bppMask))
diff --git a/core/fpdfapi/render/cpdf_renderstatus.h b/core/fpdfapi/render/cpdf_renderstatus.h
index f6d58843c0..a4f3fd4d75 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.h
+++ b/core/fpdfapi/render/cpdf_renderstatus.h
@@ -62,13 +62,14 @@ class CPDF_RenderStatus {
const CPDF_GraphicStates* pInitialStates);
void RenderObjectList(const CPDF_PageObjectHolder* pObjectHolder,
- const CFX_Matrix* pObj2Device);
- void RenderSingleObject(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device);
+ const CFX_Matrix& mtObj2Device);
+ void RenderSingleObject(CPDF_PageObject* pObj,
+ const CFX_Matrix& mtObj2Device);
bool ContinueSingleObject(CPDF_PageObject* pObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
PauseIndicatorIface* pPause);
void ProcessClipPath(const CPDF_ClipPath& ClipPath,
- const CFX_Matrix* pObj2Device);
+ const CFX_Matrix& mtObj2Device);
uint32_t GetGroupFamily() const { return m_GroupFamily; }
bool GetLoadMask() const { return m_bLoadMask; }
@@ -99,11 +100,11 @@ class CPDF_RenderStatus {
void DrawTilingPattern(CPDF_TilingPattern* pPattern,
CPDF_PageObject* pPageObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
bool bStroke);
void DrawShadingPattern(CPDF_ShadingPattern* pPattern,
const CPDF_PageObject* pPageObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
bool bStroke);
void CompositeDIBitmap(const RetainPtr<CFX_DIBitmap>& pDIBitmap,
int left,
@@ -116,49 +117,50 @@ class CPDF_RenderStatus {
private:
FX_ARGB GetFillArgbInternal(CPDF_PageObject* pObj, bool bType3) const;
bool ProcessTransparency(CPDF_PageObject* PageObj,
- const CFX_Matrix* pObj2Device);
+ const CFX_Matrix& mtObj2Device);
void ProcessObjectNoClip(CPDF_PageObject* PageObj,
- const CFX_Matrix* pObj2Device);
+ const CFX_Matrix& mtObj2Device);
void DrawObjWithBackground(CPDF_PageObject* pObj,
- const CFX_Matrix* pObj2Device);
- bool DrawObjWithBlend(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device);
- bool ProcessPath(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device);
+ const CFX_Matrix& mtObj2Device);
+ bool DrawObjWithBlend(CPDF_PageObject* pObj, const CFX_Matrix& mtObj2Device);
+ bool ProcessPath(CPDF_PathObject* pPathObj, const CFX_Matrix& mtObj2Device);
void ProcessPathPattern(CPDF_PathObject* pPathObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
int* filltype,
bool* bStroke);
void DrawPathWithPattern(CPDF_PathObject* pPathObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
const CPDF_Color* pColor,
bool bStroke);
bool ClipPattern(const CPDF_PageObject* pPageObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
bool bStroke);
bool SelectClipPath(const CPDF_PathObject* pPathObj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
bool bStroke);
- bool ProcessImage(CPDF_ImageObject* pImageObj, const CFX_Matrix* pObj2Device);
+ bool ProcessImage(CPDF_ImageObject* pImageObj,
+ const CFX_Matrix& mtObj2Device);
void ProcessShading(const CPDF_ShadingObject* pShadingObj,
- const CFX_Matrix* pObj2Device);
+ const CFX_Matrix& mtObj2Device);
void DrawShading(const CPDF_ShadingPattern* pPattern,
- CFX_Matrix* pMatrix,
+ const CFX_Matrix* pMatrix,
const FX_RECT& clip_rect,
int alpha,
bool bAlphaMode);
bool ProcessType3Text(CPDF_TextObject* textobj,
- const CFX_Matrix* pObj2Device);
+ const CFX_Matrix& mtObj2Device);
bool ProcessText(CPDF_TextObject* textobj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
CFX_PathData* pClippingPath);
void DrawTextPathWithPattern(const CPDF_TextObject* textobj,
- const CFX_Matrix* pObj2Device,
+ const CFX_Matrix& mtObj2Device,
CPDF_Font* pFont,
float font_size,
const CFX_Matrix* pTextMatrix,
bool bFill,
bool bStroke);
bool ProcessForm(const CPDF_FormObject* pFormObj,
- const CFX_Matrix* pObj2Device);
+ const CFX_Matrix& mtObj2Device);
RetainPtr<CFX_DIBitmap> GetBackdrop(const CPDF_PageObject* pObj,
const FX_RECT& rect,
bool bBackAlphaRequired,
@@ -177,7 +179,7 @@ class CPDF_RenderStatus {
bool bStroke);
FX_ARGB GetStrokeArgb(CPDF_PageObject* pObj) const;
FX_RECT GetObjectClippedRect(const CPDF_PageObject* pObj,
- const CFX_Matrix* pObj2Device) const;
+ const CFX_Matrix& mtObj2Device) const;
CPDF_RenderOptions m_Options;
UnownedPtr<const CPDF_Dictionary> m_pFormResource;