diff options
author | Nicolás Peña <npm@chromium.org> | 2017-03-23 14:31:11 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-23 14:43:07 +0000 |
commit | 4650ded3dccefca89b4ef4757bae49a21b4a786d (patch) | |
tree | 4bb47204c8864a568c29c6ffb3982499547ddc4c /core/fxcodec | |
parent | cdba747a53082a7f36534dffa6a3ad01628e53c3 (diff) | |
download | pdfium-4650ded3dccefca89b4ef4757bae49a21b4a786d.tar.xz |
Revert "Remove CFX_FixedBufGrow"
This reverts commit 55d1d0191ea8316df32858d8cc62fb7c620e8613.
Reason for revert: Slowing down corpus tests by a lot on Mac/Win
Original change's description:
> Remove CFX_FixedBufGrow
>
> This Cl replaces the CFX_FixedBufGrow class with std::vector.
>
> Change-Id: I85c85b7a8de4794840b561e09841bb464cfa9dfe
> Reviewed-on: https://pdfium-review.googlesource.com/3138
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Commit-Queue: dsinclair <dsinclair@chromium.org>
>
TBR=tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Iaee27570f140b2033b5d8fb8f3077fc839558d64
Reviewed-on: https://pdfium-review.googlesource.com/3158
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxcodec')
-rw-r--r-- | core/fxcodec/codec/fx_codec_icc.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/core/fxcodec/codec/fx_codec_icc.cpp b/core/fxcodec/codec/fx_codec_icc.cpp index cb89584e11..b143dcc0c9 100644 --- a/core/fxcodec/codec/fx_codec_icc.cpp +++ b/core/fxcodec/codec/fx_codec_icc.cpp @@ -4,9 +4,6 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include <algorithm> -#include <vector> - #include "core/fxcodec/codec/codec_int.h" #include "core/fxcodec/fx_codec.h" #include "third_party/lcms2-2.6/include/lcms2.h" @@ -168,12 +165,14 @@ void IccLib_Translate(void* pTransform, CLcmsCmm* p = (CLcmsCmm*)pTransform; uint8_t output[4]; if (p->m_bLab) { - std::vector<double> input(std::max(16U, nSrcComponents)); + CFX_FixedBufGrow<double, 16> inputs(nSrcComponents); + double* input = inputs; for (uint32_t i = 0; i < nSrcComponents; i++) input[i] = pSrcValues[i]; - cmsDoTransform(p->m_hTransform, input.data(), output, 1); + cmsDoTransform(p->m_hTransform, input, output, 1); } else { - std::vector<uint8_t> input(std::max(16U, nSrcComponents)); + CFX_FixedBufGrow<uint8_t, 16> inputs(nSrcComponents); + uint8_t* input = inputs; for (uint32_t i = 0; i < nSrcComponents; i++) { if (pSrcValues[i] > 1.0f) input[i] = 255; @@ -182,7 +181,7 @@ void IccLib_Translate(void* pTransform, else input[i] = static_cast<int>(pSrcValues[i] * 255.0f); } - cmsDoTransform(p->m_hTransform, input.data(), output, 1); + cmsDoTransform(p->m_hTransform, input, output, 1); } switch (p->m_nDstComponents) { case 1: |