Chromium Code Reviews| Index: src/pdf/SkPDFUtils.cpp |
| diff --git a/src/pdf/SkPDFUtils.cpp b/src/pdf/SkPDFUtils.cpp |
| index 16abc2f9f252b381a26a4d8c016361018d71c712..44dbd9be8831b261771f689eaa3deab3bd67f9e3 100644 |
| --- a/src/pdf/SkPDFUtils.cpp |
| +++ b/src/pdf/SkPDFUtils.cpp |
| @@ -17,6 +17,17 @@ |
| #include "SkString.h" |
| #include "SkPDFTypes.h" |
| +//static |
| +SkPDFArray* SkPDFUtils::RectToArray(const SkRect& rect) { |
| + SkPDFArray* result = new SkPDFArray(); |
| + result->reserve(4); |
| + result->appendScalar(rect.fLeft); |
| + result->appendScalar(rect.fTop); |
| + result->appendScalar(rect.fRight); |
| + result->appendScalar(rect.fBottom); |
| + return result; |
| +} |
| + |
| // static |
| SkPDFArray* SkPDFUtils::MatrixToArray(const SkMatrix& matrix) { |
| SkScalar values[6]; |
| @@ -222,3 +233,15 @@ void SkPDFUtils::ApplyGraphicState(int objectIndex, SkWStream* content) { |
| objectIndex).c_str()); |
| content->writeText(" gs\n"); |
| } |
| + |
| +// static |
| +void SkPDFUtils::ApplyPattern(int objectIndex, SkWStream* content) { |
| + SkString resourceName = SkPDFResourceDict::getResourceName( |
| + SkPDFResourceDict::kPattern_ResourceType, |
| + objectIndex); |
| + content->writeText("/Pattern CS/Pattern cs/"); |
|
edisonn
2013/07/17 17:52:24
Do you set the value of /Pattern twice? Per spec,
ducky
2013/07/17 22:18:20
Addressed in comment in the other CL (resource dic
|
| + content->writeText(resourceName.c_str()); |
| + content->writeText(" SCN/"); |
|
edisonn
2013/07/17 17:52:24
please comment the scn/SCN related lines
ducky
2013/07/17 22:18:20
Done.
|
| + content->writeText(resourceName.c_str()); |
| + content->writeText(" scn\n"); |
| +} |