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 "SkImage.h" | 11 #include "SkImage.h" |
12 #include "SkSurface.h" | 12 #include "SkSurface.h" |
13 | 13 |
14 // Call this if you explicitly want to use/share this pixelRef in the image | 14 // Call this if you explicitly want to use/share this pixelRef in the image |
15 extern SkImage* SkNewImageFromPixelRef(const SkImageInfo&, SkPixelRef*, size_t r
owBytes, | 15 extern SkImage* SkNewImageFromPixelRef(const SkImageInfo&, SkPixelRef*, |
| 16 const SkIPoint& pixelRefOrigin, |
| 17 size_t rowBytes, |
16 const SkSurfaceProps*); | 18 const SkSurfaceProps*); |
17 | 19 |
18 /** | 20 /** |
19 * Examines the bitmap to decide if it can share the existing pixelRef, or | 21 * Examines the bitmap to decide if it can share the existing pixelRef, or |
20 * if it needs to make a deep-copy of the pixels. The bitmap's pixelref will | 22 * if it needs to make a deep-copy of the pixels. The bitmap's pixelref will |
21 * be shared if either the bitmap is marked as immutable, or canSharePixelRef | 23 * be shared if either the bitmap is marked as immutable, or canSharePixelRef |
22 * is true. | 24 * is true. |
23 * | 25 * |
24 * If the bitmap's colortype cannot be converted into a corresponding | 26 * If the bitmap's colortype cannot be converted into a corresponding |
25 * SkImageInfo, or the bitmap's pixels cannot be accessed, this will return | 27 * SkImageInfo, or the bitmap's pixels cannot be accessed, this will return |
(...skipping 23 matching lines...) Expand all Loading... |
49 | 51 |
50 // Update the texture wrapped by an image created with NewTexture. This | 52 // Update the texture wrapped by an image created with NewTexture. This |
51 // is called when a surface and image share the same GrTexture and the | 53 // is called when a surface and image share the same GrTexture and the |
52 // surface needs to perform a copy-on-write | 54 // surface needs to perform a copy-on-write |
53 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); | 55 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); |
54 | 56 |
55 extern SkImage* SkNewImageFromBitmapTexture(const SkBitmap&, int sampleCountForN
ewSurfaces, | 57 extern SkImage* SkNewImageFromBitmapTexture(const SkBitmap&, int sampleCountForN
ewSurfaces, |
56 SkSurface::Budgeted); | 58 SkSurface::Budgeted); |
57 | 59 |
58 #endif | 60 #endif |
OLD | NEW |