diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-08-23 19:02:30 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-23 19:02:30 +0000 |
commit | ce6a1cc587a7d5db7655a915dd18b1c1f0ef2de2 (patch) | |
tree | b6c180609a76ea398344574dc31b8104939f6c65 | |
parent | 18342f5d7c80528ffe85a5c89a48d3bbd93fb6bd (diff) | |
download | pdfium-ce6a1cc587a7d5db7655a915dd18b1c1f0ef2de2.tar.xz |
Reorder RenderResult and RenderDeviceResult in CBC_TwoDimWriter.chromium/3532
They should appear in the order that they are necessarily called.
Change-Id: I6901d384122003f72b0c43bf1df6260e2e196a7d
Reviewed-on: https://pdfium-review.googlesource.com/41050
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
-rw-r--r-- | fxbarcode/BC_TwoDimWriter.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/fxbarcode/BC_TwoDimWriter.cpp b/fxbarcode/BC_TwoDimWriter.cpp index 36e554c6cf..bff37dfb89 100644 --- a/fxbarcode/BC_TwoDimWriter.cpp +++ b/fxbarcode/BC_TwoDimWriter.cpp @@ -19,49 +19,6 @@ CBC_TwoDimWriter::CBC_TwoDimWriter() : m_iCorrectLevel(1), m_bFixedSize(true) {} CBC_TwoDimWriter::~CBC_TwoDimWriter() {} -void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, - const CFX_Matrix* matrix) { - ASSERT(m_output); - - CFX_GraphStateData stateData; - CFX_PathData path; - path.AppendRect(0, 0, (float)m_Width, (float)m_Height); - device->DrawPath(&path, matrix, &stateData, m_backgroundColor, - m_backgroundColor, FXFILL_ALTERNATE); - int32_t leftPos = m_leftPadding; - int32_t topPos = m_topPadding; - - 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); - matri = matriScale; - } - - CFX_GraphStateData data; - for (int32_t x = 0; x < m_inputWidth; x++) { - for (int32_t y = 0; y < m_inputHeight; y++) { - if (m_output->Get(x, y)) { - // In the output, each module is shifted by 1 due to the one module - // padding added to create quiet areas. - int start_x_output = x + 1; - int end_x_output = x + 2; - int start_y_output = y + 1; - int end_y_output = y + 2; - - CFX_PathData rect; - rect.AppendRect(leftPos + start_x_output * m_multiX, - topPos + start_y_output * m_multiY, - leftPos + end_x_output * m_multiX, - topPos + end_y_output * m_multiY); - device->DrawPath(&rect, &matri, &data, m_barColor, 0, FXFILL_WINDING); - } - } - } -} - int32_t CBC_TwoDimWriter::GetErrorCorrectionLevel() const { return m_iCorrectLevel; } @@ -123,3 +80,46 @@ bool CBC_TwoDimWriter::RenderResult(uint8_t* code, } return true; } + +void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, + const CFX_Matrix* matrix) { + ASSERT(m_output); + + CFX_GraphStateData stateData; + CFX_PathData path; + path.AppendRect(0, 0, (float)m_Width, (float)m_Height); + device->DrawPath(&path, matrix, &stateData, m_backgroundColor, + m_backgroundColor, FXFILL_ALTERNATE); + int32_t leftPos = m_leftPadding; + int32_t topPos = m_topPadding; + + 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); + matri = matriScale; + } + + CFX_GraphStateData data; + for (int32_t x = 0; x < m_inputWidth; x++) { + for (int32_t y = 0; y < m_inputHeight; y++) { + if (m_output->Get(x, y)) { + // In the output, each module is shifted by 1 due to the one module + // padding added to create quiet areas. + int start_x_output = x + 1; + int end_x_output = x + 2; + int start_y_output = y + 1; + int end_y_output = y + 2; + + CFX_PathData rect; + rect.AppendRect(leftPos + start_x_output * m_multiX, + topPos + start_y_output * m_multiY, + leftPos + end_x_output * m_multiX, + topPos + end_y_output * m_multiY); + device->DrawPath(&rect, &matri, &data, m_barColor, 0, FXFILL_WINDING); + } + } + } +} |