| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
| 9 #include "SkAndroidCodec.h" | 9 #include "SkAndroidCodec.h" |
| 10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 return "SkDocument::CreatePDF() returned nullptr"; | 972 return "SkDocument::CreatePDF() returned nullptr"; |
| 973 } | 973 } |
| 974 SkTArray<SkDocument::Attribute> info; | 974 SkTArray<SkDocument::Attribute> info; |
| 975 info.emplace_back(SkString("Title"), src.name()); | 975 info.emplace_back(SkString("Title"), src.name()); |
| 976 info.emplace_back(SkString("Subject"), | 976 info.emplace_back(SkString("Subject"), |
| 977 SkString("rendering correctness test")); | 977 SkString("rendering correctness test")); |
| 978 info.emplace_back(SkString("Creator"), SkString("Skia/DM")); | 978 info.emplace_back(SkString("Creator"), SkString("Skia/DM")); |
| 979 | 979 |
| 980 info.emplace_back(SkString("Keywords"), | 980 info.emplace_back(SkString("Keywords"), |
| 981 SkStringPrintf("Rasterizer:%s;", fRasterizer)); | 981 SkStringPrintf("Rasterizer:%s;", fRasterizer)); |
| 982 doc->setMetadata(info, nullptr, nullptr); | 982 doc->setMetadata(&info[0], info.count(), nullptr, nullptr); |
| 983 return draw_skdocument(src, doc.get(), dst); | 983 return draw_skdocument(src, doc.get(), dst); |
| 984 } | 984 } |
| 985 | 985 |
| 986 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ | 986 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
| 987 | 987 |
| 988 XPSSink::XPSSink() {} | 988 XPSSink::XPSSink() {} |
| 989 | 989 |
| 990 Error XPSSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const
{ | 990 Error XPSSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const
{ |
| 991 SkAutoTUnref<SkDocument> doc(SkDocument::CreateXPS(dst)); | 991 SkAutoTUnref<SkDocument> doc(SkDocument::CreateXPS(dst)); |
| 992 if (!doc) { | 992 if (!doc) { |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 skr.visit<void>(i, drawsAsSingletonPictures); | 1410 skr.visit<void>(i, drawsAsSingletonPictures); |
| 1411 } | 1411 } |
| 1412 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); | 1412 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); |
| 1413 | 1413 |
| 1414 canvas->drawPicture(macroPic); | 1414 canvas->drawPicture(macroPic); |
| 1415 return check_against_reference(bitmap, src, fSink); | 1415 return check_against_reference(bitmap, src, fSink); |
| 1416 }); | 1416 }); |
| 1417 } | 1417 } |
| 1418 | 1418 |
| 1419 } // namespace DM | 1419 } // namespace DM |
| OLD | NEW |