OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 #ifndef SkCGUtils_DEFINED | 8 #ifndef SkCGUtils_DEFINED |
9 #define SkCGUtils_DEFINED | 9 #define SkCGUtils_DEFINED |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 /** | 59 /** |
60 * Draw the bitmap into the specified CG context. The bitmap will be converted | 60 * Draw the bitmap into the specified CG context. The bitmap will be converted |
61 * to a CGImage using the generic RGB colorspace. (x,y) specifies the position | 61 * to a CGImage using the generic RGB colorspace. (x,y) specifies the position |
62 * of the top-left corner of the bitmap. The bitmap is converted using the | 62 * of the top-left corner of the bitmap. The bitmap is converted using the |
63 * colorspace returned by CGColorSpaceCreateDeviceRGB() | 63 * colorspace returned by CGColorSpaceCreateDeviceRGB() |
64 */ | 64 */ |
65 void SkCGDrawBitmap(CGContextRef, const SkBitmap&, float x, float y); | 65 void SkCGDrawBitmap(CGContextRef, const SkBitmap&, float x, float y); |
66 | 66 |
67 /** | 67 /** |
68 * Create an SkBitmap drawing of the encoded PDF document, returning true on | 68 * Return a provider that wraps the specified stream. |
69 * success. Deletes the stream when finished. | |
70 */ | |
71 bool SkPDFDocumentToBitmap(SkStream* stream, SkBitmap* output); | |
72 | |
73 /** | |
74 * Return a provider that wraps the specified stream. It will become the only | |
75 * owner of the stream, so the caller must stop referring to the stream. | |
76 * | |
77 * When the provider is finally deleted, it will delete the stream. | 69 * When the provider is finally deleted, it will delete the stream. |
78 */ | 70 */ |
79 CGDataProviderRef SkCreateDataProviderFromStream(SkStream*); | 71 CGDataProviderRef SkCreateDataProviderFromStream(std::unique_ptr<SkStream>); |
80 | 72 |
81 CGDataProviderRef SkCreateDataProviderFromData(SkData*); | 73 CGDataProviderRef SkCreateDataProviderFromData(sk_sp<SkData>); |
82 | 74 |
83 #endif // defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) | 75 #endif // defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) |
84 #endif // SkCGUtils_DEFINED | 76 #endif // SkCGUtils_DEFINED |
OLD | NEW |