Index: src/pdf/SkPDFTypes.cpp |
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp |
index f9ab5e492a26396ea0731e71e39acb44ff4d621d..8c59a4a0085c1da9b0ca918457937e8ea2cfb37f 100644 |
--- a/src/pdf/SkPDFTypes.cpp |
+++ b/src/pdf/SkPDFTypes.cpp |
@@ -118,6 +118,9 @@ void SkPDFUnion::emitObject(SkWStream* stream, |
case Type::kInt: |
stream->writeDecAsText(fIntValue); |
return; |
+ case Type::kColorComponent: |
+ SkPDFUtils::AppendColorComponent(SkToU8(fIntValue), stream); |
+ return; |
case Type::kBool: |
stream->writeText(fBoolValue ? "true" : "false"); |
return; |
@@ -159,6 +162,7 @@ void SkPDFUnion::addResources(SkPDFObjNumMap* objNumMap, |
const SkPDFSubstituteMap& substituteMap) const { |
switch (fType) { |
case Type::kInt: |
+ case Type::kColorComponent: |
case Type::kBool: |
case Type::kScalar: |
case Type::kName: |
@@ -185,6 +189,12 @@ SkPDFUnion SkPDFUnion::Int(int32_t value) { |
return u; |
} |
+SkPDFUnion SkPDFUnion::ColorComponent(uint8_t value) { |
+ SkPDFUnion u(Type::kColorComponent); |
+ u.fIntValue = value; |
+ return u; |
+} |
+ |
SkPDFUnion SkPDFUnion::Bool(bool value) { |
SkPDFUnion u(Type::kBool); |
u.fBoolValue = value; |
@@ -300,6 +310,10 @@ void SkPDFArray::appendInt(int32_t value) { |
this->append(SkPDFUnion::Int(value)); |
} |
+void SkPDFArray::appendColorComponent(uint8_t value) { |
+ this->append(SkPDFUnion::ColorComponent(value)); |
+} |
+ |
void SkPDFArray::appendBool(bool value) { |
this->append(SkPDFUnion::Bool(value)); |
} |