summaryrefslogtreecommitdiff
path: root/fxbarcode/oned/BC_OneDimWriter.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-09-05 12:07:02 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-05 17:27:26 +0000
commit1eae16d3b17d6b396969ecf81f6546f5a1d72dfd (patch)
tree6819d423b15bd05d68b296c6769a6bf531850dbe /fxbarcode/oned/BC_OneDimWriter.cpp
parente7767a0c98548395c95b9f88fc30cf7b318f1939 (diff)
downloadpdfium-1eae16d3b17d6b396969ecf81f6546f5a1d72dfd.tar.xz
Remove isDevice parameter from barcode Render().
isDevice is currently false in tests and fuzzers and true in real usage. This CL changes it all to true. Change-Id: Idea14795d7f0bb70031e04e5c58e248de72fd39e Reviewed-on: https://pdfium-review.googlesource.com/13130 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxbarcode/oned/BC_OneDimWriter.cpp')
-rw-r--r--fxbarcode/oned/BC_OneDimWriter.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp
index 2927dda3af..1f96c4575b 100644
--- a/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -285,8 +285,7 @@ bool CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
bool CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents,
uint8_t* code,
- int32_t codeLength,
- bool isDevice) {
+ int32_t codeLength) {
if (codeLength < 1)
return false;
@@ -299,28 +298,15 @@ bool CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents,
m_outputHScale =
m_Width > 0 ? static_cast<float>(m_Width) / static_cast<float>(codeLength)
: 1.0;
- if (!isDevice) {
- m_outputHScale =
- std::max(m_outputHScale, static_cast<float>(m_ModuleWidth));
- }
float dataLengthScale = 1.0;
if (m_iDataLenth > 0 && contents.GetLength() != 0)
dataLengthScale = float(contents.GetLength()) / float(m_iDataLenth);
if (m_iDataLenth > 0 && contents.GetLength() == 0)
dataLengthScale = float(1) / float(m_iDataLenth);
m_multiple = 1;
- if (!isDevice) {
- m_multiple = (int32_t)ceil(m_outputHScale * dataLengthScale);
- }
- int32_t outputHeight = 1;
- if (!isDevice)
- outputHeight = m_Height ? m_Height : std::max(20, m_ModuleHeight);
- int32_t outputWidth = codeLength;
- if (!isDevice)
- outputWidth = (int32_t)(codeLength * m_multiple / dataLengthScale);
+ const int32_t outputHeight = 1;
+ const int32_t outputWidth = codeLength;
m_barWidth = m_Width;
- if (!isDevice)
- m_barWidth = codeLength * m_multiple;
m_output.clear();
for (int32_t inputX = 0, outputX = leftPadding * m_multiple;