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 |
11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
12 #include "SkImage.h" | 12 #include "SkImage.h" |
13 | 13 |
14 class SkPicture; | 14 class SkPicture; |
15 | 15 |
16 extern SkBitmap::Config SkImageInfoToBitmapConfig(const SkImageInfo&); | 16 extern SkBitmap::Config SkImageInfoToBitmapConfig(const SkImageInfo&); |
| 17 extern SkBitmap::Config SkColorTypeToBitmapConfig(SkColorType); |
| 18 extern SkColorType SkBitmapConfigToColorType(SkBitmap::Config); |
17 | 19 |
18 // Call this if you explicitly want to use/share this pixelRef in the image | 20 // Call this if you explicitly want to use/share this pixelRef in the image |
19 extern SkImage* SkNewImageFromPixelRef(const SkImageInfo&, SkPixelRef*, | 21 extern SkImage* SkNewImageFromPixelRef(const SkImageInfo&, SkPixelRef*, |
20 size_t rowBytes); | 22 size_t rowBytes); |
21 | 23 |
22 /** | 24 /** |
23 * Examines the bitmap to decide if it can share the existing pixelRef, or | 25 * Examines the bitmap to decide if it can share the existing pixelRef, or |
24 * if it needs to make a deep-copy of the pixels. The bitmap's pixelref will | 26 * if it needs to make a deep-copy of the pixels. The bitmap's pixelref will |
25 * be shared if either the bitmap is marked as immutable, or canSharePixelRef | 27 * be shared if either the bitmap is marked as immutable, or canSharePixelRef |
26 * is true. | 28 * is true. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // may be called to see if the surface and the image share the same GrTexture, | 61 // may be called to see if the surface and the image share the same GrTexture, |
60 // in which case the surface may need to perform a copy-on-write. | 62 // in which case the surface may need to perform a copy-on-write. |
61 extern GrTexture* SkTextureImageGetTexture(SkImage* textureImage); | 63 extern GrTexture* SkTextureImageGetTexture(SkImage* textureImage); |
62 | 64 |
63 // Update the texture wrapped by an image created with NewTexture. This | 65 // Update the texture wrapped by an image created with NewTexture. This |
64 // is called when a surface and image share the same GrTexture and the | 66 // is called when a surface and image share the same GrTexture and the |
65 // surface needs to perform a copy-on-write | 67 // surface needs to perform a copy-on-write |
66 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); | 68 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); |
67 | 69 |
68 #endif | 70 #endif |
OLD | NEW |