summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-04-20 15:29:25 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-20 20:12:17 +0000
commitddfc3dcce42ad1dc805f29102f7d056a5809d489 (patch)
tree686e0f28269a8d1e3c9eb2e9806f76ee2cb4b9f5 /core/fpdfapi
parent58532b670716d5fe3ab024475fa1aa1580ecfe5b (diff)
downloadpdfium-ddfc3dcce42ad1dc805f29102f7d056a5809d489.tar.xz
Let {Argb,Cmyk}Decode return tuples
Change-Id: Ic4e766d9417f9a9ece5f9e4269d0f96e1e91639b Reviewed-on: https://pdfium-review.googlesource.com/4392 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_image.cpp7
-rw-r--r--core/fpdfapi/render/cpdf_renderoptions.cpp7
2 files changed, 9 insertions, 5 deletions
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index da49fab8b1..2c117fdc71 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -183,9 +183,10 @@ void CPDF_Image::SetImage(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap) {
int32_t set_g = 0;
int32_t set_b = 0;
if (!pBitmap->IsAlphaMask()) {
- ArgbDecode(pBitmap->GetPaletteArgb(0), reset_a, reset_r, reset_g,
- reset_b);
- ArgbDecode(pBitmap->GetPaletteArgb(1), set_a, set_r, set_g, set_b);
+ std::tie(reset_a, reset_r, reset_g, reset_b) =
+ ArgbDecode(pBitmap->GetPaletteArgb(0));
+ std::tie(set_a, set_r, set_g, set_b) =
+ ArgbDecode(pBitmap->GetPaletteArgb(1));
}
if (set_a == 0 || reset_a == 0) {
pDict->SetNewFor<CPDF_Boolean>("ImageMask", true);
diff --git a/core/fpdfapi/render/cpdf_renderoptions.cpp b/core/fpdfapi/render/cpdf_renderoptions.cpp
index 717e036fea..70a4cf9615 100644
--- a/core/fpdfapi/render/cpdf_renderoptions.cpp
+++ b/core/fpdfapi/render/cpdf_renderoptions.cpp
@@ -36,8 +36,11 @@ FX_ARGB CPDF_RenderOptions::TranslateColor(FX_ARGB argb) const {
if (m_ColorMode == RENDER_COLOR_ALPHA)
return argb;
- int a, r, g, b;
- ArgbDecode(argb, a, r, g, b);
+ int a;
+ int r;
+ int g;
+ int b;
+ std::tie(a, r, g, b) = ArgbDecode(argb);
int gray = FXRGB2GRAY(r, g, b);
if (m_ColorMode == RENDER_COLOR_TWOCOLOR) {
int color = (r - gray) * (r - gray) + (g - gray) * (g - gray) +