summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-23 23:41:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-23 23:41:00 +0000
commit7e33dbeec78dfa051df52619672133da6a799240 (patch)
treedbcd9f395ed0b89de890af24deae9fa1744fdd8e /core/fxge
parent105ea1c0f896a4a2718f1356cae0dce8c01859cc (diff)
downloadpdfium-7e33dbeec78dfa051df52619672133da6a799240.tar.xz
Remove GetBits32().
Replace it with CFX_BitStream. Change-Id: Ib74657f888b8dec8b6fdad7b49e28d250991c590 Reviewed-on: https://pdfium-review.googlesource.com/32852 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/skia/fx_skia_device.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 6dd19eaed9..c0cc4e43d5 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -15,7 +15,7 @@
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
-#include "core/fxcrt/fx_extension.h"
+#include "core/fxcrt/cfx_bitstream.h"
#include "core/fxcrt/fx_memory.h"
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_font.h"
@@ -407,11 +407,12 @@ bool AddSamples(const CPDF_SampledFunc* pFunc,
colorsMax[i] = pFunc->GetRange(i * 2 + 1);
}
pdfium::span<const uint8_t> pSampleData = pFunc->GetSampleStream()->GetSpan();
+ CFX_BitStream bitstream(pSampleData);
for (uint32_t i = 0; i < sampleCount; ++i) {
float floatColors[3];
for (uint32_t j = 0; j < 3; ++j) {
- int sample = GetBits32(pSampleData, (i * 3 + j) * sampleSize, sampleSize);
- float interp = (float)sample / (sampleCount - 1);
+ float sample = static_cast<float>(bitstream.GetBits(sampleSize));
+ float interp = sample / (sampleCount - 1);
floatColors[j] = colorsMin[j] + (colorsMax[j] - colorsMin[j]) * interp;
}
SkColor color =