| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * Draw the bitmap into the specified CG context. The bitmap will be converted | 58 * Draw the bitmap into the specified CG context. The bitmap will be converted |
| 59 * to a CGImage using the generic RGB colorspace. (x,y) specifies the position | 59 * to a CGImage using the generic RGB colorspace. (x,y) specifies the position |
| 60 * of the top-left corner of the bitmap. The bitmap is converted using the | 60 * of the top-left corner of the bitmap. The bitmap is converted using the |
| 61 * colorspace returned by CGColorSpaceCreateDeviceRGB() | 61 * colorspace returned by CGColorSpaceCreateDeviceRGB() |
| 62 */ | 62 */ |
| 63 void SkCGDrawBitmap(CGContextRef, const SkBitmap&, float x, float y); | 63 void SkCGDrawBitmap(CGContextRef, const SkBitmap&, float x, float y); |
| 64 | 64 |
| 65 /** |
| 66 * Create an SkBitmap drawing of the encoded PDF document, returning true on |
| 67 * success. Deletes the stream when finished. |
| 68 */ |
| 65 bool SkPDFDocumentToBitmap(SkStream* stream, SkBitmap* output); | 69 bool SkPDFDocumentToBitmap(SkStream* stream, SkBitmap* output); |
| 66 | 70 |
| 67 /** | 71 /** |
| 68 * Return a provider that wraps the specified stream. It will become an | 72 * Return a provider that wraps the specified stream. It will become the only |
| 69 * owner of the stream, so the caller must still manage its ownership. | 73 * owner of the stream, so the caller must stop referring to the stream. |
| 70 * | 74 * |
| 71 * To hand-off ownership of the stream to the provider, the caller must do | 75 * When the provider is finally deleted, it will delete the stream. |
| 72 * something like the following: | |
| 73 * | |
| 74 * SkStream* stream = new ...; | |
| 75 * CGDataProviderRef provider = SkStreamToDataProvider(stream); | |
| 76 * stream->unref(); | |
| 77 * | |
| 78 * Now when the provider is finally deleted, it will delete the stream. | |
| 79 */ | 76 */ |
| 80 CGDataProviderRef SkCreateDataProviderFromStream(SkStream*); | 77 CGDataProviderRef SkCreateDataProviderFromStream(SkStream*); |
| 81 | 78 |
| 82 CGDataProviderRef SkCreateDataProviderFromData(SkData*); | 79 CGDataProviderRef SkCreateDataProviderFromData(SkData*); |
| 83 | 80 |
| 84 #endif | 81 #endif |
| OLD | NEW |