| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkPDFImage_DEFINED | 10 #ifndef SkPDFImage_DEFINED |
| 11 #define SkPDFImage_DEFINED | 11 #define SkPDFImage_DEFINED |
| 12 | 12 |
| 13 #include "SkPicture.h" | 13 #include "SkPicture.h" |
| 14 #include "SkPDFDevice.h" | 14 #include "SkPDFDevice.h" |
| 15 #include "SkPDFStream.h" | 15 #include "SkPDFStream.h" |
| 16 #include "SkPDFTypes.h" | 16 #include "SkPDFTypes.h" |
| 17 #include "SkRefCnt.h" | 17 #include "SkRefCnt.h" |
| 18 | 18 |
| 19 class SkBitmap; | 19 class SkBitmap; |
| 20 class SkData; |
| 20 class SkPDFCatalog; | 21 class SkPDFCatalog; |
| 21 struct SkIRect; | 22 struct SkIRect; |
| 22 | 23 |
| 24 /** |
| 25 * Return the mose efficient availible encoding of the given bitmap. |
| 26 * |
| 27 * If the bitmap has encoded JPEG data and that data can be embedded |
| 28 * into the PDF output stream directly, use that. Otherwise, fall |
| 29 * back on SkPDFImage::CreateImage. |
| 30 */ |
| 31 SkPDFObject* SkPDFCreateImageObject( |
| 32 const SkBitmap&, const SkIRect& subset, SkPicture::EncodeBitmap); |
| 33 |
| 23 /** \class SkPDFImage | 34 /** \class SkPDFImage |
| 24 | 35 |
| 25 An image XObject. | 36 An image XObject. |
| 26 */ | 37 */ |
| 27 | 38 |
| 28 // We could play the same trick here as is done in SkPDFGraphicState, storing | 39 // We could play the same trick here as is done in SkPDFGraphicState, storing |
| 29 // a copy of the Bitmap object (not the pixels), the pixel generation number, | 40 // a copy of the Bitmap object (not the pixels), the pixel generation number, |
| 30 // and settings used from the paint to canonicalize image objects. | 41 // and settings used from the paint to canonicalize image objects. |
| 31 class SkPDFImage : public SkPDFStream { | 42 class SkPDFImage : public SkPDFStream { |
| 32 public: | 43 public: |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 SkPDFImage(SkPDFImage& pdfImage); | 100 SkPDFImage(SkPDFImage& pdfImage); |
| 90 | 101 |
| 91 // Populate the stream dictionary. This method returns false if | 102 // Populate the stream dictionary. This method returns false if |
| 92 // fSubstitute should be used. | 103 // fSubstitute should be used. |
| 93 virtual bool populate(SkPDFCatalog* catalog); | 104 virtual bool populate(SkPDFCatalog* catalog); |
| 94 | 105 |
| 95 typedef SkPDFStream INHERITED; | 106 typedef SkPDFStream INHERITED; |
| 96 }; | 107 }; |
| 97 | 108 |
| 98 #endif | 109 #endif |
| OLD | NEW |