OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkData.h" | 8 #include "SkData.h" |
9 #include "SkDeflate.h" | 9 #include "SkDeflate.h" |
| 10 #include "SkMakeUnique.h" |
10 #include "SkPDFTypes.h" | 11 #include "SkPDFTypes.h" |
11 #include "SkPDFUtils.h" | 12 #include "SkPDFUtils.h" |
12 #include "SkStream.h" | 13 #include "SkStream.h" |
13 #include "SkStreamPriv.h" | 14 #include "SkStreamPriv.h" |
14 | 15 |
15 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
16 | 17 |
17 SkString* pun(char* x) { return reinterpret_cast<SkString*>(x); } | 18 SkString* pun(char* x) { return reinterpret_cast<SkString*>(x); } |
18 const SkString* pun(const char* x) { | 19 const SkString* pun(const char* x) { |
19 return reinterpret_cast<const SkString*>(x); | 20 return reinterpret_cast<const SkString*>(x); |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 void SkPDFSharedStream::addResources( | 500 void SkPDFSharedStream::addResources( |
500 SkPDFObjNumMap* catalog) const { | 501 SkPDFObjNumMap* catalog) const { |
501 SkASSERT(fAsset); | 502 SkASSERT(fAsset); |
502 fDict.addResources(catalog); | 503 fDict.addResources(catalog); |
503 } | 504 } |
504 | 505 |
505 | 506 |
506 //////////////////////////////////////////////////////////////////////////////// | 507 //////////////////////////////////////////////////////////////////////////////// |
507 | 508 |
508 SkPDFStream:: SkPDFStream(sk_sp<SkData> data) { | 509 SkPDFStream:: SkPDFStream(sk_sp<SkData> data) { |
509 this->setData(std::unique_ptr<SkStreamAsset>( | 510 this->setData(skstd::make_unique<SkMemoryStream>(std::move(data))); |
510 new SkMemoryStream(std::move(data)))); | |
511 } | 511 } |
512 | 512 |
513 SkPDFStream::SkPDFStream(std::unique_ptr<SkStreamAsset> stream) { | 513 SkPDFStream::SkPDFStream(std::unique_ptr<SkStreamAsset> stream) { |
514 this->setData(std::move(stream)); | 514 this->setData(std::move(stream)); |
515 } | 515 } |
516 | 516 |
517 SkPDFStream::SkPDFStream() {} | 517 SkPDFStream::SkPDFStream() {} |
518 | 518 |
519 SkPDFStream::~SkPDFStream() {} | 519 SkPDFStream::~SkPDFStream() {} |
520 | 520 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 | 604 |
605 void SkPDFImageDumpStats() { | 605 void SkPDFImageDumpStats() { |
606 SkDebugf("\ntotal PDF drawImage/drawBitmap calls: %d\n" | 606 SkDebugf("\ntotal PDF drawImage/drawBitmap calls: %d\n" |
607 "total PDF jpeg images: %d\n" | 607 "total PDF jpeg images: %d\n" |
608 "total PDF regular images: %d\n", | 608 "total PDF regular images: %d\n", |
609 gDrawImageCalls.load(), | 609 gDrawImageCalls.load(), |
610 gJpegImageObjects.load(), | 610 gJpegImageObjects.load(), |
611 gRegularImageObjects.load()); | 611 gRegularImageObjects.load()); |
612 } | 612 } |
613 #endif // SK_PDF_IMAGE_STATS | 613 #endif // SK_PDF_IMAGE_STATS |
OLD | NEW |