summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-13 15:44:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-13 15:44:36 +0000
commit996c93068bfc8b443c77b735bc6400285bc8a407 (patch)
tree13b6d18f62f15c4ba04edec3dd2349f7ae3c1d54 /fpdfsdk
parent7afdad5ab7a1bd54ddf6f2a823be30d4b8e39567 (diff)
downloadpdfium-996c93068bfc8b443c77b735bc6400285bc8a407.tar.xz
Rename the other CPDF_Color::SetValue() variant.
Rename it to SetValueForNonePattern() and combine the components parameters into a std::vector. Fix the callers to use std::vector as well. Change-Id: I0edd7e7876e47b56821e63cc5073fc21fd4098ee Reviewed-on: https://pdfium-review.googlesource.com/30470 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_editpage.cpp5
-rw-r--r--fpdfsdk/fpdf_editpath.cpp4
2 files changed, 5 insertions, 4 deletions
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index bc494f8d85..20d88942c8 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -9,6 +9,7 @@
#include <algorithm>
#include <memory>
#include <utility>
+#include <vector>
#include "core/fpdfapi/edit/cpdf_pagecontentgenerator.h"
#include "core/fpdfapi/page/cpdf_form.h"
@@ -399,11 +400,11 @@ FPDF_BOOL FPDFPageObj_SetFillColor(FPDF_PAGEOBJECT page_object,
if (!page_object || R > 255 || G > 255 || B > 255 || A > 255)
return false;
- float rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
+ std::vector<float> rgb = {R / 255.f, G / 255.f, B / 255.f};
auto* pPageObj = CPDFPageObjectFromFPDFPageObject(page_object);
pPageObj->m_GeneralState.SetFillAlpha(A / 255.f);
pPageObj->m_ColorState.SetFillColor(
- CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
+ CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb);
pPageObj->SetDirty(true);
return true;
}
diff --git a/fpdfsdk/fpdf_editpath.cpp b/fpdfsdk/fpdf_editpath.cpp
index 2daec67e36..82c7ca13ef 100644
--- a/fpdfsdk/fpdf_editpath.cpp
+++ b/fpdfsdk/fpdf_editpath.cpp
@@ -80,10 +80,10 @@ FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path,
if (!pPathObj || R > 255 || G > 255 || B > 255 || A > 255)
return false;
- float rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
+ std::vector<float> rgb = {R / 255.f, G / 255.f, B / 255.f};
pPathObj->m_GeneralState.SetStrokeAlpha(A / 255.f);
pPathObj->m_ColorState.SetStrokeColor(
- CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
+ CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb);
pPathObj->SetDirty(true);
return true;
}