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 "SkPDFDevice.h" | 8 #include "SkPDFDevice.h" |
9 | 9 |
10 #include "SkAnnotationKeys.h" | 10 #include "SkAnnotationKeys.h" |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 } else { | 725 } else { |
726 fInitialTransform.setIdentity(); | 726 fInitialTransform.setIdentity(); |
727 } | 727 } |
728 } | 728 } |
729 | 729 |
730 SkPDFDevice::~SkPDFDevice() { | 730 SkPDFDevice::~SkPDFDevice() { |
731 this->cleanUp(true); | 731 this->cleanUp(true); |
732 } | 732 } |
733 | 733 |
734 void SkPDFDevice::init() { | 734 void SkPDFDevice::init() { |
735 fContentEntries.free(); | 735 fContentEntries.reset(); |
736 fLastContentEntry = nullptr; | 736 fLastContentEntry = nullptr; |
737 fMarginContentEntries.free(); | 737 fMarginContentEntries.reset(); |
738 fLastMarginContentEntry = nullptr; | 738 fLastMarginContentEntry = nullptr; |
739 fDrawingArea = kContent_DrawingArea; | 739 fDrawingArea = kContent_DrawingArea; |
740 if (fFontGlyphUsage.get() == nullptr) { | 740 if (fFontGlyphUsage.get() == nullptr) { |
741 fFontGlyphUsage.reset(new SkPDFGlyphSetMap); | 741 fFontGlyphUsage.reset(new SkPDFGlyphSetMap); |
742 } | 742 } |
743 } | 743 } |
744 | 744 |
745 void SkPDFDevice::cleanUp(bool clearFontUsage) { | 745 void SkPDFDevice::cleanUp(bool clearFontUsage) { |
746 fGraphicStateResources.unrefAll(); | 746 fGraphicStateResources.unrefAll(); |
747 fXObjectResources.unrefAll(); | 747 fXObjectResources.unrefAll(); |
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2329 pdfimage.reset(SkPDFCreateBitmapObject( | 2329 pdfimage.reset(SkPDFCreateBitmapObject( |
2330 image, fCanon->getPixelSerializer())); | 2330 image, fCanon->getPixelSerializer())); |
2331 if (!pdfimage) { | 2331 if (!pdfimage) { |
2332 return; | 2332 return; |
2333 } | 2333 } |
2334 fCanon->addPDFBitmap(image->uniqueID(), pdfimage.get()); | 2334 fCanon->addPDFBitmap(image->uniqueID(), pdfimage.get()); |
2335 } | 2335 } |
2336 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), | 2336 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), |
2337 &content.entry()->fContent); | 2337 &content.entry()->fContent); |
2338 } | 2338 } |
OLD | NEW |