diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-08-21 19:50:17 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-21 19:50:17 +0000 |
commit | dc2bb9ad21a10550fb451d7c842c63cbce98045b (patch) | |
tree | cced6e8df7fdbd424dcc6a4dd9c4f145645fc31c /fxbarcode/BC_TwoDimWriter.h | |
parent | aa58fb5759b937760464a2e63f19f464cd1cfe52 (diff) | |
download | pdfium-dc2bb9ad21a10550fb451d7c842c63cbce98045b.tar.xz |
Optimize rendering of two dimensional barcodes: defer upscale.
Defer upscaling as late as possible so that intermediary data
structures are smaller.
Made a couple of changes along the way to preserve the barcode
correctness and fix some padding issues.
For my example, this is a ~21x improvement in rendering time, down
from ~190ms per barcode to ~9ms.
Bug: 872907, pdfium:1135
Change-Id: If532e0f168f02fea9c31d473f34c0009da4f4612
Reviewed-on: https://pdfium-review.googlesource.com/40010
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fxbarcode/BC_TwoDimWriter.h')
-rw-r--r-- | fxbarcode/BC_TwoDimWriter.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fxbarcode/BC_TwoDimWriter.h b/fxbarcode/BC_TwoDimWriter.h index e554805fcf..228a2e03e9 100644 --- a/fxbarcode/BC_TwoDimWriter.h +++ b/fxbarcode/BC_TwoDimWriter.h @@ -31,7 +31,17 @@ class CBC_TwoDimWriter : public CBC_Writer { protected: int32_t m_iCorrectLevel; bool m_bFixedSize; + + private: std::unique_ptr<CBC_CommonBitMatrix> m_output; + int32_t m_multiX; + int32_t m_multiY; + int32_t m_leftPadding; + int32_t m_topPadding; + int32_t m_inputWidth; + int32_t m_inputHeight; + int32_t m_outputWidth; + int32_t m_outputHeight; }; #endif // FXBARCODE_BC_TWODIMWRITER_H_ |