Index: src/pdf/SkPDFUtils.cpp |
diff --git a/src/pdf/SkPDFUtils.cpp b/src/pdf/SkPDFUtils.cpp |
index 90e2058d24f4bd601f76c440ccb28b408233ee42..16abc2f9f252b381a26a4d8c016361018d71c712 100644 |
--- a/src/pdf/SkPDFUtils.cpp |
+++ b/src/pdf/SkPDFUtils.cpp |
@@ -11,6 +11,7 @@ |
#include "SkGeometry.h" |
#include "SkPaint.h" |
#include "SkPath.h" |
+#include "SkPDFResourceDict.h" |
#include "SkPDFUtils.h" |
#include "SkStream.h" |
#include "SkString.h" |
@@ -206,14 +207,18 @@ void SkPDFUtils::StrokePath(SkWStream* content) { |
// static |
void SkPDFUtils::DrawFormXObject(int objectIndex, SkWStream* content) { |
- content->writeText("/X"); |
- content->writeDecAsText(objectIndex); |
+ content->writeText("/"); |
+ content->writeText(SkPDFResourceDict::getResourceName( |
+ SkPDFResourceDict::kXObject_ResourceType, |
+ objectIndex).c_str()); |
content->writeText(" Do\n"); |
} |
// static |
void SkPDFUtils::ApplyGraphicState(int objectIndex, SkWStream* content) { |
- content->writeText("/G"); |
- content->writeDecAsText(objectIndex); |
+ content->writeText("/"); |
+ content->writeText(SkPDFResourceDict::getResourceName( |
+ SkPDFResourceDict::kExtGState_ResourceType, |
+ objectIndex).c_str()); |
content->writeText(" gs\n"); |
} |