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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 static inline size_t SkImageMinRowBytes(const SkImageInfo& info) { | 32 static inline size_t SkImageMinRowBytes(const SkImageInfo& info) { |
33 return SkAlign4(info.minRowBytes()); | 33 return SkAlign4(info.minRowBytes()); |
34 } | 34 } |
35 | 35 |
36 // Given an image created from SkNewImageFromBitmap, return its pixelref. This | 36 // Given an image created from SkNewImageFromBitmap, return its pixelref. This |
37 // may be called to see if the surface and the image share the same pixelref, | 37 // may be called to see if the surface and the image share the same pixelref, |
38 // in which case the surface may need to perform a copy-on-write. | 38 // in which case the surface may need to perform a copy-on-write. |
39 extern const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* rasterImage); | 39 extern const SkPixelRef* SkBitmapImageGetPixelRef(const SkImage* rasterImage); |
40 | 40 |
41 // Given an image created with NewTexture, return its GrTexture. This | |
42 // may be called to see if the surface and the image share the same GrTexture, | |
43 // in which case the surface may need to perform a copy-on-write. | |
44 extern GrTexture* SkTextureImageGetTexture(SkImage* textureImage); | |
45 | |
46 // When a texture is shared by a surface and an image its budgeted status is tha
t of the | 41 // When a texture is shared by a surface and an image its budgeted status is tha
t of the |
47 // surface. This function is used when the surface makes a new texture for itsel
f in order | 42 // surface. This function is used when the surface makes a new texture for itsel
f in order |
48 // for the orphaned image to determine whether the original texture counts again
st the | 43 // for the orphaned image to determine whether the original texture counts again
st the |
49 // budget or not. | 44 // budget or not. |
50 extern void SkTextureImageApplyBudgetedDecision(SkImage* textureImage); | 45 extern void SkTextureImageApplyBudgetedDecision(SkImage* textureImage); |
51 | 46 |
52 // Update the texture wrapped by an image created with NewTexture. This | 47 // Update the texture wrapped by an image created with NewTexture. This |
53 // is called when a surface and image share the same GrTexture and the | 48 // is called when a surface and image share the same GrTexture and the |
54 // surface needs to perform a copy-on-write | 49 // surface needs to perform a copy-on-write |
55 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); | 50 extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); |
56 | 51 |
57 extern SkImage* SkNewImageFromBitmapTexture(const SkBitmap&, int sampleCountForN
ewSurfaces, | |
58 SkSurface::Budgeted); | |
59 | |
60 #endif | 52 #endif |
OLD | NEW |