Pass CFX_Matrix by const-ref in fxbarcode/
-- Comment one suspicious line while at it.
Change-Id: I67385abcd88f1ffccca4e12517806865e04f75d0
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/79350
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxbarcode/BC_TwoDimWriter.cpp b/fxbarcode/BC_TwoDimWriter.cpp
index 98c4e70..a53162b 100644
--- a/fxbarcode/BC_TwoDimWriter.cpp
+++ b/fxbarcode/BC_TwoDimWriter.cpp
@@ -85,23 +85,23 @@
}
void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) {
+ const CFX_Matrix& matrix) {
DCHECK(m_output);
CFX_GraphStateData stateData;
CFX_PathData path;
path.AppendRect(0, 0, m_Width, m_Height);
- device->DrawPath(&path, matrix, &stateData, kBackgroundColor,
+ device->DrawPath(&path, &matrix, &stateData, kBackgroundColor,
kBackgroundColor, CFX_FillRenderOptions::EvenOddOptions());
int32_t leftPos = m_leftPadding;
int32_t topPos = m_topPadding;
- CFX_Matrix matri = *matrix;
+ CFX_Matrix matri = matrix;
if (m_Width < m_outputWidth && m_Height < m_outputHeight) {
CFX_Matrix matriScale(static_cast<float>(m_Width) / m_outputWidth, 0.0, 0.0,
static_cast<float>(m_Height) / m_outputHeight, 0.0,
0.0);
- matriScale.Concat(*matrix);
+ matriScale.Concat(matrix);
matri = matriScale;
}
diff --git a/fxbarcode/BC_TwoDimWriter.h b/fxbarcode/BC_TwoDimWriter.h
index a887ded..2d999d6 100644
--- a/fxbarcode/BC_TwoDimWriter.h
+++ b/fxbarcode/BC_TwoDimWriter.h
@@ -24,7 +24,7 @@
bool RenderResult(pdfium::span<const uint8_t> code,
int32_t codeWidth,
int32_t codeHeight);
- void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix);
+ void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix& matrix);
int32_t error_correction_level() const { return m_iCorrectionLevel; }
diff --git a/fxbarcode/cbc_codabar.cpp b/fxbarcode/cbc_codabar.cpp
index 5bb8e00..a766eb6 100644
--- a/fxbarcode/cbc_codabar.cpp
+++ b/fxbarcode/cbc_codabar.cpp
@@ -48,7 +48,7 @@
}
bool CBC_Codabar::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) {
+ const CFX_Matrix& matrix) {
auto* pWriter = GetOnedCodaBarWriter();
WideString renderCon =
pWriter->encodedContents(m_renderContents.AsStringView());
diff --git a/fxbarcode/cbc_codabar.h b/fxbarcode/cbc_codabar.h
index a3e1df4..7597ab8 100644
--- a/fxbarcode/cbc_codabar.h
+++ b/fxbarcode/cbc_codabar.h
@@ -22,7 +22,7 @@
BC_TYPE GetType() override;
bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) override;
+ const CFX_Matrix& matrix) override;
private:
CBC_OnedCodaBarWriter* GetOnedCodaBarWriter();
diff --git a/fxbarcode/cbc_code128.cpp b/fxbarcode/cbc_code128.cpp
index 83c8abe..b4dc117 100644
--- a/fxbarcode/cbc_code128.cpp
+++ b/fxbarcode/cbc_code128.cpp
@@ -52,7 +52,7 @@
}
bool CBC_Code128::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) {
+ const CFX_Matrix& matrix) {
return GetOnedCode128Writer()->RenderDeviceResult(
device, matrix, m_renderContents.AsStringView());
}
diff --git a/fxbarcode/cbc_code128.h b/fxbarcode/cbc_code128.h
index 2ccf07d..04a05b5 100644
--- a/fxbarcode/cbc_code128.h
+++ b/fxbarcode/cbc_code128.h
@@ -22,7 +22,7 @@
BC_TYPE GetType() override;
bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) override;
+ const CFX_Matrix& matrix) override;
private:
CBC_OnedCode128Writer* GetOnedCode128Writer();
diff --git a/fxbarcode/cbc_code39.cpp b/fxbarcode/cbc_code39.cpp
index 4402cc4..f09e3c4 100644
--- a/fxbarcode/cbc_code39.cpp
+++ b/fxbarcode/cbc_code39.cpp
@@ -49,7 +49,7 @@
}
bool CBC_Code39::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) {
+ const CFX_Matrix& matrix) {
auto* pWriter = GetOnedCode39Writer();
WideString renderCon;
if (!pWriter->encodedContents(m_renderContents.AsStringView(), &renderCon))
diff --git a/fxbarcode/cbc_code39.h b/fxbarcode/cbc_code39.h
index ab48292..b08e001 100644
--- a/fxbarcode/cbc_code39.h
+++ b/fxbarcode/cbc_code39.h
@@ -23,7 +23,7 @@
BC_TYPE GetType() override;
bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) override;
+ const CFX_Matrix& matrix) override;
private:
CBC_OnedCode39Writer* GetOnedCode39Writer();
diff --git a/fxbarcode/cbc_codebase.h b/fxbarcode/cbc_codebase.h
index 752e0da..1e12ae9 100644
--- a/fxbarcode/cbc_codebase.h
+++ b/fxbarcode/cbc_codebase.h
@@ -26,7 +26,7 @@
virtual BC_TYPE GetType() = 0;
virtual bool Encode(WideStringView contents) = 0;
virtual bool RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) = 0;
+ const CFX_Matrix& matrix) = 0;
bool SetTextLocation(BC_TEXT_LOC location);
bool SetWideNarrowRatio(int8_t ratio);
diff --git a/fxbarcode/cbc_datamatrix.cpp b/fxbarcode/cbc_datamatrix.cpp
index 1136b49..bfd2885 100644
--- a/fxbarcode/cbc_datamatrix.cpp
+++ b/fxbarcode/cbc_datamatrix.cpp
@@ -42,7 +42,7 @@
}
bool CBC_DataMatrix::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) {
+ const CFX_Matrix& matrix) {
GetDataMatrixWriter()->RenderDeviceResult(device, matrix);
return true;
}
diff --git a/fxbarcode/cbc_datamatrix.h b/fxbarcode/cbc_datamatrix.h
index c504c95..919a339 100644
--- a/fxbarcode/cbc_datamatrix.h
+++ b/fxbarcode/cbc_datamatrix.h
@@ -21,7 +21,7 @@
// CBC_OneCode:
bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) override;
+ const CFX_Matrix& matrix) override;
BC_TYPE GetType() override;
private:
diff --git a/fxbarcode/cbc_eancode.cpp b/fxbarcode/cbc_eancode.cpp
index f3ec3f1..7f9e2ff 100644
--- a/fxbarcode/cbc_eancode.cpp
+++ b/fxbarcode/cbc_eancode.cpp
@@ -38,7 +38,7 @@
}
bool CBC_EANCode::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) {
+ const CFX_Matrix& matrix) {
return GetOneDimEANWriter()->RenderDeviceResult(
device, matrix, m_renderContents.AsStringView());
}
diff --git a/fxbarcode/cbc_eancode.h b/fxbarcode/cbc_eancode.h
index 572bb42..2a4608c 100644
--- a/fxbarcode/cbc_eancode.h
+++ b/fxbarcode/cbc_eancode.h
@@ -26,7 +26,7 @@
// CBC_EANCode:
bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) override;
+ const CFX_Matrix& matrix) override;
protected:
CBC_OneDimEANWriter* GetOneDimEANWriter();
diff --git a/fxbarcode/cbc_pdf417i.cpp b/fxbarcode/cbc_pdf417i.cpp
index 34e1418..fe64cea 100644
--- a/fxbarcode/cbc_pdf417i.cpp
+++ b/fxbarcode/cbc_pdf417i.cpp
@@ -53,7 +53,7 @@
}
bool CBC_PDF417I::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) {
+ const CFX_Matrix& matrix) {
GetPDF417Writer()->RenderDeviceResult(device, matrix);
return true;
}
diff --git a/fxbarcode/cbc_pdf417i.h b/fxbarcode/cbc_pdf417i.h
index ab773f9..9ceb31c 100644
--- a/fxbarcode/cbc_pdf417i.h
+++ b/fxbarcode/cbc_pdf417i.h
@@ -21,7 +21,7 @@
// CBC_CodeBase:
bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) override;
+ const CFX_Matrix& matrix) override;
BC_TYPE GetType() override;
private:
diff --git a/fxbarcode/cbc_qrcode.cpp b/fxbarcode/cbc_qrcode.cpp
index 697963a..9d599dc 100644
--- a/fxbarcode/cbc_qrcode.cpp
+++ b/fxbarcode/cbc_qrcode.cpp
@@ -41,7 +41,7 @@
}
bool CBC_QRCode::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) {
+ const CFX_Matrix& matrix) {
GetQRCodeWriter()->RenderDeviceResult(device, matrix);
return true;
}
diff --git a/fxbarcode/cbc_qrcode.h b/fxbarcode/cbc_qrcode.h
index c541b7e..f257417 100644
--- a/fxbarcode/cbc_qrcode.h
+++ b/fxbarcode/cbc_qrcode.h
@@ -21,7 +21,7 @@
// CBC_CodeBase:
bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) override;
+ const CFX_Matrix& matrix) override;
BC_TYPE GetType() override;
private:
diff --git a/fxbarcode/cfx_barcode.cpp b/fxbarcode/cfx_barcode.cpp
index 210b894..0b47134 100644
--- a/fxbarcode/cfx_barcode.cpp
+++ b/fxbarcode/cfx_barcode.cpp
@@ -227,6 +227,6 @@
}
bool CFX_Barcode::RenderDevice(CFX_RenderDevice* device,
- const CFX_Matrix* matrix) {
+ const CFX_Matrix& matrix) {
return m_pBCEngine && m_pBCEngine->RenderDevice(device, matrix);
}
diff --git a/fxbarcode/cfx_barcode.h b/fxbarcode/cfx_barcode.h
index c8830e4..da3f094 100644
--- a/fxbarcode/cfx_barcode.h
+++ b/fxbarcode/cfx_barcode.h
@@ -28,7 +28,7 @@
BC_TYPE GetType();
bool Encode(WideStringView contents);
- bool RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matrix);
+ bool RenderDevice(CFX_RenderDevice* device, const CFX_Matrix& matrix);
bool SetCharEncoding(BC_CHAR_ENCODING encoding);
diff --git a/fxbarcode/cfx_barcode_unittest.cpp b/fxbarcode/cfx_barcode_unittest.cpp
index ab644cb..4bccedb 100644
--- a/fxbarcode/cfx_barcode_unittest.cpp
+++ b/fxbarcode/cfx_barcode_unittest.cpp
@@ -46,9 +46,7 @@
barcode_->SetWidth(418);
}
- bool RenderDevice() {
- return barcode_->RenderDevice(device_.get(), &matrix_);
- }
+ bool RenderDevice() { return barcode_->RenderDevice(device_.get(), matrix_); }
std::string BitmapChecksum() {
return GenerateMD5Base16(bitmap_->GetBuffer(),
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp
index e194bd1..3ddeea6 100644
--- a/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -162,7 +162,7 @@
}
void CBC_OneDimWriter::ShowDeviceChars(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
const ByteString str,
float geWidth,
TextCharPos* pCharPos,
@@ -176,13 +176,11 @@
if (geWidth != m_Width) {
rect.right -= 1;
}
- FX_RECT re = matrix->TransformRect(rect).GetOuterRect();
+ FX_RECT re = matrix.TransformRect(rect).GetOuterRect();
device->FillRect(re, kBackgroundColor);
CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, (float)locX,
(float)(locY + iFontSize));
- if (matrix) {
- affine_matrix.Concat(*matrix);
- }
+ affine_matrix.Concat(matrix);
device->DrawNormalText(str.GetLength(), pCharPos, m_pFont.Get(),
static_cast<float>(iFontSize), affine_matrix,
m_fontColor, GetTextRenderOptions());
@@ -190,7 +188,7 @@
bool CBC_OneDimWriter::ShowChars(WideStringView contents,
CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
int32_t barWidth,
int32_t multiple) {
if (!device || !m_pFont)
@@ -245,7 +243,7 @@
}
bool CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
WideStringView contents) {
if (m_output.empty())
return false;
@@ -254,11 +252,11 @@
CFX_PathData path;
path.AppendRect(0, 0, static_cast<float>(m_Width),
static_cast<float>(m_Height));
- device->DrawPath(&path, matrix, &stateData, kBackgroundColor,
+ device->DrawPath(&path, &matrix, &stateData, kBackgroundColor,
kBackgroundColor, CFX_FillRenderOptions::EvenOddOptions());
CFX_Matrix scaledMatrix(m_outputHScale, 0.0, 0.0,
static_cast<float>(m_Height), 0.0, 0.0);
- scaledMatrix.Concat(*matrix);
+ scaledMatrix.Concat(matrix);
for (const auto& rect : m_output) {
CFX_GraphStateData data;
device->DrawPath(&rect, &scaledMatrix, &data, kBarColor, 0,
diff --git a/fxbarcode/oned/BC_OneDimWriter.h b/fxbarcode/oned/BC_OneDimWriter.h
index 38f5879..0451f27 100644
--- a/fxbarcode/oned/BC_OneDimWriter.h
+++ b/fxbarcode/oned/BC_OneDimWriter.h
@@ -49,7 +49,7 @@
int32_t& outWidth,
int32_t& outHeight);
bool RenderDeviceResult(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
WideStringView contents);
bool SetFont(CFX_Font* cFont);
@@ -63,11 +63,11 @@
int32_t& outLength) = 0;
virtual bool ShowChars(WideStringView contents,
CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
int32_t barWidth,
int32_t multiple);
void ShowDeviceChars(CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
const ByteString str,
float geWidth,
TextCharPos* pCharPos,
diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/fxbarcode/oned/BC_OnedEAN13Writer.cpp
index 2cdb341..e83fe47 100644
--- a/fxbarcode/oned/BC_OnedEAN13Writer.cpp
+++ b/fxbarcode/oned/BC_OnedEAN13Writer.cpp
@@ -129,7 +129,7 @@
bool CBC_OnedEAN13Writer::ShowChars(WideStringView contents,
CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
int32_t barWidth,
int32_t multiple) {
if (!device)
@@ -148,21 +148,21 @@
CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
CFX_FloatRect rect((float)leftPosition, (float)(m_Height - iTextHeight),
(float)(leftPosition + strWidth - 0.5), (float)m_Height);
- matr.Concat(*matrix);
+ matr.Concat(matrix);
FX_RECT re = matr.TransformRect(rect).GetOuterRect();
device->FillRect(re, kBackgroundColor);
CFX_FloatRect rect1(
(float)(leftPosition + 47 * multiple), (float)(m_Height - iTextHeight),
(float)(leftPosition + 47 * multiple + strWidth - 0.5), (float)m_Height);
CFX_Matrix matr1(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
- matr1.Concat(*matrix);
+ matr1.Concat(matrix);
re = matr1.TransformRect(rect1).GetOuterRect();
device->FillRect(re, kBackgroundColor);
int32_t strWidth1 = multiple * 7;
CFX_Matrix matr2(m_outputHScale, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f);
CFX_FloatRect rect2(0.0f, (float)(m_Height - iTextHeight),
(float)strWidth1 - 0.5f, (float)m_Height);
- matr2.Concat(*matrix);
+ matr2.Concat(matrix);
re = matr2.TransformRect(rect2).GetOuterRect();
device->FillRect(re, kBackgroundColor);
@@ -176,8 +176,7 @@
CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0,
(float)leftPosition * m_outputHScale,
(float)(m_Height - iTextHeight) + iFontSize);
- if (matrix)
- affine_matrix1.Concat(*matrix);
+ affine_matrix1.Concat(matrix);
device->DrawNormalText(length, &charpos[1], m_pFont.Get(),
static_cast<float>(iFontSize), affine_matrix1,
m_fontColor, GetTextRenderOptions());
@@ -191,8 +190,7 @@
1.0, 0.0, 0.0, -1.0,
(float)(leftPosition + 47 * multiple) * m_outputHScale,
(float)(m_Height - iTextHeight + iFontSize));
- if (matrix)
- affine_matrix1.Concat(*matrix);
+ affine_matrix1.Concat(matrix);
device->DrawNormalText(length, &charpos[7], m_pFont.Get(),
static_cast<float>(iFontSize), affine_matrix1,
m_fontColor, GetTextRenderOptions());
@@ -207,8 +205,7 @@
{
CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0, 0.0,
(float)(m_Height - iTextHeight + iFontSize));
- if (matrix)
- affine_matrix1.Concat(*matrix);
+ affine_matrix1.Concat(matrix);
device->DrawNormalText(length, charpos.data(), m_pFont.Get(),
static_cast<float>(iFontSize), affine_matrix1,
m_fontColor, GetTextRenderOptions());
diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.h b/fxbarcode/oned/BC_OnedEAN13Writer.h
index c1d7209..4810d5b 100644
--- a/fxbarcode/oned/BC_OnedEAN13Writer.h
+++ b/fxbarcode/oned/BC_OnedEAN13Writer.h
@@ -32,7 +32,7 @@
private:
bool ShowChars(WideStringView contents,
CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
int32_t barWidth,
int32_t multiple) override;
diff --git a/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/fxbarcode/oned/BC_OnedEAN8Writer.cpp
index e35784f..19deaf7 100644
--- a/fxbarcode/oned/BC_OnedEAN8Writer.cpp
+++ b/fxbarcode/oned/BC_OnedEAN8Writer.cpp
@@ -129,7 +129,7 @@
bool CBC_OnedEAN8Writer::ShowChars(WideStringView contents,
CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
int32_t barWidth,
int32_t multiple) {
if (!device)
@@ -150,14 +150,14 @@
CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
CFX_FloatRect rect((float)leftPosition, (float)(m_Height - iTextHeight),
(float)(leftPosition + strWidth - 0.5), (float)m_Height);
- matr.Concat(*matrix);
+ matr.Concat(matrix);
FX_RECT re = matr.TransformRect(rect).GetOuterRect();
device->FillRect(re, kBackgroundColor);
CFX_Matrix matr1(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
CFX_FloatRect rect1(
(float)(leftPosition + 33 * multiple), (float)(m_Height - iTextHeight),
(float)(leftPosition + 33 * multiple + strWidth - 0.5), (float)m_Height);
- matr1.Concat(*matrix);
+ matr1.Concat(matrix);
re = matr1.TransformRect(rect1).GetOuterRect();
device->FillRect(re, kBackgroundColor);
strWidth = static_cast<int32_t>(strWidth * m_outputHScale);
@@ -168,7 +168,7 @@
CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0,
(float)leftPosition * m_outputHScale,
(float)(m_Height - iTextHeight + iFontSize));
- affine_matrix1.Concat(*matrix);
+ affine_matrix1.Concat(matrix);
device->DrawNormalText(iLen, charpos.data(), m_pFont.Get(),
static_cast<float>(iFontSize), affine_matrix1,
m_fontColor, GetTextRenderOptions());
@@ -182,8 +182,7 @@
1.0, 0.0, 0.0, -1.0,
(float)(leftPosition + 33 * multiple) * m_outputHScale,
(float)(m_Height - iTextHeight + iFontSize));
- if (matrix)
- affine_matrix1.Concat(*matrix);
+ affine_matrix1.Concat(matrix);
device->DrawNormalText(iLen, &charpos[4], m_pFont.Get(),
static_cast<float>(iFontSize), affine_matrix1,
m_fontColor, GetTextRenderOptions());
diff --git a/fxbarcode/oned/BC_OnedEAN8Writer.h b/fxbarcode/oned/BC_OnedEAN8Writer.h
index ee57e53..5767871 100644
--- a/fxbarcode/oned/BC_OnedEAN8Writer.h
+++ b/fxbarcode/oned/BC_OnedEAN8Writer.h
@@ -35,7 +35,7 @@
private:
bool ShowChars(WideStringView contents,
CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
int32_t barWidth,
int32_t multiple) override;
diff --git a/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/fxbarcode/oned/BC_OnedUPCAWriter.cpp
index c9b3691..f582646 100644
--- a/fxbarcode/oned/BC_OnedUPCAWriter.cpp
+++ b/fxbarcode/oned/BC_OnedUPCAWriter.cpp
@@ -103,7 +103,7 @@
bool CBC_OnedUPCAWriter::ShowChars(WideStringView contents,
CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
int32_t barWidth,
int32_t multiple) {
if (!device)
@@ -125,7 +125,7 @@
CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
CFX_FloatRect rect((float)leftPosition, (float)(m_Height - iTextHeight),
(float)(leftPosition + strWidth - 0.5), (float)m_Height);
- matr.Concat(*matrix);
+ matr.Concat(matrix);
FX_RECT re = matr.TransformRect(rect).GetOuterRect();
device->FillRect(re, kBackgroundColor);
CFX_Matrix matr1(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
@@ -133,14 +133,14 @@
(float)(m_Height - iTextHeight),
(float)((leftPosition + 40 * multiple) + strWidth - 0.5),
(float)m_Height);
- matr1.Concat(*matrix);
+ matr1.Concat(matrix);
re = matr1.TransformRect(rect1).GetOuterRect();
device->FillRect(re, kBackgroundColor);
float strWidth1 = (float)multiple * 7;
CFX_Matrix matr2(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
CFX_FloatRect rect2(0.0, (float)(m_Height - iTextHeight),
(float)strWidth1 - 1, (float)m_Height);
- matr2.Concat(*matrix);
+ matr2.Concat(matrix);
re = matr2.TransformRect(rect2).GetOuterRect();
device->FillRect(re, kBackgroundColor);
CFX_Matrix matr3(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
@@ -148,7 +148,7 @@
(float)(m_Height - iTextHeight),
(float)((leftPosition + 85 * multiple) + strWidth1 - 0.5),
(float)m_Height);
- matr3.Concat(*matrix);
+ matr3.Concat(matrix);
re = matr3.TransformRect(rect3).GetOuterRect();
device->FillRect(re, kBackgroundColor);
strWidth = strWidth * m_outputHScale;
@@ -158,8 +158,7 @@
CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0,
(float)leftPosition * m_outputHScale,
(float)(m_Height - iTextHeight + iFontSize));
- if (matrix)
- affine_matrix1.Concat(*matrix);
+ affine_matrix1.Concat(matrix);
device->DrawNormalText(length, &charpos[1], m_pFont.Get(),
static_cast<float>(iFontSize), affine_matrix1,
m_fontColor, GetTextRenderOptions());
@@ -172,8 +171,7 @@
1.0, 0.0, 0.0, -1.0,
(float)(leftPosition + 40 * multiple) * m_outputHScale,
(float)(m_Height - iTextHeight + iFontSize));
- if (matrix)
- affine_matrix1.Concat(*matrix);
+ affine_matrix1.Concat(matrix);
device->DrawNormalText(length, &charpos[6], m_pFont.Get(),
static_cast<float>(iFontSize), affine_matrix1,
m_fontColor, GetTextRenderOptions());
@@ -188,8 +186,7 @@
{
CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0, 0,
(float)(m_Height - iTextHeight + iFontSize));
- if (matrix)
- affine_matrix1.Concat(*matrix);
+ affine_matrix1.Concat(matrix);
device->DrawNormalText(length, charpos.data(), m_pFont.Get(),
static_cast<float>(iFontSize), affine_matrix1,
m_fontColor, GetTextRenderOptions());
@@ -203,8 +200,7 @@
1.0, 0.0, 0.0, -1.0,
(float)(leftPosition + 85 * multiple) * m_outputHScale,
(float)(m_Height - iTextHeight + iFontSize));
- if (matrix)
- affine_matrix1.Concat(*matrix);
+ affine_matrix1.Concat(matrix);
device->DrawNormalText(length, &charpos[11], m_pFont.Get(),
static_cast<float>(iFontSize), affine_matrix1,
m_fontColor, GetTextRenderOptions());
diff --git a/fxbarcode/oned/BC_OnedUPCAWriter.h b/fxbarcode/oned/BC_OnedUPCAWriter.h
index a644c41..67f2c57 100644
--- a/fxbarcode/oned/BC_OnedUPCAWriter.h
+++ b/fxbarcode/oned/BC_OnedUPCAWriter.h
@@ -37,7 +37,7 @@
private:
bool ShowChars(WideStringView contents,
CFX_RenderDevice* device,
- const CFX_Matrix* matrix,
+ const CFX_Matrix& matrix,
int32_t barWidth,
int32_t multiple) override;
diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp
index 8a4cbfb..44ce6a0 100644
--- a/xfa/fwl/cfwl_barcode.cpp
+++ b/xfa/fwl/cfwl_barcode.cpp
@@ -45,7 +45,8 @@
mt.f = GetRTClient().top;
mt.Concat(matrix);
- m_pBarcodeEngine->RenderDevice(pGraphics->GetRenderDevice(), &matrix);
+ // TODO(tsepez): Curious as to why |mt| is unused?
+ m_pBarcodeEngine->RenderDevice(pGraphics->GetRenderDevice(), matrix);
return;
}
CFWL_Edit::DrawWidget(pGraphics, matrix);