From 7e33dbeec78dfa051df52619672133da6a799240 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 23 May 2018 23:41:00 +0000 Subject: Remove GetBits32(). Replace it with CFX_BitStream. Change-Id: Ib74657f888b8dec8b6fdad7b49e28d250991c590 Reviewed-on: https://pdfium-review.googlesource.com/32852 Commit-Queue: Lei Zhang Reviewed-by: dsinclair --- core/fxge/skia/fx_skia_device.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/fxge/skia') 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 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(bitstream.GetBits(sampleSize)); + float interp = sample / (sampleCount - 1); floatColors[j] = colorsMin[j] + (colorsMax[j] - colorsMin[j]) * interp; } SkColor color = -- cgit v1.2.3