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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 static inline size_t SkImageMinRowBytes(const SkImage::Info& info) { | 48 static inline size_t SkImageMinRowBytes(const SkImage::Info& info) { |
49 size_t rb = info.fWidth * SkImageBytesPerPixel(info.fColorType); | 49 size_t rb = info.fWidth * SkImageBytesPerPixel(info.fColorType); |
50 return SkAlign4(rb); | 50 return SkAlign4(rb); |
51 } | 51 } |
52 | 52 |
53 // Given an image created from SkNewImageFromBitmap, return its pixelref. This | 53 // Given an image created from SkNewImageFromBitmap, return its pixelref. This |
54 // may be called to see if the surface and the image share the same pixelref, | 54 // may be called to see if the surface and the image share the same pixelref, |
55 // in which case the surface may need to perform a copy-on-write. | 55 // in which case the surface may need to perform a copy-on-write. |
56 extern SkPixelRef* SkBitmapImageGetPixelRef(SkImage* rasterImage); | 56 extern SkPixelRef* SkBitmapImageGetPixelRef(SkImage* rasterImage); |
57 | 57 |
| 58 // Given an image created with NewPicture, return its SkPicture. |
| 59 extern SkPicture* SkPictureImageGetPicture(SkImage* pictureImage); |
| 60 |
58 // Given an image created with NewTexture, return its GrTexture. This | 61 // Given an image created with NewTexture, return its GrTexture. This |
59 // may be called to see if the surface and the image share the same GrTexture, | 62 // 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. | 63 // in which case the surface may need to perform a copy-on-write. |
61 extern GrTexture* SkTextureImageGetTexture(SkImage* rasterImage); | 64 extern GrTexture* SkTextureImageGetTexture(SkImage* textureImage); |
62 | 65 |
63 // Update the texture wrapped by an image created with NewTexture. This | 66 // 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 | 67 // is called when a surface and image share the same GrTexture and the |
65 // surface needs to perform a copy-on-write | 68 // surface needs to perform a copy-on-write |
66 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); | 69 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); |
67 | 70 |
68 #endif | 71 #endif |
OLD | NEW |