OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #ifndef SkImagePriv_DEFINED | 8 #ifndef SkImagePriv_DEFINED |
9 #define SkImagePriv_DEFINED | 9 #define SkImagePriv_DEFINED |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 * locked when kLocked_SharedPixelRefMode is specified. | 26 * locked when kLocked_SharedPixelRefMode is specified. |
27 * | 27 * |
28 * Passing kLocked_SharedPixelRefMode allows the image's peekPixels() method | 28 * Passing kLocked_SharedPixelRefMode allows the image's peekPixels() method |
29 * to succeed, but it will force any lazy decodes/generators to execute if | 29 * to succeed, but it will force any lazy decodes/generators to execute if |
30 * they exist on the pixelref. | 30 * they exist on the pixelref. |
31 * | 31 * |
32 * It is illegal to call this with a texture-backed bitmap. | 32 * It is illegal to call this with a texture-backed bitmap. |
33 * | 33 * |
34 * If the bitmap's colortype cannot be converted into a corresponding | 34 * If the bitmap's colortype cannot be converted into a corresponding |
35 * SkImageInfo, or the bitmap's pixels cannot be accessed, this will return | 35 * SkImageInfo, or the bitmap's pixels cannot be accessed, this will return |
36 * NULL. | 36 * nullptr. |
37 */ | 37 */ |
38 enum ForceCopyMode { | 38 enum ForceCopyMode { |
39 kNo_ForceCopyMode, | 39 kNo_ForceCopyMode, |
40 kYes_ForceCopyMode, // must copy the pixels even if the bitmap is immutable | 40 kYes_ForceCopyMode, // must copy the pixels even if the bitmap is immutable |
41 }; | 41 }; |
42 extern SkImage* SkNewImageFromRasterBitmap(const SkBitmap&, const SkSurfaceProps
*, | 42 extern SkImage* SkNewImageFromRasterBitmap(const SkBitmap&, const SkSurfaceProps
*, |
43 ForceCopyMode = kNo_ForceCopyMode); | 43 ForceCopyMode = kNo_ForceCopyMode); |
44 | 44 |
45 static inline size_t SkImageMinRowBytes(const SkImageInfo& info) { | 45 static inline size_t SkImageMinRowBytes(const SkImageInfo& info) { |
46 size_t minRB = info.minRowBytes(); | 46 size_t minRB = info.minRowBytes(); |
(...skipping 15 matching lines...) Expand all Loading... |
62 extern void SkTextureImageApplyBudgetedDecision(SkImage* textureImage); | 62 extern void SkTextureImageApplyBudgetedDecision(SkImage* textureImage); |
63 | 63 |
64 // Update the texture wrapped by an image created with NewTexture. This | 64 // Update the texture wrapped by an image created with NewTexture. This |
65 // is called when a surface and image share the same GrTexture and the | 65 // is called when a surface and image share the same GrTexture and the |
66 // surface needs to perform a copy-on-write | 66 // surface needs to perform a copy-on-write |
67 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); | 67 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); |
68 | 68 |
69 GrTexture* GrDeepCopyTexture(GrTexture* src, bool isBudgeted); | 69 GrTexture* GrDeepCopyTexture(GrTexture* src, bool isBudgeted); |
70 | 70 |
71 #endif | 71 #endif |
OLD | NEW |