summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_defaultappearance.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-16 11:35:42 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-16 16:23:11 +0000
commit8e7f932410732a4f05d2e69e9ff66277f54d1bd7 (patch)
tree963cf7fd3558da33edbc8b4e9ce52107d574037e /core/fpdfdoc/cpdf_defaultappearance.cpp
parenta74a6277a0913a674719da3134efd877a5e8d091 (diff)
downloadpdfium-8e7f932410732a4f05d2e69e9ff66277f54d1bd7.tar.xz
Convert CPVT_Color to CFX_Color
This CL converts the use of CPVT_Color to CFX_Color and removes the CPVT_Color class. Change-Id: I86a2d06524cd8f0fbce2335f0185426cc41dbe84 Reviewed-on: https://pdfium-review.googlesource.com/16030 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_defaultappearance.cpp')
-rw-r--r--core/fpdfdoc/cpdf_defaultappearance.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/fpdfdoc/cpdf_defaultappearance.cpp b/core/fpdfdoc/cpdf_defaultappearance.cpp
index bd7ea1bc07..02d6eea41f 100644
--- a/core/fpdfdoc/cpdf_defaultappearance.cpp
+++ b/core/fpdfdoc/cpdf_defaultappearance.cpp
@@ -10,7 +10,7 @@
#include "core/fpdfapi/parser/cpdf_simple_parser.h"
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
-#include "core/fpdfdoc/cpdf_formcontrol.h"
+#include "core/fxge/cfx_color.h"
bool CPDF_DefaultAppearance::HasFont() {
if (m_csDA.IsEmpty())
@@ -110,7 +110,7 @@ ByteString CPDF_DefaultAppearance::GetColorString(PaintOperation nOperation) {
void CPDF_DefaultAppearance::GetColor(int& iColorType,
float fc[4],
PaintOperation nOperation) {
- iColorType = COLORTYPE_TRANSPARENT;
+ iColorType = CFX_Color::kTransparent;
for (int c = 0; c < 4; c++)
fc[c] = 0;
@@ -120,13 +120,13 @@ void CPDF_DefaultAppearance::GetColor(int& iColorType,
CPDF_SimpleParser syntax(m_csDA.AsStringView());
if (syntax.FindTagParamFromStart(
(nOperation == PaintOperation::STROKE ? "G" : "g"), 1)) {
- iColorType = COLORTYPE_GRAY;
+ iColorType = CFX_Color::kGray;
fc[0] = FX_atof(syntax.GetWord());
return;
}
if (syntax.FindTagParamFromStart(
(nOperation == PaintOperation::STROKE ? "RG" : "rg"), 3)) {
- iColorType = COLORTYPE_RGB;
+ iColorType = CFX_Color::kRGB;
fc[0] = FX_atof(syntax.GetWord());
fc[1] = FX_atof(syntax.GetWord());
fc[2] = FX_atof(syntax.GetWord());
@@ -134,7 +134,7 @@ void CPDF_DefaultAppearance::GetColor(int& iColorType,
}
if (syntax.FindTagParamFromStart(
(nOperation == PaintOperation::STROKE ? "K" : "k"), 4)) {
- iColorType = COLORTYPE_CMYK;
+ iColorType = CFX_Color::kCMYK;
fc[0] = FX_atof(syntax.GetWord());
fc[1] = FX_atof(syntax.GetWord());
fc[2] = FX_atof(syntax.GetWord());
@@ -146,21 +146,21 @@ void CPDF_DefaultAppearance::GetColor(FX_ARGB& color,
int& iColorType,
PaintOperation nOperation) {
color = 0;
- iColorType = COLORTYPE_TRANSPARENT;
+ iColorType = CFX_Color::kTransparent;
if (m_csDA.IsEmpty())
return;
CPDF_SimpleParser syntax(m_csDA.AsStringView());
if (syntax.FindTagParamFromStart(
(nOperation == PaintOperation::STROKE ? "G" : "g"), 1)) {
- iColorType = COLORTYPE_GRAY;
+ iColorType = CFX_Color::kGray;
float g = FX_atof(syntax.GetWord()) * 255 + 0.5f;
color = ArgbEncode(255, (int)g, (int)g, (int)g);
return;
}
if (syntax.FindTagParamFromStart(
(nOperation == PaintOperation::STROKE ? "RG" : "rg"), 3)) {
- iColorType = COLORTYPE_RGB;
+ iColorType = CFX_Color::kRGB;
float r = FX_atof(syntax.GetWord()) * 255 + 0.5f;
float g = FX_atof(syntax.GetWord()) * 255 + 0.5f;
float b = FX_atof(syntax.GetWord()) * 255 + 0.5f;
@@ -169,7 +169,7 @@ void CPDF_DefaultAppearance::GetColor(FX_ARGB& color,
}
if (syntax.FindTagParamFromStart(
(nOperation == PaintOperation::STROKE ? "K" : "k"), 4)) {
- iColorType = COLORTYPE_CMYK;
+ iColorType = CFX_Color::kCMYK;
float c = FX_atof(syntax.GetWord());
float m = FX_atof(syntax.GetWord());
float y = FX_atof(syntax.GetWord());