Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: include/utils/mac/SkCGUtils.h

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/utils/SkFrontBufferedStream.h ('k') | samplecode/SampleAnimator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « include/utils/SkFrontBufferedStream.h ('k') | samplecode/SampleAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698