SkDocument:: Use new API; same functionality
Change-Id: Ic80a13781c3a2145329f36f5c843ca6b16061587 Reviewed-on: https://chromium-review.googlesource.com/1237053 Reviewed-by: Ben Wagner <bungeman@chromium.org> Reviewed-by: enne <enne@chromium.org> Reviewed-by: Wei Li <weili@chromium.org> Commit-Queue: Hal Canary <halcanary@google.com> Cr-Commit-Position: refs/heads/master@{#593224}
This commit is contained in:
@ -54,6 +54,7 @@
|
||||
#include "third_party/skia/include/core/SkGraphics.h"
|
||||
#include "third_party/skia/include/core/SkPicture.h"
|
||||
#include "third_party/skia/include/core/SkPictureRecorder.h"
|
||||
#include "third_party/skia/include/docs/SkXPSDocument.h"
|
||||
// Note that headers in third_party/skia/src are fragile. This is
|
||||
// an experimental, fragile, and diagnostic-only document type.
|
||||
#include "third_party/skia/src/utils/SkMultiPictureDocument.h"
|
||||
@ -487,7 +488,7 @@ static sk_sp<SkDocument> MakeXPSDocument(SkWStream* s) {
|
||||
LOG(ERROR) << "CoCreateInstance(CLSID_XpsOMObjectFactory, ...) failed:"
|
||||
<< logging::SystemErrorCodeToString(hr);
|
||||
}
|
||||
return SkDocument::MakeXPS(s, factory.Get());
|
||||
return SkXPS::MakeDocument(s, factory.Get());
|
||||
}
|
||||
#endif
|
||||
} // namespace
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "third_party/skia/include/core/SkPicture.h"
|
||||
#include "third_party/skia/include/core/SkPictureRecorder.h"
|
||||
#include "third_party/skia/include/core/SkTime.h"
|
||||
#include "third_party/skia/include/docs/SkPDFDocument.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@ -42,17 +43,15 @@ namespace printing {
|
||||
|
||||
sk_sp<SkDocument> MakePdfDocument(const std::string& creator,
|
||||
SkWStream* stream) {
|
||||
SkDocument::PDFMetadata metadata;
|
||||
SkPDF::Metadata metadata;
|
||||
SkTime::DateTime now = TimeToSkTime(base::Time::Now());
|
||||
metadata.fCreation.fEnabled = true;
|
||||
metadata.fCreation.fDateTime = now;
|
||||
metadata.fModified.fEnabled = true;
|
||||
metadata.fModified.fDateTime = now;
|
||||
metadata.fCreation = now;
|
||||
metadata.fModified = now;
|
||||
metadata.fCreator = creator.empty()
|
||||
? SkString("Chromium")
|
||||
: SkString(creator.c_str(), creator.size());
|
||||
metadata.fRasterDPI = 300.0f;
|
||||
return SkDocument::MakePDF(stream, metadata);
|
||||
return SkPDF::MakeDocument(stream, metadata);
|
||||
}
|
||||
|
||||
sk_sp<SkData> SerializeOopPicture(SkPicture* pic, void* ctx) {
|
||||
|
Reference in New Issue
Block a user