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 SkImage_DEFINED | 8 #ifndef SkImage_DEFINED |
9 #define SkImage_DEFINED | 9 #define SkImage_DEFINED |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 /** | 76 /** |
77 * Create a new image by copying the pixels from the specified descriptor.
No reference is | 77 * Create a new image by copying the pixels from the specified descriptor.
No reference is |
78 * kept to the original platform texture. | 78 * kept to the original platform texture. |
79 * | 79 * |
80 * Will return NULL if the specified descriptor is unsupported. | 80 * Will return NULL if the specified descriptor is unsupported. |
81 */ | 81 */ |
82 static SkImage* NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, | 82 static SkImage* NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, |
83 SkAlphaType = kPremul_SkAlphaType); | 83 SkAlphaType = kPremul_SkAlphaType); |
84 | 84 |
| 85 /** |
| 86 * Create a new image by copying the pixels from the specified y, u, v text
ures. The data |
| 87 * from the textures is immediately ingested into the image and the texture
s can be modified or |
| 88 * deleted after the function returns. The image will have the dimensions o
f the y texture. |
| 89 */ |
| 90 static SkImage* NewFromYUVTexturesCopy(GrContext*, SkYUVColorSpace, |
| 91 const GrBackendObject yuvTextureHandl
es[3], |
| 92 const SkISize yuvSizes[3], |
| 93 GrSurfaceOrigin); |
| 94 |
85 int width() const { return fWidth; } | 95 int width() const { return fWidth; } |
86 int height() const { return fHeight; } | 96 int height() const { return fHeight; } |
87 uint32_t uniqueID() const { return fUniqueID; } | 97 uint32_t uniqueID() const { return fUniqueID; } |
88 virtual bool isOpaque() const { return false; } | 98 virtual bool isOpaque() const { return false; } |
89 | 99 |
90 /** | 100 /** |
91 * Return the GrTexture that stores the image pixels. Calling getTexture | 101 * Return the GrTexture that stores the image pixels. Calling getTexture |
92 * does not affect the reference count of the GrTexture object. | 102 * does not affect the reference count of the GrTexture object. |
93 * Will return NULL if the image does not use a texture. | 103 * Will return NULL if the image does not use a texture. |
94 */ | 104 */ |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 const int fWidth; | 196 const int fWidth; |
187 const int fHeight; | 197 const int fHeight; |
188 const uint32_t fUniqueID; | 198 const uint32_t fUniqueID; |
189 | 199 |
190 static uint32_t NextUniqueID(); | 200 static uint32_t NextUniqueID(); |
191 | 201 |
192 typedef SkRefCnt INHERITED; | 202 typedef SkRefCnt INHERITED; |
193 }; | 203 }; |
194 | 204 |
195 #endif | 205 #endif |
OLD | NEW |