Age | Commit message (Collapse) | Author |
|
The way it was working before is:
Look at the width and height provided for the barcode. If the maximum
number of codewords to fit in that space was within the spec limits
(1 <= cols <= 30 and 3 <= rows <= 90), cram as many codewords as
possible. The unused space was filled with padding.
With this CL, instead look at the amount of content that needs to fit
into the barcode and favor fewer codewords rather than as many as
possible.
Bug: pdfium:1135
Change-Id: Ia96be82ec7c5f4f920cff58def1a44000bf04761
Reviewed-on: https://pdfium-review.googlesource.com/40350
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
By using mincols as fallback, the exact opposite is done. Maxcols
should be used instead to minimize the size.
This is important so the next fix
(https://pdfium-review.googlesource.com/c/pdfium/+/40350)
does not break a test that was working well by coincidence.
Bug: pdfium:1135
Change-Id: I95ddc547654966f655e2556c1796503a5456fb8f
Reviewed-on: https://pdfium-review.googlesource.com/40330
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This is useful for debugging and validation purposes. The hashes that
are in BarcodeTest are not necessarily for valid outputs.
This CL refactors the code in embedder_test.png that already does this,
moving it to testing/utils where unit tests can access it too.
Bug: pdfium:1135
Change-Id: I6f1d70a4e133f8f04dbe52646087f99c448e95f8
Reviewed-on: https://pdfium-review.googlesource.com/40152
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I6a2bd03e00ad4e3d57f6931c0c6cf4ae0c760afb
Reviewed-on: https://pdfium-review.googlesource.com/40290
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Reduce the logical size of the barcode by removing unnecessary
region duplication.
As far as I can tell, the line thickness is useless and the aspect
ratio causes arbitrary changes in rounding, but ultimately the
dimensions of a barcode are defined by its width and height, rather
than by this ratio.
The improvement with this CL is from ~580ms to ~390ms per barcode,
so about 1.5x. Combined with
https://pdfium-review.googlesource.com/c/pdfium/+/40010
the improvement is to ~15ms, which is about 39x.
This also fixes the rendering of the barcode in the pixel and
corpus tests. You can verify this pointing a barcode reader app at
the screen. It does not however fix every case, as the unit test is
still unreadable.
Bug: 872907, pdfium:1135
Change-Id: Ic28e60f54719552cfe69ace7ebc3f730c338a129
Reviewed-on: https://pdfium-review.googlesource.com/40030
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Setting these to anything outside of [1, 10] is non-op. Not sure why
the test did that, but these lines have no effect.
Bug: pdfium:1135
Change-Id: I175d07137674ab1b6b9c86b3bc68b4a128601b9f
Reviewed-on: https://pdfium-review.googlesource.com/40250
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Callers always want one form or the other, so split into separate
methods. This may save some branching.
Remove forms that are not used.
Put more helpful helper function in .cpp file.
Change-Id: I4e025de7f69ce3f323cd290a5dc8202dd4f8ca07
Reviewed-on: https://pdfium-review.googlesource.com/40270
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Move mandatory arguments to ctor.
Replace long list of positional parameters with setter methods.
Make Initialize() return void since it can't fail.
Change-Id: I490118923855158891cf45eecd5de1e922a3a1fe
Reviewed-on: https://pdfium-review.googlesource.com/40170
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Non-consecutive mode has questionable correctness and is not an obvious
performance win.
Change-Id: Idaa66e5ee5c4604628a0f55b67d5a04ab47ea5ec
Reviewed-on: https://pdfium-review.googlesource.com/40050
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Additionally, we have a pre-existing enum type that is more
meaningful than just a boolean.
Change-Id: Ie6ad13a3c9b22e34dedf7a5a9b5b9cc2a49b1f03
Reviewed-on: https://pdfium-review.googlesource.com/40190
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ie0e8e83e0380c323d8d12e82e50126b85d34405c
Reviewed-on: https://pdfium-review.googlesource.com/40191
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I13f53f581487f643acf160f53d02e9af7d54cfd1
Reviewed-on: https://pdfium-review.googlesource.com/40151
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I64b34da202a0f1c30a38cba2f24490aad4063828
Reviewed-on: https://pdfium-review.googlesource.com/40150
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Make call into internal helper function.
Write helper function so as to be obviously tail-recursive,
and remove redundant null check.
Change-Id: If29f9be66b07239b35de9ac9241d5ef72365889b
Reviewed-on: https://pdfium-review.googlesource.com/40130
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This is similar to FPDFText_GetMatrix() (wrapping
CPDF_TextObject::GetTextMatrix()) and FPDFPath_GetMatrix() (wrapping
CPDF_PathObject::m_Matrix), but wraps the matrix of form objects:
CPDF_FormObject::form_matrix().
Change-Id: Ic4ce7ad8050012f54de356bb936263d3e4f097ca
Reviewed-on: https://pdfium-review.googlesource.com/39930
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: I38b508b5518568ff134b70e0e494e5267571c1ca
Reviewed-on: https://pdfium-review.googlesource.com/40110
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
IsBase14Font() is what its only caller really needs. Also use it in
Load() which does the same check, and restructure Load() to have an
early return.
Change-Id: I1d051d10b80aa82bcf590c79169ffe29607b3c13
Reviewed-on: https://pdfium-review.googlesource.com/39970
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
|
|
Replace it with CFX_ReadOnlyMemoryStream, which does the same thing.
Take some checks from CFX_BufferSeekableReadStream and add them
CFX_ReadOnlyMemoryStream.
Change-Id: I25554c3aec3ec96967f8df16ca68a64dba121b6f
Reviewed-on: https://pdfium-review.googlesource.com/40070
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Bring in line with standards.
Remove argument entirely for mac code that is always nullptr.
Change-Id: I0710bdbd51fc0bc2e1d428ef44976be39a631147
Reviewed-on: https://pdfium-review.googlesource.com/40091
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/578bcf103a12..96b5e500909c
BUG=pdfium:1131,pdfium:1133
TBR=npm@chromium.org
Change-Id: I79f2c1d1ee23ddfc183a666137c1a28baabafeee
Reviewed-on: https://pdfium-review.googlesource.com/39950
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
It is always true now.
BUG=pdfium:263
Change-Id: I74fd0091f5815701718e8cd5acc6e7a0de772a85
Reviewed-on: https://pdfium-review.googlesource.com/40031
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Id097320ab2d9b5d1579582e5797e29c701499501
Reviewed-on: https://pdfium-review.googlesource.com/39991
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I1e9b02f0cb2628d41bc1c6bdcfcfa09c36faf97e
Reviewed-on: https://pdfium-review.googlesource.com/39990
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Simplify memory management.
Change-Id: Ie17b96fa53dff79f6cb8131d7a8ffc6a0e3f6a34
Reviewed-on: https://pdfium-review.googlesource.com/39972
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Iac581765f343f464f73a892b300ae20923c3bb32
Reviewed-on: https://pdfium-review.googlesource.com/39971
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This class is much simpler than CFX_MemoryStream and does only what
CFX_BmpDecompressor and CFX_GifContext needs. Swap out CFX_MemoryStream
and remove CFX_MemoryStream::Seek().
BUG=pdfium:263
Change-Id: Ifd8ce4d2b6c9fedd6ec842d46f54fc8e654fbca7
Reviewed-on: https://pdfium-review.googlesource.com/39880
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
More const pointers, less const_casts.
BUG=pdfium:263
Change-Id: I47fc6d8f2f837390e40ad22d8b67946065294eaa
Reviewed-on: https://pdfium-review.googlesource.com/39879
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I4906351a6e21fb8480670a6daf15bd7cb9e441c5
Reviewed-on: https://pdfium-review.googlesource.com/39911
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
|
|
Rename it CFX_ReadOnlyMemoryStream and swap out one use of CFX_MemoryStream.
BUG=pdfium:263
Change-Id: I15012df156a6a4d7c36f6fd58f32c355eae5fa1a
Reviewed-on: https://pdfium-review.googlesource.com/39878
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I91c55632627bb9cc0d6b61ae1004db1343d6bff2
Reviewed-on: https://pdfium-review.googlesource.com/39910
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Make them const, and remove m_nGrowSize which is always the same value.
Also remove unused method and make GetBuffer() non-const.
Change-Id: I272aa4c268c4a887e155800b7c8c10892b343465
Reviewed-on: https://pdfium-review.googlesource.com/39877
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Do all the parsing inside the constructor. Make GetVerticalGlyph() and
related getters const methods.
Change-Id: I21118cf98048cb6bbfc0999604d2434d4acafef6
Reviewed-on: https://pdfium-review.googlesource.com/39496
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
|
|
Given POD members default values, rather than hoping Load() will. Also
reorder members to pack better.
Change-Id: I493db11eb3d115e49f4e914e53a1eb55fa2046f0
Reviewed-on: https://pdfium-review.googlesource.com/39495
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
|
|
Remove parameters that always refer to the same member variables. Also
mark the input object as const since it is only read from.
Change-Id: I136ece1ce5b0c00b02d1a76e1540ff26e6f01858
Reviewed-on: https://pdfium-review.googlesource.com/39494
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
|
|
No need to even bring any .cpp files in line with these headers.
Change-Id: I934169d77ae09adc11f02e5ea92b1f8b078c9477
Reviewed-on: https://pdfium-review.googlesource.com/39876
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Perform indexing via WideString::operator[] which will at least
assert bounds, if not enforce them.
Change-Id: I7b03cfd718c4acd642af910c2ca06f86d178e5fd
Reviewed-on: https://pdfium-review.googlesource.com/39873
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Instead, add a 3-parameter constructor that delegates to the 4-parameter
constructor.
Change-Id: Ied6c55360084ea26b07dbaa449bf155b5db182f0
Reviewed-on: https://pdfium-review.googlesource.com/39872
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Add more asserts and use more constants.
Change-Id: I51f1d9d1b501f4e99d9793b6c803676b7221be17
Reviewed-on: https://pdfium-review.googlesource.com/39871
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Fix some other nits as well.
Change-Id: I837bd49526dd97ce666f8d8743fe5bd7653ae544
Reviewed-on: https://pdfium-review.googlesource.com/39410
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Preferred over const_cast<> to show how that state is used.
Change-Id: Ia6fe6bf46fb7fa8e701481b1604073b5d7f222fa
Reviewed-on: https://pdfium-review.googlesource.com/39870
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Introduce const/non-const versions of method where required.
Part of the war on const_cast<>. Tidy one expression to use []
instead of .data().
Change-Id: I41e45669c79eee242ff2244c7dc3afcf6386a433
Reviewed-on: https://pdfium-review.googlesource.com/39852
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Replaces them with calles to the proxy function, FXSYS_time, so that
tests may use a stable time value instead of the wall clock value.
BUG=pdfium:1104
Change-Id: I4743c4634f56d4a6cba1f1130c4562a35cee1887
Reviewed-on: https://pdfium-review.googlesource.com/39853
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This CL adds a proxy, FXSYS_time, for the time syscall, so that a
testing mechanism can be implemented. Specically there is now a flag
for pdfium_test, --time=, that allows setting the time since the epoch
that will be returned. This plumbed all the way down into the proxy
and allows for stable results for tests that depend on getting the
current time.
There are other places in the code base that will need to be patched
like this, that will be dealt with in follow on CLs.
BUG=pdfium:1104
Change-Id: I2de185f8d47abe46704dd579c13a54948b7f81e0
Reviewed-on: https://pdfium-review.googlesource.com/39750
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Because I saw one in some other code and decided to hunt them all.
These are all defined in C++ context, so no chance of C compatiblity.
Note that such a declaration without a struct tag will bypass the
[chromium-style] out-of-line constructor/destructor warnings, so
add constructors/destructors where required.
Change-Id: Ib821d8bc2f68ccf7028b0f73432e8e7c93a953ba
Reviewed-on: https://pdfium-review.googlesource.com/39851
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
There's a missing const in a qualifier in the third party FT library
header, so rather than casting on every invocation, consolidate these
into our wrapper macro. This may be easier to remove should the API
ever get corrected.
Part of the war on const_cast<>.
Change-Id: I80cdb220730f40297e54aee10acc8bbd2c983b6d
Reviewed-on: https://pdfium-review.googlesource.com/39850
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I1d5e3e73804efb0a8ed467d29777d017935a8824
Reviewed-on: https://pdfium-review.googlesource.com/39833
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
When trying to sanity check SBNUMINSTANCES for JBIG2 text regions for
https://crbug.com/837192, the check did not take data encoding into
account. Fix this by assuming there is a potential for 16:1 compression
in the lossless encoding.
BUG=chromium:871848
Change-Id: I991dacff9fbefa4e302f5ce92a355902ef94308a
Reviewed-on: https://pdfium-review.googlesource.com/39790
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I4fac8d0c9a21f4e8703a43afd2864f84f6228319
Reviewed-on: https://pdfium-review.googlesource.com/39834
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Because the argument to Decode() can be const. Part of the ongoing
war against const_cast<>.
Change-Id: I3a8402277dbfc4fd80b1dd60225de57b732713f8
Reviewed-on: https://pdfium-review.googlesource.com/39832
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Remove a bunch of const_cast<uint8_t*> or equivalent. This will also
help when we convert to span<>, since casting spans is a nuisance.
Change-Id: I330e5041cbaf33a84425fc4242a3dfacf5ca8011
Reviewed-on: https://pdfium-review.googlesource.com/39831
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|